Open
Description
- Copilot Chat Extension Version: 1.307.1529
- VS Code Version: 1.99.3 (User setup)
- OS Version: Windows 24H2 (26100.3775)
- Logs:
2025-04-25 10:42:10.841 [info] Connection state: Starting
2025-04-25 10:42:10.845 [info] Starting server from LocalProcess extension host
2025-04-25 10:42:10.880 [info] Connection state: Error Error connecting to https://localhost:5001/sse: TypeError: fetch failed
Steps to Reproduce:
- Create local MCP server using SSE transport (e.g. similar to https://github.com/jamesmontemagno/MonkeyMCP/tree/main/MonkeyMCPSSE)
- In https mode, dotnet uses a self-signed developer certificate that is trusted by the system
- Add it to
mcp.json
:
{
"servers": {
"myserver": {
"type": "sse",
"url": "https://localhost:5001/sse"
}
}
}
- Let VS Code connect to the MCP server - the MCP logs will show the logs above (
Connection state: Error Error connecting to https://localhost:5001/sse: TypeError: fetch failed
) - Let VS Code run the MCP server using http (so without certificates) and update
mcp.json
- Connect again - this time it works.
Additional context:
When trying to connect to it with the MCP Inspector, I get errors there like:
New SSE connection
Query parameters: [Object: null prototype] {
transportType: 'sse',
url: 'https://localhost:5001'
}
SSE transport: url=https://localhost:5001, headers=Accept
Error in /sse route: SseError: SSE error: TypeError: fetch failed: self-signed certificate
at _eventSource.onerror (file:///X:/packages/npm/_npx/5a9d879542beca3a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:69:31)
at EventSource.scheduleReconnect_fn (file:///X:/packages/npm/_npx/5a9d879542beca3a/node_modules/eventsource/dist/index.js:248:53)
at file:///X:/packages/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: self-signed certificate',
code: undefined,
defaultPrevented: false,
cancelable: false,
timeStamp: 151747.9074
}
}
I can imagine that VS Code has the same issue.