mrkeyoor.com_
Thu 17 Sept 23:18 UTC
AI Toolsevaluationupdated 26 Aug 2026

python-sdk review

The MCP Python SDK is the official Python library for building Model Context Protocol servers and clients. It turns typed Python functions into tools, resources, and prompts, then handles stdio, Streamable HTTP, or SSE communication with compatible AI applications.

+57stars / 7d
Verdict

Our MCP Python SDK run installed 61 packages and built in 38 seconds combined, but its tests never collected because logfire was absent. Use it when Python and official protocol coverage matter, especially for a server or client that must track the current MCP specification. Pin v1 until migration is complete, and add interoperability tests for every non-Python client.

We ran it

Lab card: what happened when we ran python-sdkScreenshot of python-sdk (py.sdk.modelcontextprotocol.io)
Install✓ · 32s61 packages · 66 MB
Build✓ · 6s
Tests✗ · 6sran, no count parsed
Known vulns0(pip-audit)
Repo1663 files~144,627 lines of source · 14.5 MB · 10 CI workflows · tests dir

Answers from our run

Does python-sdk build from source?

Dependencies installed in 32 seconds (61 packages), and the build succeeded in 6 seconds. We cloned commit 56af447 into a clean Debian container with 3 CPUs and no project-specific setup.

Do python-sdk's tests pass?

The test command failed in our container, and its output did not report a pass or fail count.

Does python-sdk have known vulnerabilities in its dependencies?

pip-audit found none in the dependency tree at the time of our run.

Who should not use python-sdk?

Applications still written against v1 APIs without migration time: the README says pip install mcp now installs v2 and tells those users to pin mcp>=1.28,<2.

What are the alternatives to python-sdk?

MCP TypeScript SDK, FastMCP, MCP Go SDK. Our MCP Python SDK run installed 61 packages and built in 38 seconds combined, but its tests never collected because logfire was absent.

Setup3/5Small install and quick build; source tests missed logfire
Docs5/5Current guides cover v2, migration, clients, servers, and API
Community5/524,128 stars with same-day issue and pull request activity
Maturity4/5Official v2.1.1, with active transport and edge-case fixes

Who it’s for

Python developers publishing tools or data to MCP hosts.
Application teams writing clients that connect to several MCP servers.
Protocol implementers who need the official types and transport behavior.
Existing v1 users prepared to work through the documented v2 migration.

Who it’s NOT for

Applications still written against v1 APIs without migration time: the README says pip install mcp now installs v2 and tells those users to pin mcp>=1.28,<2.
Projects on Python 3.9 or older: the current SDK requires Python 3.10 or newer.
Teams expecting a clean source checkout to run tests after the base install: our command stopped while importing tests/conftest.py because logfire was missing.
Multi-server clients that must accept empty servers today: issue 3384 reproduces a raw KeyError and a session cleanup leak when no tools, resources, or prompts are exposed.
Cross-language systems that may return NaN or Infinity in tool data: issue 3385 shows the text path emitting JSON that Python accepts but standard JavaScript parsing rejects.

Setup reality

Our sandbox installed 61 Python packages in 32 seconds and used 66 MB on disk. The build succeeded in 6 seconds. Tests exited with code 4 after 6 seconds, before collection, because tests/conftest.py could not import logfire; pip-audit found 0 known vulnerabilities.

A local stdio server needs no hosted credential. Streamable HTTP deployments need normal server configuration, authentication, TLS, and session policy. Clients may need OAuth credentials or service-specific secrets. The optional cli extra supplies mcp dev, mcp run, and mcp install.

The checkout had 1,663 files, about 144,627 source lines, 10 CI workflows, a tests directory, and no Dockerfile. V2 is a breaking rework, so v1 applications need the migration guide or a <2 pin before installing current packages.

Typed Python functions become MCP tools and resources

The SDK handles both sides of the Model Context Protocol. A server can expose tools, resources, and prompts, while a client can discover and call those capabilities. Type hints become input schemas, so a small function and docstring can be enough to define a tool without hand-writing JSON Schema or request parsing. This keeps simple servers readable and gives advanced users lower-level protocol types when the convenience layer is insufficient.

The README demonstrates a server in 15 lines and a client in 10. Stdio works well for a host launching a trusted local process. Streamable HTTP is the deployment transport, and SSE remains supported for compatibility. A client can also receive a custom transport. This breadth makes the official package the sensible default for Python teams that need to test protocol behavior across local tools, remote services, and more than one MCP host.

V2 follows the 2026-07-28 specification

