python-sdk
python-sdk copied to clipboard
The official Python SDK for Model Context Protocol servers and clients
The default mount path of Streamable HTTP is /mcp, but in some environments, a 307 Temporary Redirect to /mcp/mcp/ will appear, causing the request to hang or fail. When the...
Describe the bug The mcp.client.stdio.stdio_client (and its underlying subprocess creation mechanisms) encounters an AttributeError when running in an environment where sys.stderr has been replaced by a custom logger object that...
**Describe the bug** When pydantic deserialize large base64-encoded payload, its memory consumption is much larger than the object itself. **To Reproduce** Steps to reproduce the behavior: ```python import asyncio from...
Description: Hi community, I’m trying to deeply understand the distinction between OpenAI’s Function Calling and Model Context Protocol (MCP). While both involve structured data (JSON) interaction with the model, their...
Some non-standard SSE servers may return numeric IDs as strings, even when the original request used an integer. This change ensures that message.root.id is always an integer to maintain consistency...
## The bug ``` RuntimeError: Task group is not initialized. Make sure to use run(). Response code: 500 (Internal Server Error); Time: 9ms (9 ms); Content length: 1677 bytes (1.68...
Description: When running the MCP auth client against a locally started auth server, the client fails during registration with a 502 error, despite the server appearing to start successfully. Steps...
## Motivation and Context When running npx based servers in stdio mode, the npx process spawns a sub-process. During exit, the main process does not propagate the SIGTERM to the...
## Motivation and Context Be consistent across platforms (Windows, Linux, etc). Some MCP Servers don't react to SIGTERM, so `stdio_client` will hang indefinitely when exiting the context manager. Reference: https://github.com/modelcontextprotocol/python-sdk/pull/372...
Specifically:  `mcp dev server.py` should be `uv run mcp dev server.py`