Skip to content

Incorrect URL in sse.js when providing a custom path #313

@AbduGh

Description

@AbduGh

Summary
When adding an sse server using a custom path (e.g. http://localhost:3001/custom/path/sse), the server sends messages requests to http://localhost:3001 instead of http://localhost:3001/custom/path.

Steps to reproduce
Steps to reproduce the behavior:

  1. Launch an SSE MCP server on a custom path (e.g. http://localhost:3001/custom/path)
  2. Connect the inspector to it using the UI (enter http://localhost:3001/custom/path/sse in the URL field)
  3. Try to connect. Instead of successful connection, yo get an error because it sends requests to http://localhost:3001

Issue
this._endpoint = new URL(messageEvent.data, this._url); in sse.js ignores custom path, which is needed for the upcoming requests.

Impact
No connection is possible

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwaiting on submitterWaiting for the submitter to provide more info

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions