Skip to content

feat: adds "thv inspector" to run an inspector for an MCP server #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ChrisJBurns
Copy link
Collaborator

@ChrisJBurns ChrisJBurns commented May 14, 2025

Description

Up to now we've had to do some nice curl backflips (or worse) to debug MCP servers. This PR adds the ability to run an MCP Inspector container that is pre-configured to point to the specified MCP server.

To run: thv inspector <server-name>. Then go to http://localhost:6274/?transport=sse&serverUrl=http://host.docker.internal:<port>/sse ensuring to enter the correct port for your MCP server.

Todo

  • We currently build the inspector image via npx:// until this issue is closed and the official image is usable (and make specifying the version flag driving)
  • We can probably remove the "BRIDGE" transport type. It was added simply because the Inspector server doesn't fit into the sse or stdio category
  • We have some code that retrieves the MCP server URL of the MCP server specified at runtime, we don't do anything with it at the moment, but when this issue regarding search params have been resolved and we can log out the inspector URL in the terminal allowing users to jump straight to a page which allows the connection to the chosen MCP server. For example: Inspector is ready to inspect your MCP server, go to http://localhost:6274/?transport=sse&serverUrl=http://host.docker.internal:59278/sse#fetch.
  • Due to the way the inspector container has to access the MCP servers running on the host, on mac host.docker.internal works nicely. We may have to do some extra stuff for the Linux users.

Ref: #25

@ChrisJBurns ChrisJBurns marked this pull request as draft May 14, 2025 09:59
@@ -30,7 +30,7 @@ go.work

.roo/
^thv$

.claude/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's move this to a separate PR.

inspectorCommand := &cobra.Command{
Use: "inspector [container-name]",
Short: "Output the logs of an MCP server",
Long: `Output the logs of an MCP server managed by Vibe Tool.`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not accurate.


// Define fixed port configuration for the inspector container
clientUIPort := "6274"
mcpProxyPort := "6277"
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we make these configurable flags? These can be the defaults.

{
HostIP: "0.0.0.0",
HostPort: mcpProxyPort,
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we default to ipv4 localhost?

@@ -54,6 +54,9 @@ const (

// TransportTypeSSE represents the SSE transport.
TransportTypeSSE TransportType = "sse"

// TransportTypeBridge represents the bridge network mode for container networking.
TransportTypeBridge TransportType = "bridge"
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's this piece? I don't think we'll be supporting a bridge transport.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I'll be removing this. It was added simply because the Inspector server doesn't fit into the sse or stdio category. Just wanted to push what I had up and draft PR it so I can checkout other branches in the meantime.

Copy link
Collaborator

Choose a reason for hiding this comment

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

aha! Let's document that a little better. If it really doesn't fit we can re-evaluate.

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.

2 participants