FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-sdk/docs_src/index/tutorial001.py at main · modelcontextprotocol/python-sdk · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
modelcontextprotocol
/
python-sdk
Public
Notifications
You must be signed in to change notification settings
Fork
3.8k
Star
24.1k
Code
Issues
206
Pull requests
192
Actions
Projects
Security and quality
6
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-sdk
/
docs_src
/
index
/
tutorial001.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
15 lines (10 loc) · 279 Bytes
Breadcrumbs
python-sdk
/
docs_src
/
index
/
tutorial001.py
Copy path
File metadata and controls
15 lines (10 loc) · 279 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from
mcp
.
server
import
MCPServer
mcp
=
MCPServer
(
"Demo"
)
@
mcp
.
tool
()
def
add
(
a
:
int
,
b
:
int
)
->
int
:
"""Add two numbers."""
return
a
+
b
@
mcp
.
resource
(
"greeting://{name}"
)
def
greeting
(
name
:
str
)
->
str
:
"""Greet someone by name."""
return
f"Hello,
{
name
}
!"
Back
|
FazBrowse Home
|
New Git URL