[BUG] self.description is passed to version parameter instead of description in Server initialization · Issue #272 · tadata-org/fastapi_mcp · GitHub
Skip to content

[BUG] self.description is passed to version parameter instead of description in Server initialization #272

Open

Description

@claudiourbina

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

Activity

  1. astraltrekkin commented on Mar 27, 2026

    @astraltrekkin

    is it okay if I take this one? @claudiourbina

  2. added a commit that references this issue on Apr 4, 2026
    7275e82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions