inspector
inspector copied to clipboard
Detailed Stats page + HTTP Support
This adds a detailed stats page to the stats tab of the inspector.
You can try it out today with npx mcp-debug for the inspector
This also adds experimental (direct from client, and streamable from server) support for the http specificatio
You can try creating a http server with mcp-framework if you don't have an implementation to test it with yet (mcp create serverNameHere --http --cors --port 1337
Motivation and Context
The MCP specification now includes the Streamable HTTP transport protocol, but the inspector currently lacks direct support for it. This PR adds an experimental implementation of the Streamable HTTP transport client, allowing developers to connect directly to MCP servers using this protocol without requiring a proxy. The main way to do this is via DIRECT (no proxy) connection, a new checkbox for this has been added to the UI.
This is being submitted as an experimental feature for now - I can provide a more thorough implementation and testing plan if this is something the team sees as valuable and would like to incorporate into the main codebase.
How Has This Been Tested?
The implementation has been tested with basic request/response patterns and SSE streaming connections against HTTP MCP servers built with mcp-framework. I will re-test it against the official SDK once it is available.
The debugging UI provides insights into the connection state, helping identify protocol compliance issues.
Breaking Changes
None. This implementation is additive and doesn't change existing functionality. Users can continue using existing transport methods.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation update
Checklist
- [x] I have read the MCP Documentation
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed
Additional context
This implementation focuses on the client-side of the Streamable HTTP transport protocol. The implementation includes:
- Direct HTTP transport client following the MCP Streamable HTTP specification
- Session management with automatic reconnection
- Support for SSE streaming for server-to-client messages
- Enhanced debugging UI with detailed connection stats
The debugging UI provides visibility into:
- Connection state and metrics
- HTTP status code tracking
- Tool call monitoring
- SSE stream events
- Protocol compliance checks
This is being submitted as an experimental implementation to gauge interest. If the team finds value in this approach, I'd be happy to provide a more robust implementation with comprehensive testing and documentation.
I'd love to get some feedack. Please let me know if this would make sense and if I should keep iterating on this to make this merge ready, I can move pretty fast
Why not add support for streamable transport first in the SDK https://github.com/modelcontextprotocol/typescript-sdk/issues/220 and then use it here ? Check this https://github.com/modelcontextprotocol/inspector/issues/221 as well
Should a new transport implementation be part of the inspector ?
Why not add support for streamable transport first in the SDK modelcontextprotocol/typescript-sdk#220 and then use it here ? Check this #221 as well
Should a new transport implementation be part of the inspector ?
Thanks for your response! I just assumed it was already being worked on so I rolled it up quickly and will patch it once the official sdk is updated. I posted a comment in the related issue you sent offering to implement it into the official sdk
This can be split into 2 PRs. The Stats page and the new SDK spec.
The stats page should have a screenshoot of the page in the PR.
This can be split into 2 PRs. The Stats page and the new SDK spec. The stats page should have a screenshoot of the page in the PR.
I agree, this is a big PR and a lot of it just needs to be backed out as it stands. Reducing this to just adding a stats page will make it much easier to review and have confidence in. Also it would be good if you could include a screenshot of this stats page so we can see the scope of it before pulling down your branch to test locally.
I've tested this PR with my streaming server... I very much appreciate it @QuantGeekDev
I did notice that when my server returned the new protocol version 2025-03-26 it refused to connect.
(Which would make sense for the SSE but not for the new Streaming...)
Hey @QuantGeekDev I create a PR to this Pr adding the feature to add custom headers into http stream
I've tested this PR with my streaming server... I very much appreciate it @QuantGeekDev
I did notice that when my server returned the new protocol version
2025-03-26it refused to connect. (Which would make sense for the SSE but not for the new Streaming...)
I noticed that the LATEST_PROTOCOL_VERSION in the SDK repo has not been updated:
.
Hi @QuantGeekDev checking to see if we can close this one?
Going to close but feel free to open again if there are enhancements from this that we still want to include.