Skip to content

Conversation

@michalismeng
Copy link
Contributor

What's changed

Introduce the 'inspector' command, which starts the MCP inspector tool. Internally it launches the inspector with npx @modelcontextprotocol/inspector and passes any addition arguments the user gives.

Closes #51

(See the issue for some more details)


Screenshot from 2025-08-26 10-55-01

Notes

The issue mentions the following in the desired solution:

Warn the user that they need the relevant binaries on their machine when they enter a command in the UI

Currently, mcpd inspector prints to the terminal whatever the underlying npx process prints, so there will be dev-style details of the error:

New STDIO connection request
Query parameters: {"command":"uvx","args":"mcp-server-time@latest", ....

and in the UI we get a message from the inspector itself, for example:

error: Could not find the `uv` binary at either of: ...

Not sure if this is enough, glad to discuss if more is needed here.

@peteski22 peteski22 self-requested a review August 27, 2025 15:05
@peteski22 peteski22 self-assigned this Aug 27, 2025
@peteski22 peteski22 added enhancement New feature or request cli and removed needs-triage labels Sep 3, 2025
Copy link
Contributor

@peteski22 peteski22 left a comment

Choose a reason for hiding this comment

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

Thanks @michalismeng for picking this up, looks good! I added some suggestions, it would be great if you could take a look please.

Just re-tag me afterwards and we can get this approved and merged. 🥳

}

if err != nil {
return fmt.Errorf("failed to run the inspector: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("failed to run the inspector: %w", err)
return fmt.Errorf("error running the inspector: %w", err)

Introduce the 'inspector' command, which starts the MCP inspector tool
via an npx process for interaction with 'try me out' style MCP servers.

Also, add a note to the docs.
* Check canceled context with errors.Is
* Pin @modelcontextprotocol/inspector to latest
* Use fmt.Fprintf with cmd.OutOrStdOut
* Other formatting / linting stuff
@michalismeng michalismeng force-pushed the michalismeng/51/cmd-inspector branch from 8779e96 to da55b12 Compare September 4, 2025 15:14
@michalismeng
Copy link
Contributor Author

@peteski22 I've pushed a fixup addressing your comments and also rebased over the latest main. Let me know if anything else is needed.

@peteski22 peteski22 self-requested a review September 5, 2025 13:44
Copy link
Contributor

@peteski22 peteski22 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the work and being so responsive to the comments. 🥳

@peteski22 peteski22 merged commit dd42a6a into mozilla-ai:main Sep 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support inspector style command

2 participants