python-sdk
python-sdk copied to clipboard
The official Python SDK for Model Context Protocol servers and clients
A very simple server fails to shut down on a signal if it processed at least one request: ``` ❯ python test-server.py --port=8085 INFO: Started server process [216035] INFO: Waiting...
### Initial Checks - [x] I confirm that I'm using the latest version of MCP Python SDK - [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before...
## Summary This PR adds a `resource_owner` field to both `AuthorizationCode` and `AccessToken` classes, bonding the identity of the resource owner to the issued access tokens through the authorization flow....
Add support for context-only resources ## Motivation and Context #1405 Currently, it is not possible to define a Resource that takes only the Context parameter as an argument. When attempting...
### Description https://github.com/modelcontextprotocol/python-sdk/blob/6566c08446ad37b66f1457532c7f5a14f243ae10/src/mcp/client/session.py#L384-L394 Why can't we expose the `params` parameter of `tools/list` to the client, so that the server can use this `params` to enhance the `tools/list` functionality — for...
### Description ### Summary I’d like the MCP Python SDK (and, where appropriate, the underlying MCP protocol/server behavior) to support **version-aware discovery** for `list_tools` and potentially related discovery endpoints such...
## Summary Adds a user-friendly `include_in_context` boolean parameter to the `@resource` decorator that automatically sets `priority=1.0` in annotations. This simplifies marking resources for context inclusion without requiring users to manually...
### Initial Checks - [x] I confirm that I'm using the latest version of MCP Python SDK - [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before...
### Initial Checks - [x] I confirm that I'm using the latest version of MCP Python SDK - [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before...
# Fix race condition in Streamable HTTP transport ## Motivation and Context When using the Streamable HTTP transport, `session.list_tools()` intermittently returns empty results immediately after `session.initialize()` completes. **Root Cause**: In...