Report the package version in the MCP client handshake - #12
Open
coderyaz856 wants to merge 1 commit into
Open
coderyaz856 wants to merge 1 commit into
coderyaz856 wants to merge 1 commit into
Conversation
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.
Fixes #11
Problem
McpClientServicecreated the MCP client with a hardcodedversion: '3.1.0', so every MCPinitializerequest identified the CLI as3.1.0while the package is3.7.0.Change
lib/utils/package-root.js: exportPACKAGE_VERSION, read frompackage.jsonnext to the existingPACKAGE_ROOT.lib/impl/mcp-client-service.js: usePACKAGE_VERSIONfor the MCP client version.bin/mantis.js: use the samePACKAGE_VERSIONinstead of readingpackage.jsonitself, 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, runslistTools(), and asserts that theinitializerequest 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.0sent,3.7.0expected.mantis --version,mantis version, andmantis --helpunchanged.Live server (
https://kellis-h200-1.csail.mit.edu), handshakes recorded through a pass-through proxy,mantis toolsandmantis use get_space_context, 2 runs each:clientInfo.version=3.1.0in 4 of 4 handshakesclientInfo.version=3.7.0in 4 of 4 handshakesNotes
Invalid or expired MCP bearer tokenfor developer keys that REST accepts (MCP calls reject valid developer key after successful setup #5). Behaviour was identical before and after this change.dist/build was not rebuilt locally (Bun not installed); the version is resolved through the samepackage-root.jslookup already used for the skills directory.