feat(mcp): migrate FlowServer to standalone fastmcp 3.x (#243)#246
Merged
Conversation
Migrate chainweaver.mcp.FlowServer from the SDK-bundled mcp.server.fastmcp.FastMCP to the standalone fastmcp package. The [mcp] extra now installs fastmcp>=3.4 alongside mcp>=1.0 — the inbound MCPToolAdapter still imports mcp.ClientSession and fastmcp re-uses mcp.types.ToolAnnotations, so adapter.py is untouched. FlowServer's public API is preserved (constructor, serve()/serve_async(), .fastmcp, .registered_tool_names). Internals updated for the 3.x API: tools are built via Tool.from_function(...) then add_tool(tool), and serve()/serve_async() delegate to FastMCP.run/run_async(transport=..., show_banner=False) so stdio framing stays clean. Refresh docs + CHANGELOG and add a migration-guard test. https://claude.ai/code/session_01WgHy1iQwVhRtNDU4DPLPFy
Contributor
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'ChainWeaver microbenchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.25.
| Benchmark suite | Current: 96c836a | Previous: d266f6f | Ratio |
|---|---|---|---|
compiled_overhead_ms_n10_llm200_tool10 |
0.6568399999196117 ms |
0.3857400000697453 ms |
1.70 |
compiled_overhead_ms_n5_llm500_tool50 |
0.3962240000419115 ms |
0.3162339999107644 ms |
1.25 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @dgenio
There was a problem hiding this comment.
Pull request overview
Migrates chainweaver.mcp.FlowServer from the MCP SDK-bundled mcp.server.fastmcp.FastMCP to the standalone fastmcp 3.x package while preserving FlowServer’s public API (__init__, serve()/serve_async(), .fastmcp, .registered_tool_names) and keeping stdio output clean for MCP framing.
Changes:
- Switch FlowServer implementation to
fastmcp.FastMCPand register tools viafastmcp.tools.Tool.from_function(...)+add_tool(...). - Update the
[mcp]and[dev]extras to installfastmcp>=3.4alongsidemcp>=1.0. - Refresh docs + changelog and add a test that guards the migration to standalone
fastmcp.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
chainweaver/mcp/server.py |
Migrates FlowServer to standalone fastmcp 3.x tool registration and run APIs (with banner suppressed for stdio framing). |
pyproject.toml |
Adds fastmcp>=3.4 to the mcp and dev optional dependency sets. |
tests/test_mcp_server.py |
Adds a migration-guard test asserting FlowServer is backed by fastmcp.FastMCP. |
docs/mcp-server.md |
Updates outbound MCP server docs to reflect the move to standalone fastmcp while retaining mcp for inbound adapter needs. |
docs/distribution.md |
Updates the verified integration matrix entry for the outbound MCP server to fastmcp 3.4.0 (+ mcp for inbound adapter). |
CHANGELOG.md |
Documents the migration and the [mcp] extra behavior change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate chainweaver.mcp.FlowServer from the SDK-bundled
mcp.server.fastmcp.FastMCP to the standalone fastmcp package. The [mcp]
extra now installs fastmcp>=3.4 alongside mcp>=1.0 — the inbound
MCPToolAdapter still imports mcp.ClientSession and fastmcp re-uses
mcp.types.ToolAnnotations, so adapter.py is untouched.
FlowServer's public API is preserved (constructor, serve()/serve_async(),
.fastmcp, .registered_tool_names). Internals updated for the 3.x API:
tools are built via Tool.from_function(...) then add_tool(tool), and
serve()/serve_async() delegate to FastMCP.run/run_async(transport=...,
show_banner=False) so stdio framing stays clean. Refresh docs +
CHANGELOG and add a migration-guard test.
https://claude.ai/code/session_01WgHy1iQwVhRtNDU4DPLPFy