python-sdk
python-sdk copied to clipboard
The official Python SDK for Model Context Protocol servers and clients
This PR adds support for `root_path` in subpath routing of SSE andstreamable-http endpoints when using Nginx or other HTTP middleware as a reverse proxy. ## Motivation and Context When deploying...
**Describe the bug** When a tool call is made to any tool with a defined outputSchema, the server absolutely blows up if the function implementing the tool call does not...
Experimenting with the idea of passing back resources with progress notification ## Motivation and Context Tinkering to see if this idea works https://github.com/modelcontextprotocol/modelcontextprotocol/pull/549#issuecomment-2906863831 ## How Has This Been Tested? Unit...
Hello, I noticed that when using custom tools locally with LangChain, the `RunnableConfig` parameter is automatically injected into the tool function if declared in the signature. This allows easy access...
- Add auth to TOC - Specify python for code block highlighting - Format auth example ## Motivation and Context Update readme ## How Has This Been Tested? ## Breaking...
Add ruff rules for Pylint and McCabe cyclomatic code complexity. * https://docs.astral.sh/ruff/rules/#pylint-pl * https://docs.astral.sh/ruff/rules/#mccabe-c90 % `ruff check --select=C90,PL --statistics | sort -k2` ``` 5 C901 [ ] complex-structure 1 PLC0414...
**Is your feature request related to a problem? Please describe.** When the MCP server registers a large number of tools, the context size grows significantly, which negatively impacts tool selection...
**Describe the bug** A clear and concise description of what the bug is. **To Reproduce** use the demo server in quick start document ``` # server.py from mcp.server.fastmcp import FastMCP...
This PR adds exception handling to validation of incoming grpc requests in the session. ## Motivation and Context While the public interface of the session (e.g. `session.send_request`) makes assumptions about...
Hi, The protocol specifies that there's a notification sent to clients when the list of tools or resources changes on the server-side, but I'm not sure how to trigger this....