-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Open
Labels
area/toolsBuilt-in tools and the MCP ecosystem.Built-in tools and the MCP ecosystem.kind/bugSomething isn't workingSomething isn't workingmaintainerFor Roadmap ItemsFor Roadmap Itemspriority/p1Important and should be addressed in the near term.Important and should be addressed in the near term.sub-area/performanceIssues related to performance.Issues related to performance.
Description
What happened?
The CLI doesn't clean up MCP Servers that are spin up via commands (using stdio transport) when performing an /mcp refresh
command.
Steps to reproduce:
- Configure one stdio mcp server in settings.json (via "command" property)
- Start the CLI
- Run
!ps -ef | grep your-mcp-server-command
(should have one count) - Run
/mcp refresh
- Run
!ps -ef | grep your-mcp-server-command
(should have two counts) - Run
/mcp refresh
- Run
!ps -ef | grep your-mcp-server-command
(should have three counts)
When started:

After 2 refreshes:

Source code for the server:
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/danicat/speedgrapher/internal/prompts"
"github.com/modelcontextprotocol/go-sdk/mcp"
)
func main() {
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer stop()
if err := run(ctx, os.Args[1:]); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func run(ctx context.Context, args []string) error {
server := mcp.NewServer(
&mcp.Implementation{Name: "speedgrapher"},
nil,
)
server.AddPrompt(prompts.Haiku(), prompts.HaikuHandler)
server.AddPrompt(prompts.Interview(), prompts.InterviewHandler)
server.AddPrompt(prompts.Localize(), prompts.LocalizeHandler)
server.AddPrompt(prompts.Review(), prompts.ReviewHandler)
return server.Run(ctx, mcp.NewStdioTransport())
}
What did you expect to happen?
No process leak when doing a manual refresh.
Client information
- CLI Version: 0.1.15
- Git Commit: c45c14e (local modifications)
- Operating System: darwin v22.16.0
- Sandbox Environment: no sandbox
- Model Version: gemini-2.5-pro
- Memory Usage: 208.5 MB
Login information
No response
Anything else we need to know?
Currently working on a fix, PR will come soon.
Metadata
Metadata
Assignees
Labels
area/toolsBuilt-in tools and the MCP ecosystem.Built-in tools and the MCP ecosystem.kind/bugSomething isn't workingSomething isn't workingmaintainerFor Roadmap ItemsFor Roadmap Itemspriority/p1Important and should be addressed in the near term.Important and should be addressed in the near term.sub-area/performanceIssues related to performance.Issues related to performance.
Type
Projects
Status
Ready for Work