← Back to directory
M

MCP Python SDK

Official
Framework / SDK
The official Python SDK for building MCP servers and clients

This is a framework for building MCP servers or agents, not a server you connect a client to.

Category
Dev Tools #20 of 438
Stars
★ 24.7k Very popular
Transport
stdio (local process) · SSE · Streamable HTTP
Runtime
Python 3.10+
Credentials
No credential needed
License
MIT
Last commit
68FMRS · C

The officially maintained MCP Python SDK for building servers and clients, not itself a fixed-capability server; documentation, a migration guide, and community support channels are all present, with v2 as the current stable line and v1.x still receiving security patches.

Strongest · Maintenance 18/20 Weakest · Reliability 9/20

Reliability
9/20
Security and permissions
12/20
Maintenance
18/20
Documentation
16/20
Setup experience
13/20
Why each score
Reliability 9/20
The README shows a runnable 15-line server example and a 10-line client example, with tool schemas auto-derived from type hints, and the described behavior matches the snippets. However, this review is based solely on the README text; no server manifest was provided, and no CI workflow or committed test files were available as verifiable execution evidence. Reproducibility of the MCP init/tool-list handshake across environments and error/dependency handling are undocumented. Per the static calibration rule, reliability cannot exceed 12 without such evidence, so it is scored 9.
Security and permissions 12/20
As an official protocol SDK rather than a specific business-logic server, the README shows no hardcoded secrets, no dangerous operations executed by default, and no red-line indicators (no malware, no covert exfiltration). However, the material provides no discussion of least-privilege scoping, data boundaries for tool calls, external network access limits, or confirmation flows for dangerous operations. This missing evidence prevents a high score under the conservative deduction rule.
Maintenance 18/20
Strong evidence: MIT license, 23,895 stars, a clearly documented dual-line maintenance strategy (v2 current, v1.x still receiving critical fixes and security patches), a migration guide, a contributing guide link, and a dedicated Discord dev channel plus issue templates — all indicating active, organized maintenance with clear ownership. 511 open issues is unremarkable for a project of this scale and activity.
Documentation 16/20
Documentation is well-layered: getting-started guide, What's New, API reference, and migration guide are all linked, and the README itself contains copy-runnable minimal examples for both server and client, plus guidance on install variants (including the cli extra). However, version-pinning caveats (recommending `mcp<2`) are a hidden assumption, and details like tool parameter limits, rate limits, and troubleshooting require following external links not reproduced here, so it falls short of full marks.
Setup experience 13/20
Install steps are simple (`uv add`/`pip install`), with a minimal working example and MCP Inspector for debugging, and cross-platform compatibility can be reasonably inferred from standard Python packaging. Per the static calibration rule, setup cannot exceed 15 without CI/test evidence in the reviewed material; additionally no concrete client configuration example (e.g., for Claude Desktop) is included, so full marks are not warranted.

Static review · not runListed 2026-08-06

Read the FMRS scoring method →

Fit and risk

What it can accessRuns commands or codeUses the network

Best for

  • Python developers comfortable with type hints who want to quickly build an MCP server or client
  • Teams integrating MCP protocol capabilities (tool calls, resource access) into their own projects
  • Existing v1 users evaluating or migrating to the MCP v2 specification

Not for

  • Users looking for a ready-to-install, end-user-facing MCP server (this repo is an SDK, not a specific service)
  • Projects stuck on Python 3.9 or earlier that cannot upgrade their runtime
  • Projects not yet ready to handle v1-to-v2 breaking changes and needing long-term lock-in to v1 behavior

Required permissions

  • The SDK itself does not request specific system permissions; actual permission needs depend on the server logic developers build with it
  • If a server built with it runs over stdio, the host process can execute arbitrary local code logic defined by the developer's tool functions
  • If a server uses SSE or Streamable HTTP transport, network listening/access is required

Risks and side effects

  • As a development library, the security of any resulting server depends entirely on how the implementer writes tool and resource logic — the SDK cannot guarantee downstream code safety
  • v1 to v2 introduces architectural breaking changes; projects without an upper version bound may unexpectedly pull an incompatible 2.x release on dependency upgrade
  • Tool function parameters and return values may still trigger unintended behavior from malicious or malformed input if the implementer omits extra validation

Setup

Before you start

Runtime:Python 3.10+

Install with uv add "mcp[cli]" or pip install "mcp[cli]" (the cli extra adds the mcp dev/mcp run/mcp install command-line tool; install plain mcp if the CLI isn't needed). Because pip install mcp now installs 2.x by default, projects still relying on v1 behavior should pin an upper bound such as mcp>=1.28,<2 until migrated. After installing, write a server script using @mcp.tool() and @mcp.resource() decorators and run it with uv run mcp dev server.py to debug it in the MCP Inspector.

Check that it works

Run uv run mcp dev server.py to open the MCP Inspector; the add tool should appear, and calling it with a=1, b=2 should return 3.

Troubleshooting

  1. Confirm Python is 3.10 or newer, since install/run will fail on older versions
  2. If the `mcp` CLI (`mcp dev`/`mcp run`/`mcp install`) is needed, verify the `[cli]` extra was installed
  3. If the project depends on v1.x behavior, check that dependency declarations pin an upper bound below 2 to avoid an automatic upgrade to v2
  4. Use `uv run mcp dev server.py` with the MCP Inspector to debug tool call or resource resolution issues
  5. Consult the migration guide at py.sdk.modelcontextprotocol.io for v1-to-v2 upgrade issues

Things to try

Once connected, you can ask your AI assistant things like:

  • Build an MCP server exposing an add tool using the official Python SDK
  • Write an MCP client that connects to http://localhost:8000/mcp and calls the add tool
  • List the tools and resources defined in my server.py

Use cases

Writing a custom MCP server from scratch that exposes tools, resources, and prompts
Writing a Python client that connects to a local or remote MCP server
Connecting directly to an in-memory server object for tests, with no transport layer involved
Switching an existing server between stdio, SSE, and Streamable HTTP transports

Overview

This is the official Python implementation of the Model Context Protocol (MCP), maintained by the modelcontextprotocol organization. It is not a standalone server with a fixed set of tools, but a development library: it lets developers write MCP servers that expose tools, resources, and prompts, or clients that connect to any MCP server. The SDK supports all three standard transports (stdio, Streamable HTTP, and SSE) and derives JSON Schema automatically from Python type hints, eliminating hand-written protocol parsing. It is currently on the v2 major line (supporting the 2026-07-28 spec revision and all earlier ones), while v1.x continues to receive critical bug fixes and security patches on its own branch. Requires Python 3.10+.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 64.1k · Tools 2 Compare with this →

Source revision af4c6f4db2cd Data synced 2026-11-04 Read the FMRS scoring method