Skip to content

Report the package version in the MCP client handshake - #12

Open
coderyaz856 wants to merge 1 commit into
KellisLab:mainfrom
coderyaz856:Yazid-The-Tech-Alchemist
Open

coderyaz856 wants to merge 1 commit into
KellisLab:mainfrom
coderyaz856:Yazid-The-Tech-Alchemist

Conversation

@coderyaz856

Copy link
Copy Markdown

Fixes #11

Problem

McpClientService created the MCP client with a hardcoded version: '3.1.0', so every MCP initialize request identified the CLI as 3.1.0 while the package is 3.7.0.

Change

  • lib/utils/package-root.js: export PACKAGE_VERSION, read from package.json next to the existing PACKAGE_ROOT.
  • lib/impl/mcp-client-service.js: use PACKAGE_VERSION for the MCP client version.
  • bin/mantis.js: use the same PACKAGE_VERSION instead of reading package.json itself, so the CLI and the MCP client share one source.
  • test/mcp-client-service.test.js: new test that starts a local stand-in MCP endpoint, runs listTools(), and asserts that the initialize request carries { name: 'mantisai-cli', version: <package.json version> }.

No change to commands, output, or configuration.

Testing

  • node --test: 16/16 pass (15 existing + 1 new).

  • The new test fails against the previous code: 3.1.0 sent, 3.7.0 expected.

  • mantis --version, mantis version, and mantis --help unchanged.

  • Live server (https://kellis-h200-1.csail.mit.edu), handshakes recorded through a pass-through proxy, mantis tools and mantis use get_space_context, 2 runs each:

    • before: clientInfo.version = 3.1.0 in 4 of 4 handshakes
    • after: clientInfo.version = 3.7.0 in 4 of 4 handshakes

Notes

  • A full MCP session could not be completed in the live check with either version: the endpoint returned Invalid or expired MCP bearer token for developer keys that REST accepts (MCP calls reject valid developer key after successful setup #5). Behaviour was identical before and after this change.
  • The bundled dist/ build was not rebuilt locally (Bun not installed); the version is resolved through the same package-root.js lookup already used for the skills directory.

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.

MCP client reports hardcoded version 3.1.0 instead of the package version

1 participant