Skip to content

Conversation

@richardkmichael
Copy link
Collaborator

Motivation and Context

The CLI is hard-coded at version 0.5.1, from when it was merged in #177 f4e6f4d.

It can use the package.json version, as does the client.

How Has This Been Tested?

Tested by inspecting raw protocol messages.

Incorrect version on main:

{
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-03-26",
    "capabilities": {},
    "clientInfo": {
      "name": "inspector-cli",
      "version": "0.5.1"
    }
  },
  "jsonrpc": "2.0",
  "id": 0
}

Corrected:

{
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-03-26",
    "capabilities": {},
    "clientInfo": {
      "name": "inspector-cli",
      "version": "0.14.3"
    }
  },
  "jsonrpc": "2.0",
  "id": 0
}

Breaking Changes

Unlikely.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Broader discussion

I have few questions and comments, but Discussions aren't enabled, so I'm not sure where to raise
them --

TL;DR:

  • Should the server use NodeNext modules?
  • Should "noUncheckedIndexedAccess": true be used throughout? Potential errors are detected.
  • Code consistency across the sub-packages would be helpful

Despite this being a very tiny change, the varying TypeScript configurations across the sub-packages
tripped me up quite a bit, so I investigated a few details. Overall, consistency throughout the
monorepo would result in less confusion when reading and working with the parts of the inspector.
Generally lower cognitive overhead -- because, personally, when the same thing is accomplished in
multiple ways, it slows me down because I wonder why and which is correct or preferrable; especially
with unfamiliar code. Maybe this is second nature to experienced TS developers, working in
difficult contexts?

For example, the package.json import in the cli and client here.

The cli TypeScript config uses NodeNext modules, which requires an import attribute (... with: { type: "json" }).

The client uses ESNext (and bundler configuration), which tolerates an import attribute. So
the quickest approach would be to add the import attribute in the client files,
useConnection.tsx and Sidebar.tsx.

However, I could not find an easy way to enforce it (detection), so one needs to know. I briefly
checked the TS compiler options and eslint-plugin-import; a custom rule might be needed, which is
a bit too crufty, IMO.

Alternately, change the CLI to Node16 (used by the server and the TypeScript SDK). This would
eliminate the requirement of an import attribute. It seems less preferable because enforcing modern
usage is ideal. Perhaps the server should go to NodeNext too?

Somewhat related, the cli compiler config uses "noUncheckedIndexedAccess": true, which caught
the potential bug in the destructuring of split() (but not in the client). If this option is
enabled on the client and server, there are many errors. Should it be enabled?

@olaservo olaservo added the cli Issues and PRs specific to cli mode label Jul 7, 2025
@olaservo
Copy link
Member

olaservo commented Jul 8, 2025

Hi @richardkmichael thanks for catching this and for bringing up the inconsistencies. If you could fix the linting error in the CI I think we can go ahead and merge the CLI version fix. I created this to track the points you brought up here and discuss them further: #588
And if we find that too clunky I think we can use the Community Working Groups Discord server (which I think I already linked you to elsewhere?)

@richardkmichael
Copy link
Collaborator Author

richardkmichael commented Jul 23, 2025

@olaservo

If you could fix the linting error in the CI I think we can go ahead and merge the CLI version fix.

I didn't notice, sorry! Fixed.

I did this without changing the eslint config. I find underscore prefixed unused variables to be self-documenting and less error prone, but the eslint configuration only permits the terser, omitted style. Not intending to bikeshed, just mentioning in case you wonder.

@richardkmichael richardkmichael changed the title Fix hard-coded CLI inspector version fix: hard-coded CLI inspector version Jul 25, 2025
Copy link
Member

@olaservo olaservo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @richardkmichael was revisiting this one and it looks like there's some conflicts - besides that I think we're good to merge this, would you mind resolving those? Thanks!

@richardkmichael richardkmichael marked this pull request as draft August 5, 2025 19:17
@richardkmichael richardkmichael marked this pull request as ready for review August 5, 2025 19:46
@richardkmichael
Copy link
Collaborator Author

@olaservo I extracted the identity to a constant, aiming to reduce test brittleness. If you prefer a more straight-forward conflict resolution, it's just the string change in the test; I can drop the most recent commit for that resolution only.

Make both clients use name from package.json for consistency and protocol clarity

 - web client changes `mcp-inspector` -> `inspector-client` (package.json)
 - cli client remains `inspector-cli` (package.json)
@olaservo olaservo dismissed their stale review September 23, 2025 03:46

Making changes

@olaservo olaservo merged commit 42aa95b into modelcontextprotocol:main Sep 23, 2025
6 checks passed
cliffhall added a commit to cliffhall/mcp-inspector that referenced this pull request Oct 4, 2025
…ed that reads package.json from one level up. It works if the project is checked out locally, but not in the npm package, because the package.json of the workspace packages is not included in the inspector package. We can get that from one level up, the inpsector's own package, and so this change does that.
@cliffhall cliffhall mentioned this pull request Oct 4, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Issues and PRs specific to cli mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants