Skip to content

MCP SDK Can not handle the MCP Servers with subpath #471

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
tobegit3hub opened this issue May 9, 2025 · 0 comments
Open

MCP SDK Can not handle the MCP Servers with subpath #471

tobegit3hub opened this issue May 9, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@tobegit3hub
Copy link

Issue:
Clients (Inspector/Cherry Studio) fail to connect when MCP Server uses a subpath (e.g., http://domain.com/subpath/sse). Root paths (http://domain.com/) work normally.

Reproduce:

  1. Start MCP Server at http://domain.com/subpath/sse
  2. Client connection fails with error:
    Error POSTing to endpoint (HTTP 503): no healthy upstream

Cause:
In sse.ts#L146, new URL() discards the subpath from the server URL. Example:
Request to /messages/ becomes http://domain.com/messages/ instead of http://domain.com/subpath/messages/.

@tobegit3hub tobegit3hub added the bug Something isn't working label May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant