MCP Python SDK
The official Python SDK for the Model Context Protocol (MCP), released by Anthropic. It assists developers in implementing MCP clients or servers within Python environments, enabling large language models to connect with external tools and data sources.
Core Facts
FastMCP是MCP Python SDK的高层封装,借鉴了FastAPI的设计哲学,通过Python装饰器将普通函数转化为MCP工具
The MCP Python SDK uses Python's type annotations and Pydantic's Field descriptors to automatically generate specification-compliant JSON Schema via reflection mechanisms.
Timeline (last 90 days)
After the MCP Python SDK entered version 2, the server class was renamed to mcp-server; older tutorials still call it fast-mcp.
The command to install the official MCP Python SDK is pip install mcp, and it requires Python 3.10 or newer.
In the MCP Python SDK, when a tool error is thrown, the error message is passed back to the model for self-correction; other exceptions are hidden by the SDK as a generic error to prevent stack information from leaking into the prompt.
The three Python servers are built on the MCP Python SDK's high-level MCPServer, with the dependency range tightened to mcp>=2.3,<3.
The way to install the MCP Python SDK is to run pip install mcp.
Once MCP tools are exposed, an Agent's invocation decisions depend on the model's judgment, and in production environments permission checks, parameter whitelists, and audit logs still need to be added at the outer layer.
The value of MCP lies in turning each Agent framework writing its own tool adaptation layer into implementing once and reusing across multiple ends, which is the premise of this article using a single Python file to serve multiple Agent scenarios simultaneously.
The MCP server is built on the MCPServer class of the MCP Python SDK 2.1.1, negotiates protocol version 2025-11-25, and is launched over stdio.
Within 30 days, three authentication-related security vulnerabilities were successively exposed in the MCP ecosystem, appearing in the MCP Python SDK, Rust SDK (rmcp), and LiteLLM respectively.
Teams integrating MCP should confirm that the MCP Python SDK, rmcp, and LiteLLM have all been updated to patched versions.
All Facts (9)
FastMCP是MCP Python SDK的高层封装,借鉴了FastAPI的设计哲学,通过Python装饰器将普通函数转化为MCP工具
75%VerifiedThe MCP Python SDK uses Python's type annotations and Pydantic's Field descriptors to automatically generate specification-compliant JSON Schema via reflection mechanisms.
65%UnverifiedAfter the MCP Python SDK entered version 2, the server class was renamed to mcp-server; older tutorials still call it fast-mcp.
50%UnverifiedThe command to install the official MCP Python SDK is pip install mcp, and it requires Python 3.10 or newer.
50%UnverifiedIn the MCP Python SDK, when a tool error is thrown, the error message is passed back to the model for self-correction; other exceptions are hidden by the SDK as a generic error to prevent stack information from leaking into the prompt.
50%UnverifiedThe three Python servers are built on the MCP Python SDK's high-level MCPServer, with the dependency range tightened to mcp>=2.3,<3.
50%UnverifiedOnce MCP tools are exposed, an Agent's invocation decisions depend on the model's judgment, and in production environments permission checks, parameter whitelists, and audit logs still need to be added at the outer layer.
50%UnverifiedThe MCP server is built on the MCPServer class of the MCP Python SDK 2.1.1, negotiates protocol version 2025-11-25, and is launched over stdio.
50%UnverifiedThe value of MCP lies in turning each Agent framework writing its own tool adaptation layer into implementing once and reusing across multiple ends, which is the premise of this article using a single Python file to serve multiple Agent scenarios simultaneously.
50%