Skip to content

fix(server): pass MCP description via instructions, not version (adopted from #317) - #338

Closed
K4bain wants to merge 1 commit into
tadata-org:mainfrom
K4bain:fix/server-init-kwargs
Closed

K4bain wants to merge 1 commit into
tadata-org:mainfrom
K4bain:fix/server-init-kwargs

Conversation

@K4bain

@K4bain K4bain commented Aug 27, 2026

Copy link
Copy Markdown

Adopted from #317 (original patch by @syf2211) — rebased onto current main and verified.

Why this is needed

setup_server() calls Server(self.name, self.description) — the second positional parameter of mcp Server.init is version, not description. Every MCP client currently sees the server description string as the version, and receives no instructions at all.

The fix passes both explicitly:

  • version=self.fastapi.version (the actual app version)
  • instructions=self.description (where MCP clients expect guidance text)

Relation to other PRs

#326/#331 propose the minimal variant (move description to instructions, leave version unset). This PR is the more complete fix since it also populates version correctly. If this lands, #331 can be reduced to just its dependency-cap change.

Verification

  • test_create_mcp_server now asserts server.version == app.version and server.instructions == description — fails on main (version=='Test description'), passes with the fix.
  • Full unit suite: 69 passed.

Credit to @syf2211 for the original report and patch in #317.

Server(name, self.description) passed the description as the second
positional arg of mcp Server.__init__, which is version — so MCP
clients saw the server description as its version and no instructions
at all. Pass both explicitly: version from the FastAPI app version and
description as instructions.

Adopted from tadata-org#317 (original patch by @syf2211).
@K4bain

K4bain commented Sep 14, 2026

Copy link
Copy Markdown
Author

Closing for housekeeping - the repo had no reviewer engagement and we are re-approaching these areas through a narrower pipeline. Happy to reopen on request.

@K4bain K4bain closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant