Official MCP Python SDK v2 released, supporting three transports and typed tool definitions
Decision Brief
The SDK requires Python 3.11+ and installs via uv add "mcp[cli]" or pip install "mcp[cli]". The cli extra adds mcp dev, mcp run, and mcp install commands; install plain mcp if unneeded. On the server side, @mcp.tool() and @mcp.resource() decorators define tools and templated resources, with annotations like a: int, b: int acting as JSON Schema while the SDK handles request parsing, validation, and protocol handling. A full server with tools and resources fits in 15 lines, debuggable via mcp dev in MCP Inspector. For Python developers connecting LLM apps to external data and capabilities, the repetitive work of writing schemas, parsing requests, and wiring protocols is largely gone, cutting integration cost to one or two functions plus a docstring. Official support for stdio, Streamable HTTP, and SSE means existing MCP servers in other languages or custom protocols need no transport-compatibility rewrites. The SDK is MIT-licensed, with docs covering v2 features and a migration guide for teams on older versions.
Sources
- Skill Radar(GitHub 趋势)
Trending hands-on MCP servers, agent skills, and AI-coding tools discovered from GitHub search momentum.
- GitHub:modelcontextprotocol/python-sdk
留言
登入后即可留言,和其他 builder 交换实测心得。
还没有留言,抢头香。