Skip to content

Conversation

felixweinberger
Copy link
Contributor

@felixweinberger felixweinberger commented Jul 24, 2025

Motivation and Context

When running the inspector with command-line arguments (e.g.,
npx @modelcontextprotocol/inspector node build/index.js arg1 arg2),
the command and arguments were not being properly passed through to
the UI for pre-filling.

This means the instructions in the readme on inspector on how to run via CLI don't actually work.

Changes:

  • cli.ts now passes command and args to start.js
  • start.js uses --command for the command and --args for arguments
  • Server parses the new --command parameter
  • /config endpoint returns correct values for UI pre-filling

This ensures the UI correctly displays the command and arguments
passed on the command line instead of showing old localStorage values.

How Has This Been Tested?

Before (current main):

node cli/build/cli.js node build/index.ts arg1 arg2

Doesn't fill command and args from the CLI args, instead uses whatever was there before.

CleanShot 2025-07-24 at 13 08 35@2x

After (this PR):

node cli/build/cli.js node build/index.ts arg1 arg2

Correctly fills command and args from the CLI args passed in.

CleanShot 2025-07-24 at 13 06 30@2x
node cli/build/cli.js -e key=value -e key2=value2 node build/index.js arg1 arg2
CleanShot 2025-07-24 at 13 17 40@2x

Breaking Changes

N/A

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

When running the inspector with command-line arguments (e.g.,
`npx @modelcontextprotocol/inspector node build/index.js arg1 arg2`),
the command and arguments were not being properly passed through to
the UI for pre-filling.

Changes:
- cli.ts now passes command and args to start.js
- start.js uses --command for the command and --args for arguments
- Server parses the new --command parameter
- /config endpoint returns correct values for UI pre-filling

This ensures the UI correctly displays the command and arguments
passed on the command line instead of showing old localStorage values.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@felixweinberger felixweinberger force-pushed the fweinberger/fix-cli-args branch from 133abe5 to c7b90a1 Compare July 24, 2025 12:07
Copy link

github-actions bot commented Jul 24, 2025

🎭 Playwright E2E Test Results

✅  12 passed

Details

12 tests across 1 suite
 23.3 seconds
 21745d6
ℹ️  Test Environment: Ubuntu Latest, Node.js v22.17.1
Browsers: Chromium, Firefox

📊 View Detailed HTML Report (download artifacts)

@felixweinberger felixweinberger marked this pull request as ready for review July 24, 2025 12:10
Copy link
Member

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

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

Tested locally, everything works. But you need to run prettier-fix to pass CI.

@felixweinberger
Copy link
Contributor Author

Tested locally, everything works. But you need to run prettier-fix to pass CI.

Ran it but there were no changes - I don't see anything failing in CI?

@cliffhall cliffhall dismissed their stale review July 24, 2025 15:47

my bad

Copy link
Member

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@cliffhall cliffhall enabled auto-merge July 24, 2025 15:47
@cliffhall
Copy link
Member

cliffhall commented Jul 24, 2025

Tested locally, everything works. But you need to run prettier-fix to pass CI.

Ran it but there were no changes - I don't see anything failing in CI?

Sorry Felix. It complained on my machine. Not sure why. Back switched back to main and then back to your branch and did a pull (which said it was up to date), then it ran with no problem.

@cliffhall cliffhall merged commit 85df5fd into main Jul 24, 2025
9 checks passed
@cliffhall cliffhall deleted the fweinberger/fix-cli-args branch July 24, 2025 15:48
@richardkmichael
Copy link
Collaborator

I did the same work locally earlier this week. 😂 I have Playwright tests too, which I'll send after I rebase.

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.

3 participants