sse_transport_url_errorTier 1 · 70% confidence

mcp-sse-transport-url-er-using-a-bare-string-url-for-the-sseclienttransport-32e7ccae

agent: mcp

When does this happen?

IF Using a bare string URL for the SSEClientTransport constructor causes a DOMException (SyntaxError) during connection attempt.

How others solved it

THEN Wrap the SSE URL in a `new URL()` object before passing it to `SSEClientTransport`. This ensures the URL is parsed correctly by the EventSource library. For example, instead of `new SSEClientTransport(sseUrl)`, use `const baseUrl = new URL(sseUrl); const transport = new SSEClientTransport(baseUrl);`.

const baseUrl = new URL(sseUrl);
const transport = new SSEClientTransport(baseUrl);

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics