Skip to content

add config parsing for SSE and streamable HTTP transports #483

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

al1y
Copy link

@al1y al1y commented Jun 3, 2025

Motivation and Context

Currently, the inspector won't parse and load details from an SSE or Streamable HTTP config.

For example, running node client/bin/start.js --config "C:\path\to\mcp.json" --server my-server where mcp.json is

{
    "mcpServers": {
        "my-server": {
            "type": "sse",
            "url": "http://localhost:60157/sse"
        }
    }
}

will yield

Starting MCP inspector...
⚙️ Proxy server listening on port 6277
🔍 MCP Inspector is up and running at http://127.0.0.1:6274 🚀

NOTE - it defaults to stdio and does not respect the provided config

image

SSE

After these changes, running node client/bin/start.js --config "C:\path\to\mcp.json" --server my-server will yield

Loaded configuration for 'my-server' from 'C:\path\to\test-mcp.json'
Starting MCP inspector...
Using sse transport with URL: http://localhost:60157/sse
⚙️ Proxy server listening on port 6277
� MCP Inspector is up and running at http://127.0.0.1:6274 �

image

Streamable HTTP

Similarly, running node client/bin/start.js --config "C:\path\to\mcp.json" --server my-server where mcp.json is

{
    "mcpServers": {
        "my-server": {
            "type": "streamable-http",
            "url": "http://localhost:3000/mcp"
        }
    }
}

will now yield

Loaded configuration for 'my-server' from 'C:\path\to\test-mcp.json'
Starting MCP inspector...
Using streamable-http transport with URL: http://localhost:3000/mcp
⚙️ Proxy server listening on port 6277
� MCP Inspector is up and running at http://127.0.0.1:6274 �

image

How Has This Been Tested?

Manually with local stdio, sse and streamable-http servers, ensuring stdio env vars propagate appropriately.
Extended related automated tests for client using loaded config values in the connect call.
Better test representation would be in client start and proxy but there's currently no existing framework for either.

Breaking Changes

No expected breaking changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

First contribution, apologies for any errors in process or intent

@al1y al1y force-pushed the add-config-parsing-for-sse-and-streamable-http branch from 41e8d7c to e1477a4 Compare June 6, 2025 22:21
Copy link
Member

@olaservo olaservo left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and sorry for the wait. I had some minor comments and questions mainly to clarify the logic.

@@ -38,13 +52,32 @@ async function main() {
} else {
envVars[envVar] = "";
}
} else if (!command) {
// If loading a config file, we don't need to pass the command or args
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little confused by this comment and how it relates to the checking here, could you be more explicit about the intent of this check?

Also I think it could help to add more explanation in general about the config precedence logic in the code as comments.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review! I've added some comments around config precedence as suggested

@olaservo olaservo added the waiting on submitter Waiting for the submitter to provide more info label Jun 15, 2025
@al1y al1y force-pushed the add-config-parsing-for-sse-and-streamable-http branch from e1477a4 to a37a922 Compare June 15, 2025 18:09
@al1y al1y requested a review from olaservo June 16, 2025 14:06
@al1y al1y force-pushed the add-config-parsing-for-sse-and-streamable-http branch from a37a922 to 0489103 Compare June 17, 2025 16:21
@al1y al1y force-pushed the add-config-parsing-for-sse-and-streamable-http branch from 0489103 to e46ae33 Compare June 18, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting on submitter Waiting for the submitter to provide more info
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants