-
Notifications
You must be signed in to change notification settings - Fork 546
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The Haystack Search MCP server works in VS Code and the MCP Inspector, but fails with the .NET MCP SDK:
(https://microsoft.visualstudio.com/Edge/_wiki/wikis/Edge.wiki/201379/Haystack-Search-Empower-your-search-in-VS-Code)
[Haystack Search - Empower your search in VS Code - Overview]
To Reproduce
- Install the VS Code extension
- Add the MCP server to VS Code via its
http://localhost:13135/mcp/sseendpoint. - Confirm that VS Code discovered 2 tools.

- Check out the MCP Inspector which also verifies two tools:

- Now try with the .NET MCP SDK:
var transport = new SseClientTransport(new SseClientTransportOptions { Endpoint = new Uri("http://localhost:13135/mcp/sse") });
IMcpClient client = await McpClientFactory.CreateAsync(transport)Awaiting CreateAsync throws an exception
System.InvalidOperationException
HResult=0x80131509
Message=Failed to send message
Source=ModelContextProtocol
StackTrace:
at ModelContextProtocol.Client.SseClientSessionTransport.<SendMessageAsync>d__10.MoveNext()
at ModelContextProtocol.McpSession.<SendRequestAsync>d__28.MoveNext()
at ModelContextProtocol.McpEndpointExtensions.<SendRequestAsync>d__1`2.MoveNext()
at System.Threading.Tasks.ValueTask`1.get_Result()
at ModelContextProtocol.Client.McpClient.<ConnectAsync>d__20.MoveNext()
at ModelContextProtocol.Client.McpClient.<ConnectAsync>d__20.MoveNext()
at ModelContextProtocol.Client.McpClientFactory.<CreateAsync>d__0.MoveNext()
at ModelContextProtocol.Client.McpClientFactory.<CreateAsync>d__0.MoveNext()
at Microsoft.VisualStudio.Conversations.Service.Mcp.McpServerTracker.<>c__DisplayClass8_0.<<-ctor>b__0>d.MoveNext() in Q:\source\VisualStudio.Conversations\src\Copilot.Service\Mcp\McpServerTracker.cs:line 57
This exception was originally thrown at this call stack:
ModelContextProtocol.Client.SseClientSessionTransport.SendMessageAsync(ModelContextProtocol.Protocol.JsonRpcMessage, System.Threading.CancellationToken)
ModelContextProtocol.McpSession.SendRequestAsync(ModelContextProtocol.Protocol.JsonRpcRequest, System.Threading.CancellationToken)
ModelContextProtocol.Client.McpClient.ConnectAsync(System.Threading.CancellationToken)
ModelContextProtocol.Client.McpClient.ConnectAsync(System.Threading.CancellationToken)
ModelContextProtocol.Client.McpClientFactory.CreateAsync(ModelContextProtocol.Client.IClientTransport, ModelContextProtocol.Client.McpClientOptions, Microsoft.Extensions.Logging.ILoggerFactory, System.Threading.CancellationToken)
ModelContextProtocol.Client.McpClientFactory.CreateAsync(ModelContextProtocol.Client.IClientTransport, ModelContextProtocol.Client.McpClientOptions, Microsoft.Extensions.Logging.ILoggerFactory, System.Threading.CancellationToken)
Microsoft.VisualStudio.Conversations.Service.Mcp.McpServerTracker..ctor.AnonymousMethod__0() in McpServerTracker.cs
Expected behavior
The connection succeeds. No exception thrown.
Additional context
Note this server is SSE -- Not "streamable HTTP". The Inspector fails when on "streamable HTTP". SSE mode seems to be the default for the .NET MCP SDK, so I expect this to work.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working