python-sdk
python-sdk copied to clipboard
The official Python SDK for Model Context Protocol servers and clients
## Motivation and Context MCP 2025-03-26 introduces a cancellation notification [1] this patch simplifies the usage of this function for the ClientSession by using the anyio.CancelScope as a trigger to...
Enable tool to return structured content and output schema. ## Motivation and Context As per discussion in https://github.com/modelcontextprotocol/modelcontextprotocol/pull/371 there are use cases where being able to know the schema of...
Does current SSE transport or streamingable HTTP spec and python sdk allow call_tool return SSE stream of messages ? Current test shows that in python sdk call_tool result will be...
Hi, I created two functions to call the MCP server, following the official examples. I even specifically set `sse_read_timeout=None` for the SSE connection. However, both functions end up throwing `Session...
Added the ability to dynamically enable and disable tools at runtime with client notifications. ## Motivation and Context This change allows developers to temporarily restrict access to specific tools without...
**Is your feature request related to a problem? Please describe.** When using the client SDK to connect MCP server behind an `API gateway` that adds a deployment-specific prefix (e.g., `/gateway_prefix/`),...
**Describe the bug** When mounting sse_app() from FastMCP with a URL prefix using Starlette’s Mount, the SSE stream still returns the default /messages/ endpoint without the prefix. This causes the...
INFO: 127.0.0.1:56991 - "POST /mcp HTTP/1.1" 307 Temporary Redirect INFO: 127.0.0.1:56991 - "POST /mcp/ HTTP/1.1" 200 OK After using mcp.run(transport="streamable-http") to start the server, why does the client always redirect...
Issue: https://github.com/modelcontextprotocol/python-sdk/issues/602 The `GetPromptResult` class has the field description, however it is not getting returned when using the FastMCP server. Example ``` INFO Processing request of type GetPromptRequest server.py:534 meta=None...
### Summary This PR is tests‑only; it adds coverage but introduces no functional changes. Add unit tests for three un-covered helpers in `src/mcp/cli/cli.py` * **_parse_file_path** (valid / invalid specs) *...