Skip to content

Cannot conect to stateless streamable http mcp server developed using C# SDK using VSCode mcp client #251978

Closed
@ananthubabu-geodis

Description

@ananthubabu-geodis

Developed and deployed a mcp server exposing majorly prompts and just one tool for testing and is getting the error :

2025-06-20 14:50:02.632 [info] Starting server from LocalProcess extension host
2025-06-20 14:50:02.663 [info] Connection state: Running
2025-06-20 14:50:03.942 [info] Discovered 0 tools
2025-06-20 14:50:04.775 [info] Connection state: Error ; will retry with new session ID

I have provided the options

            .ConfigureServices((_, services) =>
                {
                    services
                        .AddMcpServer(options =>
                        {
                            options.ServerInfo = new Implementation
                            {
                                Name = "Vite MCP Server",
                                Version = "1.0.0"
                            };
                        })
                        .WithHttpTransport(options =>
                        {
                            options.IdleTimeout = TimeSpan.FromMinutes(15);
                            options.MaxIdleSessionCount = 100;
                            options.Stateless = true;
                        })
                        .WithToolsFromAssembly()
                        .WithPromptsFromAssembly();
                });

also in Startup.cs :

            app.UseCors("CorsPolicy");
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapMcp("/mcp");
            });

It works fine in local machine using http ports but not in https.

The hosted server also returns the error.

Could this be because of any certificate issue?

VSCode is my mcp client.

Metadata

Metadata

Assignees

Labels

*questionIssue represents a question, should be posted to StackOverflow (VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions