python-sdk
python-sdk copied to clipboard
The official Python SDK for Model Context Protocol servers and clients
This is more in the nature of a request for clarification. The sample code in the SDK here: https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/servers/simple-prompt/mcp_simple_prompt/server.py shows the use of `create_initialization_options` to set the initialization options. However...
When looking at the examples, it seems like you always need to launch the server and client in the same script, because they share the read/write variables. Is there a...
Pydantic's AnyUrl requires a host to be specified. For file resources this means that a triple slash such as `file:///foo.txt` is required because there is no host. We should likely...
eg, I'd like to be able to run background tasks and pool http connections: ```python @contextlib.asynccontextmanager async def lifespan_context(): async with anyio.create_task_group() as tg, httpx.AsyncClient() as client: yield {"tg": tg,...
Ensure that the capabilities that the local client or server is configured with cover: 1. Notifications that are sent at runtime 2. Any request handlers that are added See https://github.com/modelcontextprotocol/typescript-sdk/pull/52...
The SDK currently does not pass strict pyright typechecking. A major problems is typing generics correctly. We need to fix this before a major release. I consider this a bug.
TypeScript example, but should also be portable to our Python SDK: ```typescript export function mcpProxy({ transportToClient, transportToServer, onerror, }: { transportToClient: Transport; transportToServer: Transport; onerror: (error: Error) => void; })...
Multiplexing has recurred for me a few times now—clients often need to connect to multiple servers simultaneously. Might be worth building something for it into the client SDK. I think...