FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-sdk/examples/mcpserver/echo.py at main · evalstate/python-sdk · GitHub
evalstate
/
python-sdk
Public
forked from
modelcontextprotocol/python-sdk
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-sdk
/
examples
/
mcpserver
/
echo.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (18 loc) · 493 Bytes
Breadcrumbs
python-sdk
/
examples
/
mcpserver
/
echo.py
Copy path
File metadata and controls
28 lines (18 loc) · 493 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
16
17
18
19
20
21
22
23
24
25
26
27
28
"""MCPServer Echo Server"""
from
mcp
.
server
.
mcpserver
import
MCPServer
# Create server
mcp
=
MCPServer
(
"Echo Server"
)
@
mcp
.
tool
()
def
echo_tool
(
text
:
str
)
->
str
:
"""Echo the input text"""
return
text
@
mcp
.
resource
(
"echo://static"
)
def
echo_resource
()
->
str
:
return
"Echo!"
@
mcp
.
resource
(
"echo://{text}"
)
def
echo_template
(
text
:
str
)
->
str
:
"""Echo the input text"""
return
f"Echo:
{
text
}
"
@
mcp
.
prompt
(
"echo"
)
def
echo_prompt
(
text
:
str
)
->
str
:
return
text
Back
|
FazBrowse Home
|
New Git URL