Skip to content

bug: MCP server processes persist after Q CLI terminal closure - orphaned Python processes accumulate #3272

@madhubalaji

Description

@madhubalaji

Checks

Operating system

Mac

Expected behaviour

MCP server processes started by Q CLI continue running as background processes even after the terminal session is closed, leading to resource accumulation and potential system performance issues.
Ideally, All MCP server processes should be terminated when Q CLI exits or the terminal is closed.

Actual behaviour

MCP server processes remain running as orphaned background processes. In the reported case, 80+ Python processes were found running from .cache/uv/archive-v0/ directories for various AWS MCP servers (cost-explorer,
bedrock, cfn, documentation, billing, terraform, etc.).

Steps to reproduce

Steps to Reproduce:

  1. Start Q CLI with MCP servers configured
  2. Use various MCP tools/servers during the session
  3. Close the terminal or exit Q CLI
  4. Check running processes with ps aux | grep -i "python.*.cache"

Environment

• OS: macOS
• Q CLI version: [current version]
• MCP servers: AWS Labs MCP servers (cost-explorer, bedrock-kb-retrieval, cfn, documentation, billing, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions