Fix command-line argument passing to pre-fill UI

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 <noreply@anthropic.com>
This commit is contained in:
Felix Weinberger 2025-07-24 12:56:43 +01:00
commit c7b90a1af9
No known key found for this signature in database

View file

@ -91,8 +91,10 @@ async function startProdServer(serverOptions) {
"node",
[
inspectorServerPath,
...(command ? [`--env`, command] : []),
...(mcpServerArgs ? [`--args=${mcpServerArgs.join(" ")}`] : []),
...(command ? [`--command`, command] : []),
...(mcpServerArgs && mcpServerArgs.length > 0
? [`--args`, mcpServerArgs.join(" ")]
: []),
],
{
env: {