// the find
modelcontextprotocol/python-sdk
The official Python SDK for Model Context Protocol servers and clients
The official Python implementation of Model Context Protocol, for building both MCP servers (exposing tools/resources/prompts to LLM hosts) and MCP clients that talk to them. It's the reference SDK for anyone building against MCP in Python rather than rolling their own JSON-RPC layer.
The decorator API (@mcp.tool()) derives the JSON Schema straight from type hints and docstrings, so a plain Python function is the whole tool definition — no schema boilerplate. It implements all three transports (stdio, Streamable HTTP, SSE), covering both local dev tools and real deployed services from the same codebase. Docs are unusually thorough for an SDK: docs_src/ has dozens of standalone tutorial scripts covering edge cases like cancellation, elicitation, OAuth clients, and multi-round-trip sampling, not just the happy path. It also runs a conformance test suite against pinned spec versions in CI, which is a real signal for a protocol SDK where silent drift from spec is the main failure mode.
It's the reference implementation of a protocol that's still moving — the existence of a dedicated migration.md and a 'what's new in v2' doc means breaking changes have already happened once and will again; pin your version. Python 3.10+ floor rules out anything running on older interpreters or constrained embedded environments. Auth and authorization are documented as a separate, bolt-on concern (docs/run/authorization.md) rather than something the core decorator API nudges you toward, so it's easy to ship a tool-exposing server with no access control by default. The README's 15-line example undersells how much surface area the full SDK actually has (middleware, pagination, identity assertion, session groups) — expect a real ramp-up past the toy example if you need any of that.