Refactor MCP server to use FastMCP framework #3
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.
User description
Replace manual MCP protocol implementation with FastMCP framework, reducing code complexity from ~200 to ~100 lines. Key improvements include automatic JSON-RPC handling, simplified tool registration with decorators, and elimination of boilerplate protocol code while maintaining identical functionality.
PR Type
Enhancement
Description
Replaced manual MCP protocol with FastMCP framework
Reduced server code from ~200 to ~100 lines
Simplified tool registration using decorators
Added comprehensive test scripts for verification
Diagram Walkthrough
File Walkthrough
server.py
Replace manual MCP implementation with FastMCP frameworksrc/workshop_mcp/server.py
Serverclass withFastMCPframeworkWorkshopMCPServerclass to simple@mcp.tool()decoratedfunction
list_tools,call_tool)test_fastmcp_server.py
Add test suite for FastMCP refactored servertest_fastmcp_server.py
verify_fastmcp.py
Add FastMCP import verification scriptverify_fastmcp.py
pyproject.toml
Add FastMCP framework dependencypyproject.toml
fastmcp = "^0.2.0"dependency