FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-sdk/docs_src/media/tutorial002.py at main · modelcontextprotocol/python-sdk · GitHub
modelcontextprotocol
python-sdk
Repository navigation
Code
Issues
246
(246)
Pull requests
106
(106)
Actions
Projects
Security and quality
12
(12)
Insights
Expand file tree
Breadcrumbs
python-sdk
/
docs_src
/
media
/
tutorial002.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (14 loc) · 448 Bytes
Breadcrumbs
python-sdk
/
docs_src
/
media
/
tutorial002.py
Copy path
File metadata and controls
21 lines (14 loc) · 448 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
from
pathlib
import
Path
from
mcp
.
server
import
MCPServer
from
mcp
.
server
.
mcpserver
import
Audio
,
Image
mcp
=
MCPServer
(
"Brand kit"
)
LOGO_FILE
=
Path
(
__file__
).
parent
/
"logo.png"
CHIME_FILE
=
Path
(
__file__
).
parent
/
"chime.wav"
@
mcp
.
tool
()
def
logo
()
->
Image
:
"""The brand logo as a PNG."""
return
Image
(
path
=
LOGO_FILE
)
@
mcp
.
tool
()
def
chime
()
->
Audio
:
"""The notification chime as a WAV."""
return
Audio
(
path
=
CHIME_FILE
)
Back
|
FazBrowse Home
|
New Git URL