-
Notifications
You must be signed in to change notification settings - Fork 932
[BUG] self.description is passed to version parameter instead of description in Server initialization #272
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Current Behavior
In line 144 of server.py, the Server object is instantiated incorrectly:
mcp_server: Server = Server(self.name, self.description)This passes self.description as the second positional argument, which maps to the version parameter in the Server constructor.
Expected Behavior
According to the MCP Python SDK Server constructor signature, the parameter order is:
def __init__(
self,
name: str,
version: str | None = None,
title: str | None = None,
description: str | None = None,
instructions: str | None = None,
...
)The description should be passed as a named argument or in the fourth position (after version and title).
Proposed Fix
Change line 144 to use a named argument:
mcp_server: Server = Server(self.name, description=self.description)Or alternatively, if you want to pass version as well:
mcp_server: Server = Server(
name=self.name,
version=self.version, # if available
description=self.description
)Impact
This bug causes the FastAPI application description to be incorrectly registered as the MCP server version, and the actual description field remains empty.
Location
fastapi_mcp/fastapi_mcp/server.py
Line 144 in e5cad13
| mcp_server: Server = Server(self.name, self.description) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working