Skip to main content

A unified CLI and daemon/service to manage and proxy multiple MCP servers, with robust logging and a modern CLI UX.

Project description

MCP Manager CLI

A unified CLI and daemon/service to manage and proxy multiple MCP servers, with robust logging and a modern CLI UX.

Table of Contents

Features

  • Daemon/Service Architecture: Background FastAPI HTTP server for robust, multi-process management.
  • Unified CLI: Interactive CLI for all management and tool operations.
  • Server Management: Start, stop, and monitor multiple MCP servers defined in a config file.
  • SSE Support: Built-in /sse and /messages/ endpoints for real-time communication.
  • All runtime and config files are stored in the .cache/ directory for easy management and cleanup.

Architecture Overview

flowchart TD
    classDef user fill:#e0f7fa,stroke:#00796b,stroke-width:2px;
    classDef daemon fill:#fff3e0,stroke:#f57c00,stroke-width:2px;
    classDef process fill:#e8f5e9,stroke:#388e3c,stroke-width:2px;

    subgraph User
        CLI["๐Ÿ‘ค CLI (mcp-manager)"]:::user
        OtherClient["๐Ÿ‘ค Other MCP Client (SSE/WebSocket)"]:::user
    end

    subgraph "MCP Manager Daemon (FastAPI)"
        APIServer["๐Ÿ–ฅ๏ธ API Server (FastAPI)"]:::daemon
        ServerManager["๐Ÿ—„๏ธ ServerManager"]:::daemon
        Config["๐Ÿ“ Config (.cache/mcp_config.json)"]:::daemon
    end

    subgraph "Managed MCP Servers"
        MCPServer1["โš™๏ธ MCP Server 1 (Stdio Process)"]:::process
        MCPServer2["โš™๏ธ MCP Server 2 (Stdio Process)"]:::process
        MCPServerN["..."]:::process
    end

    CLI -- "HTTP" --> APIServer
    OtherClient -- "SSE" --> APIServer
    APIServer -- "Reads/writes" --> Config
    APIServer -- "Manages via" --> ServerManager
    ServerManager -- "Spawns & manages via stdio/stdout" --> MCPServer1
    ServerManager -- "Spawns & manages via stdio/stdout" --> MCPServer2
    ServerManager -- "Spawns & manages via stdio/stdout" --> MCPServerN

Installation

  1. Clone the repo:
    git clone <repo-url>
    cd mcp-manager
    
  2. Install uv (recommended for Python environments).
  3. Create and activate a virtual environment:
    uv venv .venv
    source .venv/bin/activate
    
  4. Install dependencies:
    uv pip install -e .
    

Configuration

Define MCP servers in .cache/mcp_config.json:

{
  "mcpServers": {
    "everything": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-everything"],
      "auto_start": true
    }
  }
}
  • auto_start: If true, the server starts automatically with the daemon.
  • After editing .cache/mcp_config.json, run server reload in the CLI to apply changes.
  • All config and runtime files are stored in the .cache/ directory.

Security & API Key Authentication

  • On first run, the server generates an API key in .cache/mcp_manager_api_key.txt.
  • All management endpoints require this API key as a Bearer token in the Authorization header.
  • The CLI uses this API key automatically.
  • To view the API key:
    api-key
    
  • To regenerate the API key:
    regenerate-api-key
    
  • For manual requests (e.g., curl/Postman), use:
    Authorization: Bearer <your-api-key>
    
  • API key file location: .cache/mcp_manager_api_key.txt

Quickstart

  1. Start the CLI:
    mcp-manager
    
  2. Example commands:
    • daemon start (default port 4123)
    • daemon start --port 5000 (custom port)
    • server list, server reload, tools list, api-key, regenerate-api-key, etc.
  3. Type help for all commands.
  4. All config and runtime files are in .cache/.

CLI User Interface Example

  __  __  ___ ___   __  __                             
 |  \/  |/ __| _ \ |  \/  |__ _ _ _  __ _ __ _ ___ _ _ 
 | |\/| | (__|  _/ | |\/| / _` | ' \/ _` / _` / -_) '_|
 |_|  |_|\___|_|   |_|  |_|\__,_|_||_\__,_\__, \___|_|  
                                         |___/          

MCP Manager: Multi MCP Server Control Panel. Powered by CloudThinker (https://www.cloudthinker.io).
Type 'help' for commands, 'exit' to quit.

mcp-manager> daemon start
MCP Manager daemon started (PID: 12345) on port 4123

mcp-manager> server list
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ    Name    โ”ƒ  Status  โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”ƒ hackernews โ”ƒ  running โ”ƒ
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”˜

mcp-manager> api-key
Current API Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

mcp-manager> help
[Shows the list of available commands]

Available CLI Commands

Command Description
daemon start [--port PORT] Start the MCP Manager daemon (optionally on a custom port)
daemon stop Stop the MCP Manager daemon
daemon status Show daemon status
daemon log Show the last N lines of the daemon log file
server list List all managed servers (shows Name and Status)
server reload Reload the MCP servers from the config file
server remove Remove a managed server
server start Start a managed server
server stop Stop a managed server
tools list List all tools
api-key Show the current API key
regenerate-api-key Regenerate and show a new API key
config edit Edit the MCP config JSON in your preferred editor (with JSON validation)
clear Clear the screen
exit Exit the CLI

Note:

  • daemon start runs the server on port 4123 by default. Use --port <PORT> to specify a different port.
  • All config and runtime files are stored in .cache/.
  • The config edit command opens .cache/mcp_config.json in your preferred editor (set by $EDITOR, or falls back to vim/nano/notepad) and checks for valid JSON before saving.

Daemon Log

  • The daemon log file is stored at .cache/mcp_manager_daemon.log.
  • Use the daemon log command to view the last N lines of the log.

Using with ngrok

Use ngrok to share your local MCP Manager server publicly:

# In another terminal:
ngrok http 4123

Using with Cursor

Use supergateway to connect with Cursor. Update the port and API key as needed:

{
  "mcpServers": {
    "mcp-manager": {
      "command": "npx",
      "args": [
        "-y",
        "supergateway",
        "--sse",
        "http://localhost:YOUR_PORT/sse",
        "--oauth2Bearer",
        "YOUR-API-KEY"
      ]
    }
  }
}

Replace YOUR_PORT with the port used by daemon start (default 4123), and YOUR-API-KEY with the value from .cache/mcp_manager_api_key.txt or the api-key command.

Roadmap

  • Support Multi-Tenant

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_manager_cli-0.0.1.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_manager_cli-0.0.1-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_manager_cli-0.0.1.tar.gz.

File metadata

  • Download URL: mcp_manager_cli-0.0.1.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for mcp_manager_cli-0.0.1.tar.gz
Algorithm Hash digest
SHA256 688dc864618f7a32898c34f63aaff617438d795204bd9c61450cbe49775c4a09
MD5 337d5081ac023a2c6e3dc2833da2876d
BLAKE2b-256 690f4b00bdd8ce886cf3a5a86c4b8b19465ded159b5e3253905cf3f3dbc093b3

See more details on using hashes here.

File details

Details for the file mcp_manager_cli-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_manager_cli-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5f91d0bea2279df08a47fa9ed8bacec8b0375e027079855f0cc1f9c7791500d
MD5 176fd971c6d418c0586d438bd29451a2
BLAKE2b-256 27048251dd57c8d8eb9baa673b9345d9e39452fe3247852e6837cefdd501ef18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page