docs: stop presenting the in-memory client as the way to connect (#3443)
This commit is contained in:
parent
0c9136841f
commit
7bb486a10f
1 changed files with 803 additions and 598 deletions
|
|
@ -11,6 +11,7 @@ from mcp_types import (
|
|||
RequestParams,
|
||||
TextContent,
|
||||
)
|
||||
from starlette.routing import Route
|
||||
|
||||
from docs_src.lowlevel import tutorial001, tutorial002, tutorial003, tutorial004, tutorial005, tutorial006
|
||||
from mcp import Client, MCPError
|
||||
|
|
@ -45,6 +46,13 @@ async def test_the_client_does_not_care_which_server_class_it_connects_to() -> N
|
|||
assert result.structured_content is None
|
||||
|
||||
|
||||
def test_the_last_line_is_an_asgi_app_uvicorn_can_serve() -> None:
|
||||
"""tutorial001: the Try-it's `uvicorn server:app` target is a Starlette app with one route at `/mcp`."""
|
||||
(route,) = tutorial001.app.routes
|
||||
assert isinstance(route, Route)
|
||||
assert route.path == "/mcp"
|
||||
|
||||
|
||||
async def test_only_the_handlers_you_passed_become_capabilities() -> None:
|
||||
"""tutorial001: two tool handlers advertise `tools` and nothing else."""
|
||||
async with Client(tutorial001.server) as client:
|
||||
|
|
|
|||
Loading…
Reference in a new issue