Skip to content

fix(mcp): report the real installed version in the MCP handshake#329

Merged
filip131311 merged 1 commit into
mainfrom
filip/mcp-server-real-version
Jun 12, 2026
Merged

fix(mcp): report the real installed version in the MCP handshake#329
filip131311 merged 1 commit into
mainfrom
filip/mcp-server-real-version

Conversation

@filip131311

Copy link
Copy Markdown
Collaborator

Summary

serverInfo.version in the MCP initialize response was hardcoded to "0.5.3" in mcp-server.ts and had drifted several releases behind the actual install (currently 0.11.0). Spotted while driving the MCP server over stdio:

server: {"name":"argent","version":"0.5.3"}   # argent --version says 0.11.0

Fix

New getInstalledVersion() in packages/argent-mcp/src/installed-version.ts resolves the version at runtime from the package.json one directory above the executing file — the same pattern packages/argent/src/cli.ts already uses for the argent --version banner:

  • published bundle: dist/mcp-server.mjs → two-up is @swmansion/argent's shipped package.json
  • dev workspace: compiled @argent/mcp output → its own package.json

Both are version-bumped in lockstep. Falls back to "unknown" instead of another literal that can drift.

Test plan

  • Unit tests: helper matches the workspace package.json version and never returns the stale literal
  • npm run build, typecheck:tests, prettier clean
  • 66 argent-mcp tests pass

🤖 Generated with Claude Code

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.
@filip131311 filip131311 merged commit bbc8d78 into main Jun 12, 2026
2 checks passed
@filip131311 filip131311 deleted the filip/mcp-server-real-version branch June 12, 2026 15:14
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