|
1 | | -# McpMux - Centralized MCP Server Management |
| 1 | +# McpMux |
2 | 2 |
|
3 | 3 | [](LICENSE) |
| 4 | +[](https://github.com/MCP-Mux/mcp-mux/releases) |
4 | 5 |
|
5 | | -> A desktop application for managing Model Context Protocol (MCP) servers with spaces, credentials, and cloud sync. |
| 6 | +**One gateway. Every MCP server. Zero cloud traffic.** |
| 7 | + |
| 8 | +McpMux is a cross-platform desktop application that aggregates all your Model Context Protocol (MCP) servers behind a single local endpoint. It manages credentials, isolates projects into Spaces, and keeps every tool call on your machine. |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## The Problem |
| 13 | + |
| 14 | +Working with MCP servers today means juggling multiple connections, credentials, and configurations across different AI clients. Each server may require its own authentication, and switching between projects means reconfiguring everything. Credentials end up scattered, there is no unified view of available tools, and sensitive data often passes through third-party services unnecessarily. |
| 15 | + |
| 16 | +## The Solution |
| 17 | + |
| 18 | +McpMux runs a local gateway on `localhost:9315` that acts as a single entry point for all your MCP servers. AI clients connect to McpMux once, and it handles the rest: routing tool calls to the right backend, refreshing OAuth tokens automatically, and keeping credentials locked in your OS keychain. |
| 19 | + |
| 20 | +``` |
| 21 | +┌─────────────────────────────────────────────────────────┐ |
| 22 | +│ AI Clients │ |
| 23 | +│ (Cursor, Claude Desktop, VS Code, etc.) │ |
| 24 | +└──────────────────────┬──────────────────────────────────┘ |
| 25 | + │ Single connection |
| 26 | + ▼ |
| 27 | +┌─────────────────────────────────────────────────────────┐ |
| 28 | +│ McpMux Gateway │ |
| 29 | +│ localhost:9315 │ |
| 30 | +│ │ |
| 31 | +│ ┌──────────┐ ┌──────────┐ ┌───────────────┐ │ |
| 32 | +│ │ Space A │ │ Space B │ │ Feature Sets │ │ |
| 33 | +│ │ (Work) │ │ (Personal)│ │ (Permissions) │ │ |
| 34 | +│ └──────────┘ └──────────┘ └───────────────┘ │ |
| 35 | +└──────────┬──────────┬──────────┬────────────────────────┘ |
| 36 | + │ │ │ |
| 37 | + ┌─────┘ ┌─────┘ ┌────┘ |
| 38 | + ▼ ▼ ▼ |
| 39 | +┌─────────┐┌─────────┐┌─────────┐ |
| 40 | +│ stdio ││ HTTP ││ SSE │ |
| 41 | +│ servers ││ servers ││ servers │ |
| 42 | +└─────────┘└─────────┘└─────────┘ |
| 43 | +``` |
| 44 | + |
| 45 | +--- |
6 | 46 |
|
7 | 47 | ## Features |
8 | 48 |
|
9 | | -- 🔐 **Secure Credentials** - OS keychain + encrypted database storage |
10 | | -- 🌐 **Spaces** - Isolated environments for different projects |
11 | | -- ⚡ **Local Gateway** - All MCP traffic stays on your machine |
12 | | -- ☁️ **Cloud Sync** - Configuration sync across devices (optional) |
13 | | -- 🔌 **Multi-Transport** - Supports stdio, HTTP, and SSE MCP servers |
| 49 | +### Local-First Gateway |
| 50 | +All MCP traffic stays on your machine. McpMux runs entirely on `localhost` and never routes tool calls through external services. Cloud sync is optional and limited to configuration data only (server definitions, space settings) — never command payloads or responses. |
| 51 | + |
| 52 | +### Spaces: Project Isolation |
| 53 | +Organize servers into isolated workspaces called **Spaces**. Each Space has its own set of server configurations, credentials, and permissions. Switch between "Work", "Personal", or "Client Project" contexts without reconfiguring anything. Credentials are never shared across Spaces. |
| 54 | + |
| 55 | +### Secure Credential Management |
| 56 | +Credentials are stored using your operating system's native keychain: |
| 57 | +- **macOS**: Keychain |
| 58 | +- **Windows**: Credential Manager |
| 59 | +- **Linux**: Secret Service (GNOME Keyring, KWallet) |
| 60 | + |
| 61 | +Sensitive fields in the local database are encrypted with **AES-256-GCM** authenticated encryption. Encryption keys live in the OS keychain, not on disk. Sensitive data is zeroized from memory after use to prevent leaks. |
| 62 | + |
| 63 | +### OAuth 2.1 with PKCE |
| 64 | +McpMux implements the full OAuth 2.1 authorization flow with Proof Key for Code Exchange (PKCE, RFC 7636) for connecting to remote MCP servers. It handles: |
| 65 | +- Automatic server discovery via RFC 8414 (`.well-known/oauth-authorization-server`) |
| 66 | +- Dynamic Client Registration (RFC 7591) |
| 67 | +- Automatic token refresh — no manual re-authentication |
| 68 | + |
| 69 | +### Multi-Transport Support |
| 70 | +Connect to MCP servers over any supported transport: |
| 71 | +- **stdio** — local processes (Node.js, Python, Rust, Go, etc.) |
| 72 | +- **Streamable HTTP** — remote servers over HTTP/HTTPS |
| 73 | +- **SSE** — Server-Sent Events for streaming |
| 74 | + |
| 75 | +### Server Registry & Discovery |
| 76 | +Browse and install servers from the built-in MCP registry. McpMux automatically discovers available tools, prompts, and resources from each connected server and caches them for offline access. |
| 77 | + |
| 78 | +### Feature Sets & Permissions |
| 79 | +Create fine-grained permission bundles called **Feature Sets** to control which tools, prompts, and resources each client can access. Compose sets from other sets, include or exclude specific features, and assign them per client. |
| 80 | + |
| 81 | +### Client Access Keys |
| 82 | +Generate access keys for each AI client. Clients authenticate to the gateway using `MCP-Key` or `Bearer` tokens. Each client can be assigned different Feature Sets, giving you granular control over what each client can do. |
| 83 | + |
| 84 | +### Server Logging & Monitoring |
| 85 | +Each server gets its own rotating log file with entries categorized by source (Connection, OAuth, Transport, MCP, Feature). View logs directly in the app's UI. Sensitive tokens are never written to logs. |
| 86 | + |
| 87 | +### System Tray & Auto-Start |
| 88 | +McpMux runs in the system tray and can be configured to start automatically with your OS. The gateway keeps running in the background so your AI clients always have access to their tools. |
| 89 | + |
| 90 | +### Auto-Updates |
| 91 | +Built-in update mechanism checks for new releases automatically. Updates are signed and verified before installation. |
| 92 | + |
| 93 | +### Deep Linking |
| 94 | +The `mcpmux://` URL scheme allows external applications to trigger actions in McpMux directly, such as initiating OAuth flows or installing servers. |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +## Security |
| 99 | + |
| 100 | +McpMux is designed with a defense-in-depth approach to credential and data security. |
| 101 | + |
| 102 | +| Layer | Mechanism | Details | |
| 103 | +|-------|-----------|---------| |
| 104 | +| **Credential Storage** | OS Keychain | Master encryption key and JWT signing secret stored in platform-native secure storage | |
| 105 | +| **Database Encryption** | AES-256-GCM | Field-level authenticated encryption with unique nonces per operation | |
| 106 | +| **Memory Safety** | Zeroize | Sensitive data cleared from memory after use | |
| 107 | +| **Authentication** | OAuth 2.1 + PKCE | S256 code challenge method; automatic token refresh | |
| 108 | +| **Client Auth** | Access Keys | Per-client `mcp_<random>` tokens with configurable permissions | |
| 109 | +| **Network** | Local-only by default | Gateway binds to `127.0.0.1`; no external exposure | |
| 110 | +| **TLS** | rustls | HTTPS support for remote server connections | |
| 111 | +| **Logging** | Sanitized | Tokens and secrets are never written to log files | |
| 112 | +| **Isolation** | Spaces | Credentials and configurations never leak between Spaces | |
| 113 | +| **Sessions** | JWT (HS256) | Signed with 32-byte secret stored in OS keychain | |
| 114 | + |
| 115 | +--- |
| 116 | + |
| 117 | +## Getting Started |
| 118 | + |
| 119 | +### Download |
| 120 | + |
| 121 | +Download the latest release for your platform from the [Releases page](https://github.com/MCP-Mux/mcp-mux/releases): |
| 122 | + |
| 123 | +| Platform | Format | |
| 124 | +|----------|--------| |
| 125 | +| **Windows** | MSI installer | |
| 126 | +| **macOS** | DMG | |
| 127 | +| **Linux** | DEB, RPM, AppImage | |
| 128 | + |
| 129 | +### Configure Your AI Client |
| 130 | + |
| 131 | +Once McpMux is running, point your AI client to the local gateway: |
| 132 | + |
| 133 | +```json |
| 134 | +{ |
| 135 | + "mcpServers": { |
| 136 | + "mcpmux": { |
| 137 | + "url": "http://localhost:9315/mcp" |
| 138 | + } |
| 139 | + } |
| 140 | +} |
| 141 | +``` |
| 142 | + |
| 143 | +--- |
14 | 144 |
|
15 | | -## Quick Start |
| 145 | +## Development |
16 | 146 |
|
17 | 147 | ### Prerequisites |
18 | 148 |
|
19 | 149 | - [Rust](https://rustup.rs/) 1.75+ |
20 | 150 | - [Node.js](https://nodejs.org/) 18+ |
21 | 151 | - [pnpm](https://pnpm.io/) 9+ |
22 | 152 |
|
23 | | -**Linux system dependencies** (for credential storage via Secret Service): |
24 | | -- `gnome-keyring` (or another `org.freedesktop.secrets` implementation like KWallet on KDE) |
| 153 | +**Linux additional dependencies** (for credential storage via Secret Service): |
25 | 154 |
|
26 | | -### Development |
| 155 | +```bash |
| 156 | +# Debian/Ubuntu |
| 157 | +sudo apt install gnome-keyring libsecret-1-dev librsvg2-dev pkg-config |
| 158 | + |
| 159 | +# Fedora/RHEL |
| 160 | +sudo dnf install gnome-keyring libsecret-devel librsvg2-devel pkg-config |
| 161 | +``` |
| 162 | + |
| 163 | +### Setup & Run |
27 | 164 |
|
28 | 165 | ```bash |
29 | | -# First time setup (installs deps, Playwright browsers, etc.) |
| 166 | +# First-time setup (installs dependencies, Playwright browsers, etc.) |
30 | 167 | pnpm setup |
31 | 168 |
|
32 | | -# Or manually: |
33 | | -pnpm install |
34 | | - |
35 | | -# Start development |
| 169 | +# Start development (launches both Tauri backend and React frontend) |
36 | 170 | pnpm dev |
| 171 | + |
| 172 | +# Build for production |
| 173 | +pnpm build |
37 | 174 | ``` |
38 | 175 |
|
39 | | -### Build |
| 176 | +### Testing |
40 | 177 |
|
41 | 178 | ```bash |
42 | | -# Build for production |
43 | | -pnpm build |
| 179 | +# Run all tests |
| 180 | +pnpm test |
| 181 | + |
| 182 | +# Rust unit tests |
| 183 | +pnpm test:rust:unit |
| 184 | + |
| 185 | +# Rust integration tests |
| 186 | +pnpm test:rust:int |
| 187 | + |
| 188 | +# TypeScript tests |
| 189 | +pnpm test:ts |
| 190 | + |
| 191 | +# E2E tests (web, works on all platforms) |
| 192 | +pnpm test:e2e:web |
| 193 | + |
| 194 | +# Full Tauri E2E tests (Windows/Linux) |
| 195 | +pnpm test:e2e |
| 196 | +``` |
| 197 | + |
| 198 | +### Code Quality |
| 199 | + |
| 200 | +```bash |
| 201 | +# Lint, typecheck, and format check |
| 202 | +pnpm validate |
| 203 | + |
| 204 | +# Auto-format |
| 205 | +pnpm format |
44 | 206 | ``` |
45 | 207 |
|
| 208 | +--- |
| 209 | + |
46 | 210 | ## Project Structure |
47 | 211 |
|
48 | 212 | ``` |
49 | | -mcpmux/ |
| 213 | +mcp-mux/ |
50 | 214 | ├── apps/ |
51 | | -│ └── desktop/ # Tauri desktop application |
52 | | -│ ├── src/ # React frontend |
53 | | -│ └── src-tauri/ # Rust backend |
| 215 | +│ └── desktop/ # Tauri desktop application |
| 216 | +│ ├── src/ # React 19 + TypeScript frontend |
| 217 | +│ └── src-tauri/ # Rust backend (Tauri commands) |
54 | 218 | ├── crates/ |
55 | | -│ ├── mcpmux-core/ # Domain logic and entities |
56 | | -│ ├── mcpmux-mcp/ # MCP protocol handling |
57 | | -│ └── mcpmux-storage/ # Persistence layer |
58 | | -└── packages/ |
59 | | - └── ui/ # Shared React components |
| 219 | +│ ├── mcpmux-core/ # Domain entities, services, events |
| 220 | +│ ├── mcpmux-gateway/ # HTTP gateway, connection pool, OAuth, routing |
| 221 | +│ ├── mcpmux-storage/ # SQLite, AES-256-GCM encryption, OS keychain |
| 222 | +│ └── mcpmux-mcp/ # MCP protocol implementation |
| 223 | +├── packages/ |
| 224 | +│ └── ui/ # Shared React UI components |
| 225 | +└── tests/ |
| 226 | + ├── rust/ # Rust integration tests |
| 227 | + ├── ts/ # TypeScript unit tests |
| 228 | + └── e2e/ # E2E tests (Playwright + WebdriverIO) |
60 | 229 | ``` |
61 | 230 |
|
62 | | -## Architecture |
| 231 | +### Tech Stack |
63 | 232 |
|
64 | | -McpMux acts as a local gateway that: |
| 233 | +| Component | Technology | |
| 234 | +|-----------|-----------| |
| 235 | +| **Desktop shell** | Tauri 2.x | |
| 236 | +| **Backend** | Rust (Tokio, Axum, SQLite) | |
| 237 | +| **Frontend** | React 19, TypeScript 5.7, Tailwind CSS, Zustand | |
| 238 | +| **MCP SDK** | rmcp 0.14 | |
| 239 | +| **Encryption** | ring (AES-256-GCM) | |
| 240 | +| **Keychain** | keyring (cross-platform) | |
| 241 | +| **Build** | Cargo + Vite + pnpm workspaces | |
| 242 | +| **Testing** | cargo test, Vitest, Playwright, WebdriverIO | |
65 | 243 |
|
66 | | -1. **Aggregates** multiple MCP servers into a single endpoint |
67 | | -2. **Manages** credentials securely per space |
68 | | -3. **Routes** tool calls to the appropriate backend |
69 | | -4. **Syncs** configuration (not MCP traffic) to the cloud |
| 244 | +--- |
70 | 245 |
|
71 | | -``` |
72 | | -┌─────────────────────────────────────────────────────────┐ |
73 | | -│ AI Clients │ |
74 | | -│ (Cursor, Claude, etc.) │ |
75 | | -└─────────────────────┬───────────────────────────────────┘ |
76 | | - │ OAuth 2.1 + PKCE |
77 | | - ▼ |
78 | | -┌─────────────────────────────────────────────────────────┐ |
79 | | -│ McpMux Gateway │ |
80 | | -│ localhost:9315 │ |
81 | | -├─────────────────────────────────────────────────────────┤ |
82 | | -│ ┌─────────┐ ┌─────────┐ ┌─────────────┐ │ |
83 | | -│ │ Space A │ │ Space B │ │ FeatureSets │ │ |
84 | | -│ └─────────┘ └─────────┘ └─────────────┘ │ |
85 | | -└─────────────────────┬───────────────────────────────────┘ |
86 | | - │ |
87 | | - ┌─────────────┼─────────────┐ |
88 | | - ▼ ▼ ▼ |
89 | | - ┌─────────┐ ┌─────────┐ ┌─────────┐ |
90 | | - │ Backend │ │ Backend │ │ Backend │ |
91 | | - │ (stdio) │ │ (HTTP) │ │ (SSE) │ |
92 | | - └─────────┘ └─────────┘ └─────────┘ |
93 | | -``` |
| 246 | +## Configuration |
94 | 247 |
|
95 | | -## License |
| 248 | +### Gateway |
| 249 | + |
| 250 | +The gateway listens on `127.0.0.1:9315` by default. The port and host can be configured in the application settings. |
| 251 | + |
| 252 | +### Data Storage |
| 253 | + |
| 254 | +| Platform | Location | |
| 255 | +|----------|----------| |
| 256 | +| **Linux** | `~/.local/share/com.mcpmux.desktop/` | |
| 257 | +| **macOS** | `~/Library/Application Support/com.mcpmux.desktop/` | |
| 258 | +| **Windows** | `%LOCALAPPDATA%\com.mcpmux.desktop\` | |
| 259 | + |
| 260 | +The database (`mcpmux.db`) and per-server log files are stored in this directory. |
96 | 261 |
|
97 | | -[GNU General Public License v3.0](LICENSE) - Free software, copyleft license. |
| 262 | +--- |
| 263 | + |
| 264 | +## Contributing |
| 265 | + |
| 266 | +See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines, including the Developer Certificate of Origin (DCO) requirement. |
| 267 | + |
| 268 | +## License |
98 | 269 |
|
| 270 | +[GNU General Public License v3.0](LICENSE) |
0 commit comments