V2 is the current stable line and a major architectural rework. It supports the July 28, 2026 MCP specification and earlier revisions. The project keeps v1 on a separate branch for critical bug and security fixes, but pip install mcp now resolves to 2.x. Existing applications should either complete the migration guide or pin a range such as mcp>=1.28,<2 before refreshing an environment.

Release v2.1.1 arrived on August 25, 2026. Its single listed change directs old mcp.server.fastmcp imports to the migration guide, which is a small patch with a useful message: code written for the old convenience surface will not become v2 code through an accidental import fallback. The main documentation now separates getting started, v2 changes, migration, clients, and the API reference, making the version boundary hard to miss.

What happened when we ran it

Our sandbox installed 61 packages in 32 seconds and used 66 MB on disk. The build succeeded in another 6 seconds. Pip-audit reported 0 known vulnerabilities. We ran commit 56af447 in a fresh unprivileged Debian container with 3 CPUs, 8 GB of RAM, Python 3.12, and no secrets. The checkout itself contained 1,663 files, about 144,627 source lines, and 14.5 MB of data.

Tests stopped after 6 seconds with exit code 4, before pytest could collect any cases. tests/conftest.py imported CaptureLogfire, and Python raised ModuleNotFoundError: No module named 'logfire'. The log contains no failed assertion or test count, so it does not show a protocol defect. It shows that the dependency set installed by our standard source procedure was not enough to start the repository's test suite, despite the checkout having a tests directory and 10 CI workflows.

HTTP deployment needs normal service engineering

A local stdio tool can be genuinely small. A remote MCP endpoint is a network service with authentication, origin rules, request limits, timeouts, session cleanup, TLS, and logs. Active pull requests on August 26 addressed idle Streamable HTTP sessions, concurrent-session caps, same-origin redirect following, and authorization metadata validation. Those are healthy maintenance signals and a reminder that the 15-line example is an interface tutorial, not a production deployment plan.

Issue 1664 gives one specific integration trap. A custom User-Agent supplied to the Streamable HTTP transport was not forwarded into its authentication flow, which caused trouble with an AWS WAF baseline rule. The report says teams had to consider disabling that rule. If your auth path crosses a proxy or firewall, capture every discovery and token request in staging instead of checking only the final MCP call.

Empty servers and non-finite numbers expose edges

Issue 3384 reports that ClientSessionGroup mishandles a server exposing 0 tools, resources, and prompts. One connection route raises a raw KeyError; another forgets the exit stack and can leave the transport open until the whole group closes. Empty capability sets are plausible during rollout or permission filtering, so multi-server clients should include that case in connection and shutdown tests.

Issue 3385 finds a cross-language serialization bug. A tool without a return annotation can emit NaN or Infinity as bare tokens in a text block and still report success. Python's JSON loader accepts them by default, while JSON.parse in Node rejects them. Give tools explicit return types, reject non-finite numeric values at the boundary, and run fixtures through the actual languages used by clients rather than testing Python against Python only.

Official status makes it the default, not an exemption

GitHub showed 24,128 stars, 392 combined issues and pull requests, and a last push on August 26, 2026. The high combined count belongs to a fast-moving official implementation and includes active pull requests; it is not a count of confirmed bugs. Same-day work on authorization, redirects, sessions, pagination, and parsing shows maintainers dealing with protocol and deployment details rather than leaving them to downstream packages.

Choose this SDK for Python MCP work unless a higher-level framework solves a specific operational need. Its MIT license, current specification support, and server-client coverage reduce the risk of inventing protocol behavior yourself. The failed test startup in our sandbox means contributors need to verify the full development extras, while the open interoperability reports justify a focused contract suite around authentication, lifecycle cleanup, and JSON values.

Alternatives

ProjectWhat it isPick it when
MCP TypeScript SDK gh↗The official MCP server and client implementation for TypeScript.pick this instead when your host application and deployment stack are already Node.js or TypeScript.
FastMCP gh↗A higher-level Python framework for authoring and operating MCP applications.pick this instead when its server composition and deployment conveniences matter more than staying close to the official SDK surface.
MCP Go SDKThe official Go implementation for MCP clients and servers.pick this instead when static binaries, Go services, or your existing backend team make Python a poor fit.

Sources

  1. MCP Python SDK repository and README
  2. MCP Python SDK v2.1.1 release
  3. Issue 3384: empty server session handling
  4. Issue 3385: non-finite float JSON
  5. Issue 1664: auth request User-Agent

More ai tools reviews

rowboat · skills · superpowers-zh · yolov5 · eve · MemOS · the whole board →