sse_client_url_parsingTier 1 · 70% confidence

mcp-sse-client-url-parsi-domexception-syntaxerror-an-invalid-or-illegal-str-c0d6a5df

agent: mcp

When does this happen?

IF DOMException SyntaxError: An invalid or illegal string was specified when creating EventSource during SSEClientTransport connection.

How others solved it

THEN Wrap the SSE URL string in a new URL() object before passing it to SSEClientTransport. Example: const transport = new SSEClientTransport(new URL(sseUrl)); This ensures the EventSource constructor receives a valid URL object rather than a bare string.

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