What this thread does
The problem
A dependency refresh broke an existing Python MCP server. Identify the distribution behind its imports before editing; standalone FastMCP is a separate framework migration.
Versions and licences
| Distribution | Verified release and licence | Current high-level import |
|---|---|---|
| mcp | 2.3.0, released 2026-10-02; MIT; checked 2026-10-20 | from mcp.server import MCPServer |
| fastmcp | As of November 2026, 4.2.5, released 2026-11-23; Apache-2.0; checked 2026-11-23 | from fastmcp import FastMCP |
Package versions and negotiated protocol versions are different. No service prices were checked.
What changed
- On 2026-07-28 (checked 2026-10-20), the release introduced SDK 2.0.0 (checked 2026-10-20), renamed the high-level server and added
Client. It serves both protocol eras. The maintenance line remains available; no shutdown date is given. - The migration guide, checked 2026-10-20, removes the old server module, changes Python field access to snake_case and replaces the deprecated HTTP client spelling.
- The release notes, dated 2026-10-02 (checked 2026-10-20), require
httpx2>=2.10.0(checked 2026-10-20). They supersede older migration prose about always sending empty_metaon legacy requests: it is now omitted there. - Standalone FastMCP's upgrade guide, checked 2026-10-20, describes its own major upgrade and HTTP dependency swap. Its version number does not identify the official SDK API.
What breaks
The official migration table, checked 2026-10-20, verifies these symptoms:
| Symptom | Stale code |
|---|---|
ModuleNotFoundError: No module named 'mcp.server.fastmcp' | Old server import |
AttributeError: 'Tool' object has no attribute 'inputSchema' | CamelCase attribute access |
ImportError: cannot import name 'streamablehttp_client' | Deprecated function spelling |
The what's-new page, checked 2026-10-20, also flags removed experimental task runtime and low-level APIs. Import repair alone is insufficient for those applications.
How to migrate
1. Inventory the installed family and affected code with these proposed commands. Keep the old lockfile for rollback.
uv run python -c 'from importlib.metadata import version; print(version("mcp"))'
rg -n 'mcp.server.fastmcp|from fastmcp|streamablehttp_client|inputSchema|except httpx' .
2. Upgrade the official distribution in a branch. The release documents mcp[cli]; this exact pin selects the PyPI release above, checked 2026-10-20.
uv add 'mcp[cli]==2.3.0'
uv run python -c 'from mcp.server import MCPServer; print(MCPServer.__name__)'
If migration must wait, the release guidance uses mcp>=1.28,<2 (checked 2026-10-20). Resolve and test the constraint against your other dependencies.
3. Apply the official moves, checked 2026-10-20: mcp.server.fastmcp becomes mcp.server.mcpserver; FastMCP becomes MCPServer; inputSchema becomes input_schema; isError becomes is_error. Keep mcp.types imports. Serialize wire models with model_dump(by_alias=True, mode="json").
4. Move transport options to startup. The running guide, checked 2026-10-20, uses:
from mcp.server import MCPServer
mcp = MCPServer("Bookshop")
if __name__ == "__main__":
mcp.run(transport="streamable-http", port=3001)
Use stdio for a local subprocess; retain SSE only for hosts requiring it. For HTTP clients, use streamable_http_client, configure httpx2.AsyncClient through http_client=, and unpack two streams; see client transports, checked 2026-10-20.
5. Update OAuth callbacks to return AuthorizationCodeResult from mcp.client.auth, carrying code, state and redirect iss. Use httpx2 objects and exception classes at SDK boundaries. Follow the OAuth client example, checked 2026-10-20, preserving issuer validation.
6. If deliberately switching to standalone FastMCP, follow its SDK migration guide, checked 2026-10-20. It uses from fastmcp import FastMCP and mcp.run(transport="http", ...). Do not carry that transport spelling into the official SDK.
What to test
Start with the testing guide's in-memory Client(mcp), checked 2026-10-20, then test the real subprocess and HTTP endpoint. Assert tool names, schemas, a read-only result, error results and wire serialization. Cancel a call, then make another.
Exercise default negotiation and Client(target, mode="legacy"). The legacy guide, checked 2026-10-20, explains the handshake and back-channel differences. Test login and rejected synthetic credentials over HTTP; in-memory success does not exercise HTTP auth.
Community evidence
- nirvana6's Jupyter MCP issue, checked 2026-10-20, reports the import failure after dependency resolution. Maintainer echarles confirmed a temporary upper bound was merged: “merged, with pin mcp<2”. This supports a rollback option, not universal compatibility.
- zhourong-bot's Token-Saver issue, checked 2026-10-20, reports the same unconstrained-dependency trap. It is bot-authored without maintainer confirmation in the fetched page; treat it as weaker evidence.
Pitfalls
Do not install standalone FastMCP merely to restore an official import. Check exception types and schema snapshots after mechanical rewrites. A package pin is not a protocol pin. Compare main-branch documentation with the selected release notes.
A prompt to give your agent
Your training data predates this migration. Read <https://py.sdk.modelcontextprotocol.io/migration/> and <https://github.com/modelcontextprotocol/python-sdk/releases/tag/v2.3.0> before editing; do not guess imports or flags. Identify our installed distribution and lockfile, list affected APIs, and propose the smallest official-SDK migration using exact symbols from those pages. If this is standalone fastmcp, read its matching upgrade guide first. Show schema, subprocess, HTTP and auth tests; report unverified assumptions.
Limits
No packages installed, migration executed, server run or compatibility tests performed. Evidence is issue-level demand, including one bot report, not an adoption survey. Main docs may lead releases.
Started from a post by @maxisbey, packaged by the editor. Original post