From dd7bbd1f9ae6c640e021ff7a1e940c34c4c7c01b Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sat, 31 Jan 2026 16:03:17 +0000 Subject: [PATCH] IT WORKS --- src/aegis_gitea_mcp/mcp_protocol.py | 8 +++++++- src/aegis_gitea_mcp/server.py | 8 ++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/aegis_gitea_mcp/mcp_protocol.py b/src/aegis_gitea_mcp/mcp_protocol.py index d340a9c..010cf91 100644 --- a/src/aegis_gitea_mcp/mcp_protocol.py +++ b/src/aegis_gitea_mcp/mcp_protocol.py @@ -10,7 +10,13 @@ class MCPTool(BaseModel): name: str = Field(..., description="Unique tool identifier") description: str = Field(..., description="Human-readable tool description") - input_schema: Dict[str, Any] = Field(..., description="JSON Schema for tool input") + input_schema: Dict[str, Any] = Field( + ..., alias="inputSchema", description="JSON Schema for tool input" + ) + + class Config: + populate_by_name = True + by_alias = True class MCPToolCallRequest(BaseModel): diff --git a/src/aegis_gitea_mcp/server.py b/src/aegis_gitea_mcp/server.py index 1cab8e5..27bb160 100644 --- a/src/aegis_gitea_mcp/server.py +++ b/src/aegis_gitea_mcp/server.py @@ -167,7 +167,7 @@ async def list_tools() -> JSONResponse: JSON response with list of tool definitions """ response = MCPListToolsResponse(tools=AVAILABLE_TOOLS) - return JSONResponse(content=response.model_dump()) + return JSONResponse(content=response.model_dump(by_alias=True)) @app.post("/mcp/tool/call") @@ -336,7 +336,11 @@ async def sse_message_handler(request: Request) -> JSONResponse: # Return the list of available tools response = MCPListToolsResponse(tools=AVAILABLE_TOOLS) return JSONResponse( - content={"jsonrpc": "2.0", "id": message_id, "result": response.model_dump()} + content={ + "jsonrpc": "2.0", + "id": message_id, + "result": response.model_dump(by_alias=True), + } ) elif message_type == "tools/call":