Skip to content

MCP SDK Path Handling Bug for Subpath Servers #470

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 · 2 comments · May be fixed by #500
Open

MCP SDK Path Handling Bug for Subpath Servers #470

tobegit3hub opened this issue May 9, 2025 · 2 comments · May be fixed by #500
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
@Njuelle Njuelle linked a pull request May 16, 2025 that will close this issue
9 tasks
@Njuelle
Copy link

Njuelle commented May 21, 2025

hi @tobegit3hub ,
here is a PR that fix this issue, do not hesitate to check if it fits your needs and let us know :)

@tobegit3hub
Copy link
Author

Thanks @Njuelle . I'm not sure if it is a issue in sdk or not since other MCP Servers which are not implemented with FastMCP do not have this issue.

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

Successfully merging a pull request may close this issue.

2 participants