FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-sdk/docs_src/client/tutorial001.py at main · uuzzrm/python-sdk · GitHub
uuzzrm
python-sdk
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-sdk
/
docs_src
/
client
/
tutorial001.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (13 loc) · 512 Bytes
Breadcrumbs
python-sdk
/
docs_src
/
client
/
tutorial001.py
Copy path
File metadata and controls
18 lines (13 loc) · 512 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
from
mcp
import
Client
from
mcp
.
server
import
MCPServer
mcp
=
MCPServer
(
"Bookshop"
,
instructions
=
"Search the catalog before recommending a book."
)
@
mcp
.
tool
()
def
search_books
(
query
:
str
)
->
str
:
"""Search the catalog by title or author."""
return
f"Found 3 books matching
{
query
!r
}
."
async
def
main
()
->
None
:
async
with
Client
(
mcp
)
as
client
:
print
(
client
.
server_info
)
print
(
client
.
server_capabilities
)
print
(
client
.
protocol_version
)
print
(
client
.
instructions
)
Back
|
FazBrowse Home
|
New Git URL