-
Notifications
You must be signed in to change notification settings - Fork 547
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Shutting down console application with CTRL-C or just killing it and uses mcpclient does not kill the stdio process
To Reproduce
Install a dotnet tool mcpserver:
dotnet tool install --version 0.0.1-preview-02 --global mcpserver.everything.stdioAnd this C# code in a console app:
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using ModelContextProtocol.Client;
using ModelContextProtocol.Configuration;
using ModelContextProtocol.Protocol.Transport;
var config = new McpServerConfig
{
Id = "everything",
Name = "everything",
TransportType = TransportTypes.StdIo,
TransportOptions = new Dictionary<string, string>
{
{ "command", "mcpserver.everything.stdio" }
}
};
var options = new McpClientOptions
{
ClientInfo = new() { Name = "everything-client", Version = "1.0.0" }
};
var client = await McpClientFactory.CreateAsync(config, options, null, LoggerFactory.Create(c => c.AddConsole()));
_ = await client.ListToolsAsync();See also https://github.com/StefH/mcptest
Expected behavior
When the application stops, is killed (using close) or using CTRL-C, it's expected that the spawned child process (the stdio server) is also killed.
This is not the case, using when manually calling DisposeAsync on the McpClient, the process is killed.
vurhanau
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working