Feature Request: Singleton mode for MCP servers to prevent duplicate process spawning

Resolved 💬 3 comments Opened Jan 1, 2026 by craigvc Closed Jan 5, 2026

Problem

When running multiple Claude Code sessions (or resuming sessions), each session spawns its own complete set of MCP server processes, even when they share the same configuration and name. This leads to significant resource waste and process accumulation.

Example from a real system:

=== MCP Process Summary ===
chrome-devtools-mcp: 16
Unreal_MCP: 10
github-mcp-server: 16
asset-sorter-mcp: 9
gitlab-mcp: 2
paypal/mcp: 3

Total MCP-related processes: 47

These processes persist even after sessions end, requiring manual cleanup.

Proposed Solution

Add a "singleton": true option to MCP server configuration that would:

  1. Before spawning a new MCP server process, check if one with the same name is already running
  2. If found, reuse the existing connection instead of spawning a new process
  3. Only spawn a new process if no existing server with that name exists

Example configuration:

{
  "mcpServers": {
    "gitlab": {
      "command": "/usr/local/bin/gitlab-mcp",
      "args": ["--base-url", "https://gitlab.example.com"],
      "singleton": true
    }
  }
}

Workarounds Considered

  • HTTP transport: Running MCP servers as persistent HTTP services works, but requires changing each server's configuration and managing them as external services
  • Idle timeout in servers: Individual MCP servers can implement idle timeouts to auto-exit, but this doesn't prevent the initial duplication

Benefits

  • Reduced memory usage (each MCP server process consumes 70-120MB+)
  • Cleaner process management
  • Better resource utilization on developer machines
  • No orphaned processes accumulating over time

Environment

  • Claude Code CLI on Linux
  • Multiple terminal sessions with Claude Code instances
  • Mix of stdio and HTTP transport MCP servers

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