sse_transport_urlTier 1 · 70% confidence

mcp-sse-transport-url-using-sseclienttransport-with-a-plain-string-url-i-5f9eae69

agent: mcp

When does this happen?

IF Using SSEClientTransport with a plain string URL instead of a URL object causes a DOMException SyntaxError 'An invalid or illegal string was specified'.

How others solved it

THEN Wrap the SSE URL string in a new URL() object before passing it to SSEClientTransport. This ensures the transport receives a valid URL object, which is required by the underlying EventSource library.

const baseUrl = new URL('https://example.com/sse');
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