Skip to content

Conversation

ryanjclark
Copy link
Contributor

@ryanjclark ryanjclark commented Jun 1, 2025

This feature introduces streamable http support for the CLI mode. It is backward compatible; the default transport is sse. There is a new flag for --transport. Otherwise, the transport will be inferred from the suffix of the url (/mcp or /sse).

Motivation and Context

The CLI lags behind the client for Streamable HTTP support.
Closes #410

How Has This Been Tested?

# http
node build/cli.js --cli http://0.0.0.0:8001/mcp --method tools/list # success
node build/cli.js --cli http://0.0.0.0:8001/mcp --method tools/list --transport http # success
node build/cli.js --cli http://0.0.0.0:8001 --method tools/list --transport http # success
node build/cli.js --cli http://0.0.0.0:8001 --method tools/list # SSE error

# sse
node build/cli.js --cli http://0.0.0.0:8001/sse --method tools/list # success
node build/cli.js --cli http://0.0.0.0:8001/sse --method tools/list --transport sse # success
node build/cli.js --cli http://0.0.0.0:8001 --method tools/list --transport sse # success
node build/cli.js --cli http://0.0.0.0:8001 --method tools/list # success

Breaking Changes

No 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

@ryanjclark
Copy link
Contributor Author

I am unsure how maintainers want this tested. It seems like cli/scripts/cli-tests.js doesn't work and isn't used.

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.

Hi, sorry I missed your question about the test script. This test doesn't run on CI yet, so there might be something that broke the CLI test script.

I was able to run the cli\scripts\cli-tests.js if I changed this part starting on line 64:

// Create a temporary directory for test files
const TEMP_DIR = path.join(os.tmpdir(), "mcp-inspector-tests");
fs.mkdirSync(TEMP_DIR, { recursive: true });

@ofek
Copy link

ofek commented Jun 22, 2025

We are also very interested in this feature internally as we only support this transport type for development tools.

@ryanjclark
Copy link
Contributor Author

We are also very interested in this feature internally as we only support this transport type for development tools.

Hey Ofek, us too. I will work on this now.

@ryanjclark
Copy link
Contributor Author

Added tests for http transport. The SSE transport on server-everything times out after every request, making it weird to test. I figured it was fine to include in tests because it is deprecated.

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.

Looks good to me, just need to run this to fix formatting check failure in CI:

npx prettier --write cli/scripts/cli-tests.js

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!

@olaservo olaservo merged commit f2aaa8d into modelcontextprotocol:main Jun 25, 2025
4 checks passed
@ofek
Copy link

ofek commented Jun 25, 2025

Thanks! When might this be released?

@olaservo
Copy link
Member

@ofek I will create one today, there might be an unrelated bug fix we want to get in as well, but if not we can just release what is here now.

@ofek
Copy link

ofek commented Jun 26, 2025

Thanks! It looks like the release needs manual intervention: https://github.com/modelcontextprotocol/inspector/actions/runs/15891752275

@olaservo
Copy link
Member

Hi @ofek , yes someone from the core maintainers team needs to approve that part. Will keep you posted.

@ofek
Copy link

ofek commented Jun 27, 2025

No worries! How long does that usually take?

@olaservo
Copy link
Member

@ofek usually its only around 1 working day or so, I think it flew under the radar this time. But it should be live now: https://www.npmjs.com/package/@modelcontextprotocol/inspector?activeTab=versions

@pztrick
Copy link

pztrick commented Jul 1, 2025

i've added a very small p/r #578 that allows other paths that do not necessarily end in /mcp like /mcp/http.

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.

inspector support streamable-http support via cli
4 participants