Skip to content

Since 0.14.1, mcp-inspector does not work under child_process.spawn #620

@vanyauhalin

Description

@vanyauhalin

Describe the bug

Hi. After upgrading from version 0.14.0 to 0.14.1, the following script has stopped working. Specifically, after the upgrade, mcp-inspector does not take into account the passed arguments.

import * as child from "node:child_process"

process.loadEnvFile("../.env")

child.spawn(
	"npm",
	[
		"exec",
		"mcp-inspector",
		"--",
		"-e",
		`CUSTOM_VAR=${process.env.CUSTOM_VAR}`,
		"--",
		"node",
		"../main.js" // just a placeholder
	],
	{
		env: process.env,
		stdio: "inherit",
		shell: true,
	},
)

To Reproduce

Steps to reproduce the behavior:

  1. Clone repository https://github.com/vanyauhalin/mcp-inspector-issue
  2. Go to directory (0.14.0 and 0.14.1).
  3. Run npm install.
  4. Run npm run serve.
  5. Clear local storage between runs.

Expected behavior

I would expect the script to work in newer versions as well as it does in version 0.14.0.

Logs

No logs.

Additional context

This is the second time. The first one is here #495.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions