Skip to content

Feat/cli http #479

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 3 commits into
base: main
Choose a base branch
from

Conversation

ryanjclark
Copy link

@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
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 });

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
2 participants