Skip to content

spike(mcp): port to MCP Python SDK v2 / spec 2026-07-28 - DO NOT MERGE YET - #88

Open
StephenAbbott wants to merge 1 commit into
mainfrom
spike/mcp-sdk-v2
Open

spike(mcp): port to MCP Python SDK v2 / spec 2026-07-28 - DO NOT MERGE YET#88
StephenAbbott wants to merge 1 commit into
mainfrom
spike/mcp-sdk-v2

Conversation

@StephenAbbott

Copy link
Copy Markdown
Owner

Throwaway reference port answering the R2 open questions (all favourable):

  • FastMCP → MCPServer is mechanical: constructor keeps name/instructions; transport settings (stateless_http, path, transport_security) move to streamable_http_app() in asgi_app(). app.py needed ZERO changes — the session_manager property, routes-extraction (307 workaround) and lifespan pattern all carry over.
  • Dependency resolution is clean: httpx 0.28 (opencheck) and httpx2 2.9 (mcp v2) coexist as separate packages; starlette stays 1.0.0; fastapi 0.136 untouched; adds mcp-types, opentelemetry-api, truststore.
  • Downlevel clients verified live: an mcp 1.28 client negotiates 2025-11-25 against this server via the old initialize handshake, while a v2 client negotiates 2026-07-28 — dual-version serving works out of the box.
  • SEP-2549 cache hints wired: tools/list now advertises ttlMs=86400000, cacheScope=public (R4).
  • Test suite: 21/21 pass after one snake_case fix (inputSchema → input_schema in test_mcp.py).

Held back for the real migration phase: pass version=version to MCPServer (server_info.version is empty), CORS header review (MCP-Protocol-Version / Mcp-Method / Mcp-Name), docs/mcp-server.md + ard.md + descriptor updates, MCP Inspector run, Tasks extension (R3), per-tool rate limiting via Mcp-Name (R5).

…E YET

Throwaway reference port answering the R2 open questions (all favourable):

- FastMCP → MCPServer is mechanical: constructor keeps name/instructions;
  transport settings (stateless_http, path, transport_security) move to
  streamable_http_app() in asgi_app(). app.py needed ZERO changes — the
  session_manager property, routes-extraction (307 workaround) and lifespan
  pattern all carry over.
- Dependency resolution is clean: httpx 0.28 (opencheck) and httpx2 2.9
  (mcp v2) coexist as separate packages; starlette stays 1.0.0; fastapi
  0.136 untouched; adds mcp-types, opentelemetry-api, truststore.
- Downlevel clients verified live: an mcp 1.28 client negotiates 2025-11-25
  against this server via the old initialize handshake, while a v2 client
  negotiates 2026-07-28 — dual-version serving works out of the box.
- SEP-2549 cache hints wired: tools/list now advertises ttlMs=86400000,
  cacheScope=public (R4).
- Test suite: 21/21 pass after one snake_case fix (inputSchema →
  input_schema in test_mcp.py).

Held back for the real migration phase: pass version=__version__ to
MCPServer (server_info.version is empty), CORS header review
(MCP-Protocol-Version / Mcp-Method / Mcp-Name), docs/mcp-server.md +
ard.md + descriptor updates, MCP Inspector run, Tasks extension (R3),
per-tool rate limiting via Mcp-Name (R5).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant