feat(mcp): migrate to mcp 2.x (MCPServer) #10

Merged
claude merged 1 commits from claude/issue-9 into main 2026-09-10 20:51:44 -04:00
Contributor

Lifts the mcp<2 pin from de2560c. Same three mechanical changes as justin/seed-mcp#23.

1.x 2.x
import mcp.server.fastmcp.FastMCP mcp.server.mcpserver.MCPServer
constructor FastMCP(name, stateless_http=True) MCPServer(name)
transport cfg mcp.settings.host/port/transport_security run() kwargs; settings is gone
@mcp.tool() — unchanged

Verification

1. tools/list is byte-for-byte identical between mcp 1.30.0 and 2.2.0 — 10 tools, dumped with by_alias=True so the comparison is in wire format.

$ diff /tmp/tools-1x.json /tmp/tools-2x.json
IDENTICAL — tools/list byte-for-byte unchanged

2. Boots for real over streamable-http with stateless_http=True, answering initialize 200:

{"result":{"capabilities":{"experimental":{},"prompts":{"listChanged":false},
 "resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}},
 "protocolVersion":"2025-06-18","serverInfo":{"name":"morpheus-docs","version":""}}}

3. CI now runs import docs_mcp.server after pip install (fails in seconds) and again inside the built image before linking the package.

One behavior change

serverInfo.version is "" under 2.x instead of the SDK version — 2.x stopped defaulting it. Cosmetic; left as-is.

Closes #9

Lifts the `mcp<2` pin from de2560c. Same three mechanical changes as justin/seed-mcp#23. | | 1.x | 2.x | |---|---|---| | import | `mcp.server.fastmcp.FastMCP` | `mcp.server.mcpserver.MCPServer` | | constructor | `FastMCP(name, stateless_http=True)` | `MCPServer(name)` | | transport cfg | `mcp.settings.host/port/transport_security` | `run()` kwargs; `settings` is gone | | `@mcp.tool()` | — | **unchanged** | ## Verification **1. `tools/list` is byte-for-byte identical** between mcp 1.30.0 and 2.2.0 — 10 tools, dumped with `by_alias=True` so the comparison is in wire format. ``` $ diff /tmp/tools-1x.json /tmp/tools-2x.json IDENTICAL — tools/list byte-for-byte unchanged ``` **2. Boots for real** over streamable-http with `stateless_http=True`, answering `initialize` 200: ``` {"result":{"capabilities":{"experimental":{},"prompts":{"listChanged":false}, "resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}}, "protocolVersion":"2025-06-18","serverInfo":{"name":"morpheus-docs","version":""}}} ``` **3. CI** now runs `import docs_mcp.server` after pip install (fails in seconds) and again inside the built image before linking the package. ## One behavior change `serverInfo.version` is `""` under 2.x instead of the SDK version — 2.x stopped defaulting it. Cosmetic; left as-is. Closes #9
claude added 1 commit 2026-09-10 20:47:59 -04:00
Lift the mcp<2 pin landed in de2560c. Three mechanical changes from
the seed-mcp#23 port: MCPServer instead of FastMCP, transport options
moved onto run(), and CI import smoke so a green build cannot ship a
non-importing image.

tools/list is byte-for-byte identical between 1.30.0 and 2.2.0 (10
tools). initialize over streamable-http returns 200.

Closes #9
claude merged commit 66ba683ee1 into main 2026-09-10 20:51:44 -04:00
claude deleted branch claude/issue-9 2026-09-10 20:51:44 -04:00
Sign in to join this conversation.