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
- Architecture Overview
- Installation
- Run with Docker
- Configuration
- Security & API Key Authentication
- Quickstart
- CLI User Interface Example
- Available CLI Commands
- Roadmap
- License
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,/messages/, and/mcp-server-name/sseendpoints for real-time communication with individual servers. - 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
Quick install from PyPI:
pip install mcp-manager-cli
Or, to install from source:
- Clone the repo:
git clone <repo-url> cd mcp-manager
- Install uv (recommended for Python environments).
- Create and activate a virtual environment:
uv venv .venv source .venv/bin/activate
- Install dependencies:
uv pip install -e .
Run with Docker
You can run MCP Manager CLI using Docker. This is the easiest way to get started without installing Python or dependencies on your system.
Using Docker Compose
- Make sure you have Docker and Docker Compose installed.
- Use the provided
docker-compose.yml(already configured):docker-compose up -d
This will pull and run the imagekhaitrinhxuan/mcp-manager-cli:latestand expose port 4123. - The
.cachedirectory will be used for configuration and runtime files, and is mounted for persistence.
Using Docker CLI directly
You can also run the container directly:
docker run -d \
--name mcp-manager \
-p 4123:4123 \
-v $(pwd)/.cache:/app/.cache \
khaitrinhxuan/mcp-manager-cli:latest
- The API server will be available on http://localhost:4123
- All config and runtime files are stored in
.cache/on your host.
Configuration
Define MCP servers in .cache/mcp_config.json:
{
"mcpServers": {
"hackernews": {
"command": "uvx",
"args": [
"mcp-hn"
],
"auto_start": true
}
}
}
auto_start: If true, the server starts automatically with the daemon.- After editing
.cache/mcp_config.json, runserver reloadin 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
Authorizationheader. - 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
- Start the CLI:
mcp-manager
- 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.
- Type
helpfor all commands. - All config and runtime files are in
.cache/.
SSE Endpoints
The MCP Manager daemon provides several SSE (Server-Sent Events) endpoints for real-time communication:
- Unified SSE Proxy:
GET /sseโ Connect to all managed servers via a unified SSE stream.
- Per-Server SSE Endpoint:
GET /<mcp-server-name>/sseโ Connect directly to a specific managed server's SSE stream. Replace<mcp-server-name>with the name of your server (e.g.,/hackernews/sse).
- Messages Endpoint:
POST /messagesโ Send messages to all servers (with authentication).POST /<mcp-server-name>/messagesโ Send messages to a specific server.
Tip: Use the per-server SSE endpoint (
/<mcp-server-name>/sse) for direct, real-time communication with a single managed server.
CLI User Interface Example
__ __ ___ ___ __ __
| \/ |/ __| _ \ | \/ |__ _ _ _ __ _ __ _ ___ _ _
| |\/| | (__| _/ | |\/| / _` | ' \/ _` / _` / -_) '_|
|_| |_|\___|_| |_| |_|\__,_|_||_\__,_\__, \___|_|
|___/ โ๏ธ CloudThinker
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 startruns 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 editcommand opens.cache/mcp_config.jsonin 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 logcommand 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_manager_cli-1.0.0.tar.gz.
File metadata
- Download URL: mcp_manager_cli-1.0.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2101ffa5d13790b7161cad212077cdb311189939f86094a17922ae7e8be0648f
|
|
| MD5 |
ae47c5b23bc3d94391164a395042cfbd
|
|
| BLAKE2b-256 |
01cc39fd9a2e4bf2b714bfb4bba6bcc81b6ad8f4bffbdd261aa4c2f4dd1763a3
|
File details
Details for the file mcp_manager_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mcp_manager_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a04b3a9c0b484b1fcd44e46ace3fc2a770e8255e93b901f4f454a58d59696bc6
|
|
| MD5 |
e4480cf5b3ce009fa1c4d1710f8c3873
|
|
| BLAKE2b-256 |
e12f98bdd86b9ce329dede3477d7f8e569e404d0aa71511230025f49546d5530
|