Skip to content

McpClientFactory.CreateAsync connecting to the Microsoft learn mcp server just hangs #784

@kkfrosty

Description

@kkfrosty

Describe the bug
Described in the title.

To Reproduce
Steps to reproduce the behavior:

  1. Code below using sse using the Microsoft learn mcp server was working and now the code just hangs, trying to configure a timeout doesn't seem to change anything.

Expected behavior
It was working last week and you'd get a response from the learn server. The issue is even if the mcp server is having issues, this shouldn't just cause an application hang.

"https://learn.microsoft.com/api/mcp

Additional context
Add any other context about the problem here.
` IMcpClient client;

// Step 4: Create appropriate transport client
if (transport.Equals("sse", StringComparison.OrdinalIgnoreCase))
{
    this.ReportProgress($"🌐 Setting up SSE transport for {serverName}", "MCP-Provider");
    
    var endpoint = section["Endpoint"] ?? throw new InvalidOperationException($"Endpoint required for '{serverName}'");
    this.ReportProgress($"📡 Connecting to endpoint: {endpoint}", "MCP-Provider");

    var sse = new SseClientTransport(new SseClientTransportOptions
    {
        Endpoint = new Uri(endpoint),
        TransportMode = HttpTransportMode.AutoDetect,
        Name = serverName
    });

    McpClientOptions options = new()
    {
        // You can set additional options here if needed
        InitializationTimeout = TimeSpan.FromSeconds(30)
    };

    this.ReportProgress($"🔗 Creating MCP client connection...", "MCP-Provider");
    client = await McpClientFactory.CreateAsync(sse, options, null, new CancellationToken()); < - This line of code hangs, the call is made and never returns and hangs if you run it.  It was working last week and the source could be the Microsoft Learn MCP server, but whatever is going on, can't cause this call to just hang and never time out.
    this.ReportProgress($"✅ SSE client connected successfully", "MCP-Provider");
}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds confirmationUnclear if still relevant

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions