fix(mcp): report the real installed version in the MCP handshake#329
Merged
Conversation
serverInfo.version was hardcoded to "0.5.3" and had drifted several releases behind (current: 0.11.0), so every MCP client saw a stale version in the initialize response. Resolve it at runtime from the package.json one directory above the executing file — the same pattern cli.ts already uses for the argent version banner. That resolves to @swmansion/argent's shipped package.json in the published bundle (dist/mcp-server.mjs) and to @argent/mcp's own package.json in the dev workspace; both are bumped in lockstep. Falls back to "unknown" rather than a literal that can drift.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
serverInfo.versionin the MCPinitializeresponse was hardcoded to"0.5.3"inmcp-server.tsand had drifted several releases behind the actual install (currently 0.11.0). Spotted while driving the MCP server over stdio:Fix
New
getInstalledVersion()inpackages/argent-mcp/src/installed-version.tsresolves the version at runtime from the package.json one directory above the executing file — the same patternpackages/argent/src/cli.tsalready uses for theargent --versionbanner:dist/mcp-server.mjs→ two-up is @swmansion/argent's shipped package.json@argent/mcpoutput → its own package.jsonBoth are version-bumped in lockstep. Falls back to
"unknown"instead of another literal that can drift.Test plan
npm run build,typecheck:tests, prettier clean🤖 Generated with Claude Code