-
Notifications
You must be signed in to change notification settings - Fork 222
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
Detailed Stats page + HTTP Support #227
base: main
Are you sure you want to change the base?
Detailed Stats page + HTTP Support #227
Conversation
Feat/http and stats
Http fixes for pr
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 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 |
``` | ||
|
||
The inspector runs both a client UI (default port 5173) and an MCP proxy server (default port 3000). Open the client UI in your browser to use the inspector. You can customize the ports if needed: | ||
|
||
```bash | ||
CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node build/index.js | ||
CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector-server node build/index.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔙
@@ -64,7 +64,7 @@ async function main() { | |||
const CLIENT_PORT = process.env.CLIENT_PORT ?? "5173"; | |||
const SERVER_PORT = process.env.SERVER_PORT ?? "3000"; | |||
|
|||
console.log("Starting MCP inspector..."); | |||
console.log("Starting MCP Debug inspector..."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔙
@@ -102,7 +102,7 @@ async function main() { | |||
await Promise.any([server, client, delay(2 * 1000)]); | |||
const portParam = SERVER_PORT === "3000" ? "" : `?proxyPort=${SERVER_PORT}`; | |||
console.log( | |||
`\n🔍 MCP Inspector is up and running at http://127.0.0.1:${CLIENT_PORT}${portParam} 🚀`, | |||
`\n🔍 MCP Debug Inspector is up and running at http://127.0.0.1:${CLIENT_PORT}${portParam} 🚀`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔙
"name": "@modelcontextprotocol/inspector-client", | ||
"version": "0.7.0", | ||
"description": "Client-side application for the Model Context Protocol inspector", | ||
"name": "mcp-debug-client", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔙 all this file
@@ -29,8 +29,8 @@ import { version } from "../../../package.json"; | |||
|
|||
interface SidebarProps { | |||
connectionStatus: "disconnected" | "connected" | "error"; | |||
transportType: "stdio" | "sse"; | |||
setTransportType: (type: "stdio" | "sse") => void; | |||
transportType: "stdio" | "sse" | "streamableHttp"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"stdio" | "sse" | "http";
@@ -0,0 +1,58 @@ | |||
import * as React from "react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
@@ -0,0 +1,36 @@ | |||
import * as React from "react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
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 |
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 inspectorThis 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
Checklist
Additional context
This implementation focuses on the client-side of the Streamable HTTP transport protocol. The implementation includes:
The debugging UI provides visibility into:
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.