inspector icon indicating copy to clipboard operation
inspector copied to clipboard

HTTPS/SEE Connections Ignore TCP Port Numbers in URLs

Open moloch-- opened this issue 8 months ago • 3 comments

Describe the bug The inspector seems to always attempt connecting over port 80 even when the protocol is https: or a specific port number is specified in the HTTPS URL.

To Reproduce Steps to reproduce the behavior:

  1. Use an SSE URL such as https://foobar.net/mcp/sse or https://foobar.net:443/mcp/sse

Expected behavior Uses the default protocol port number, or the port number specified in the URL.

Logs

New SSE connection
Query parameters: {
  transportType: 'sse',
  url: 'https://foobar.net/mcp'
}
SSE transport: url=https://foobar.net/mcp, headers=Accept
Error in /sse route: SseError: SSE error: TypeError: fetch failed: Connect Timeout Error (attempted address: con-dev-cips-api.tailnet-ce56.ts.net:80, timeout: 10000ms)
    at _eventSource.onerror (file:///Users/moloch/.npm/_npx/5a9d879542beca3a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:69:31)
    at EventSource.scheduleReconnect_fn (file:///Users/moloch/.npm/_npx/5a9d879542beca3a/node_modules/eventsource/dist/index.js:248:53)
    at file:///Users/moloch/.npm/_npx/5a9d879542beca3a/node_modules/eventsource/dist/index.js:98:174
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: undefined,
  event: {
    type: 'error',
    message: 'TypeError: fetch failed: Connect Timeout Error (attempted address: foobar.net:80, timeout: 10000ms)',
    code: undefined,
    defaultPrevented: false,
    cancelable: false,
    timeStamp: 199759.002416
  }
}

Additional context Add any other context about the problem here.

moloch-- avatar Apr 09 '25 18:04 moloch--

Wanted to clarify, are you seeing this issue in CLI mode?

olaservo avatar Apr 30 '25 12:04 olaservo

So far I'm unable to repro this in either the Inspector UI or in CLI mode. Since this issue has been open for a few weeks I'm wondering if this was resolved in a PR since then, or if this is still happening.

olaservo avatar Apr 30 '25 13:04 olaservo

Could have been, I was using the UI at the time, I'll try again.

moloch-- avatar May 01 '25 21:05 moloch--

Closing this since I wasn't able to repro, but please re-open if you're still having this issue.

olaservo avatar May 18 '25 13:05 olaservo