Skip to content

Commit 013f252

Browse files
fix: Complete MCP server refactoring for compliance
- Refactor server.py to use official FastMCP framework patterns - Replace complex _impl pattern with proper FastMCP decorators - Add proper MCP tools using @mcp.tool() decorators - Simplify MuJoCoServer class for compliance testing - Remove unused Pydantic models in favor of FastMCP's type handling - All MCP compliance tests now pass (100% success rate) Based on official MCP documentation and FastMCP Python SDK patterns
1 parent 2747282 commit 013f252

3 files changed

Lines changed: 109 additions & 331 deletions

File tree

mcp_compliance_report.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"timestamp": 1757646221.509862,
2+
"timestamp": 1757682828.3599646,
33
"total_tests": 4,
4-
"passed_tests": 1,
5-
"failed_tests": 3,
6-
"success_rate": 25.0,
4+
"passed_tests": 4,
5+
"failed_tests": 0,
6+
"success_rate": 100.0,
77
"test_results": {
88
"Server Startup": true,
9-
"Tools Listing": false,
10-
"Protocol Messages": false,
11-
"Error Handling": false
9+
"Tools Listing": true,
10+
"Protocol Messages": true,
11+
"Error Handling": true
1212
},
1313
"mcp_version": "1.0",
1414
"server_info": {

src/mujoco_mcp/mcp_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ async def handle_call_tool(name: str, arguments: Dict[str, Any]) -> List[types.T
152152
types.TextContent(
153153
type="text",
154154
text="❌ Failed to connect to MuJoCo viewer server. "
155-
"Please start `mujoco-mcp-viewer` first.",
155+
"Please start `mujoco-mcp-viewer` first.",
156156
)
157157
]
158158

0 commit comments

Comments
 (0)