Skip to content

Conversation

pztrick
Copy link

@pztrick pztrick commented Jul 1, 2025

The current CLI implementation for HTTP Transport re-writes any CLI URL argument that does not end in /mcp. This limits the functionality of the CLI to support other paths like /mcp/:uuid or /mcp/http and doesn't seem to conform to the spec which only suggests the path of /mcp as an example but does not require it.

The server MUST provide a single HTTP endpoint path (hereafter referred to as the MCP endpoint) that supports both POST and GET methods. For example, this could be a URL like https://example.com/mcp.

https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http

Motivation and Context

Applications may reasonably wish to support multiple transports (including custom transports like SSE and websockets) under paths like /mcp/http, /mcp/sse, /mcp/websockets or nest under other URL paths for any other technical or business reason.

How Has This Been Tested?

node cli/build/cli.js --cli http://localhost:4417/mcp/claude/http --method tools/list --transport http

Breaking Changes

It is possible that a CLI user could be providing URL like https://example.com/mcp/sse-not-at-end that is currently getting re-written to https://example.com/sse and maybe the remote backend was configured to serve on /sse so while this had previously been working, it would now break that user's CLI invocation -- but they are simply passing the wrong URL. I would view this as a bug myself.

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

We are adding HTTP Streamable support to django-mcp and are considering the use of an endpoint pattern like /mcp/sse, /mcp/http, /mcp/health etc (and possibly websockets as a custom transport in the future). This library already supports launching the web UI for inspector using the Django management command python manage.py mcp_inspector and I want to make sure we conform to the actual inspector URL endpoint patterns. Thanks!

@pztrick pztrick mentioned this pull request Jul 1, 2025
9 tasks
Copy link
Member

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

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

Question whether we even want these warnings if the point of the PR is that they don't need to end with /sse or /mcp

Comment on lines +24 to +26
if (!sseUrl.pathname.endsWith("/sse")) {
console.warn(`[warn] SSE transport URL does not end with /sse: ${options.url}`);
}
Copy link
Member

Choose a reason for hiding this comment

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

Given the focus of this PR, is it necessary to output this warning at all?

Comment on lines +38 to +40
if (!mcpUrl.pathname.endsWith("/mcp")) {
console.warn(`[warn] HTTP transport URL does not end with /mcp: ${options.url}`);
}
Copy link
Member

Choose a reason for hiding this comment

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

Given the focus of this PR, is it necessary to output this warning at all?

@olaservo olaservo added waiting on submitter Waiting for the submitter to provide more info cli Issues and PRs specific to cli mode labels Jul 7, 2025
@olaservo
Copy link
Member

Hi, closing this one since the other PR was merged and I see you had already tagged that one.

@olaservo olaservo closed this Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues and PRs specific to cli mode waiting on submitter Waiting for the submitter to provide more info
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants