python-sdk
python-sdk copied to clipboard
The official Python SDK for Model Context Protocol servers and clients
## Motivation and Context an example for https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1306 from https://github.com/modelcontextprotocol/modelcontextprotocol/discussions/1522 address #1590 ## How Has This Been Tested? see document as readme of this PR. ## Breaking Changes n/A ##...
### Question In `mcp.server.fastmcp.utilities.func_metadata.FuncMetadata.call_fn_with_arg_validation` ```python if fn_is_async: return await fn(**arguments_parsed_dict) else: return fn(**arguments_parsed_dict) ``` In FastMCP, if a tool is defined as a synchronous function, it will block the whole...
I've added two server-side notification handlers, one for `InitializedNotification` and one for `RootsListChangedNotification`. ## Motivation and Context This allows an MCP server to fully implement roots support, since once the...
MCP Server won't work with wildcard in "Accept" header and therefore is non‑compliant with HTTP spec
### Question ### Use Case My client sends a request to MCP Server with `Accept` header `*/*` (Same for `application/*, text/event-stream`). Server rejects this request because it expected strictly `application/json`...
## Motivation and Context Add support for Pluggable Transport Abstractions in MCP Python SDK. ### Add abstractions to support `Pluggable Transport`. This PR majorly adds two abstract classes and APIs...
### 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...
To match the last protocol spec, the Implementation schema must be updated and new attribute propagated on server constructor. ## Motivation and Context To match the last protocol specification update....
### Description Has the MCP team considered lazy importing in the `mcp` package? Right now, if you import anything from mcp, it will run the mcp/__init__.py file, and it will...
### Question Hello, Where is package.json? Where is server.py? Is it a library to implement MCP? ### Additional Context _No response_