CLI Reference
MCPlexer provides a single binary with subcommands for running the gateway, managing configuration, and operating the daemon.
serve
Start the MCP gateway. This is the primary command — it launches MCPlexer and begins accepting client connections.
| Name | Type | Default | Description |
|---|---|---|---|
--mode | string | stdio | Transport mode: stdio, http, or socket. |
--addr | string | 127.0.0.1:8080 | Listen address for HTTP mode. |
--socket | string | — | Unix socket path for socket mode. |
connect
Bridge stdin/stdout to a running MCPlexer daemon socket. This allows MCP clients that only support stdio to connect to a daemon-mode MCPlexer instance.
| Name | Type | Default | Description |
|---|---|---|---|
--socket | string | — | Path to the Unix socket. Can also be set via MCPLEXER_SOCKET_PATH. |
Environment variables
connect also reads MCPLEXER_CLIENT_CWD to pass the client's working directory to the daemon for workspace resolution.
init
Create the SQLite database and a default YAML configuration file. Run this once when first setting up MCPlexer.
setup
Run the one-step setup: starts the daemon, writes the Claude Desktop config, and opens the dashboard.
status
Print a summary of the current MCPlexer state — workspace count, server count, active processes, and sessions.
dry-run
Simulate route resolution for a tool call without actually executing it. Useful for verifying that your routing configuration is correct.
secret
Manage encrypted secrets stored with age encryption. Requires the MCPLEXER_AGE_KEY environment variable pointing to your age key file.
Age key required
All secret commands require MCPLEXER_AGE_KEY to be set. Generate a key with age-keygen -o key.txt.
secret put
Store a secret value for an auth scope.
secret get
Retrieve a decrypted secret value.
secret list
List all secret keys for an auth scope (values are not shown).
secret delete
Remove a secret from an auth scope.
daemon
Manage the MCPlexer background daemon. The daemon runs MCPlexer as a persistent process listening on a Unix socket.
daemon start
Start the daemon in the background.
daemon stop
Stop a running daemon.
daemon status
Check whether the daemon is running.
daemon logs
View daemon log output.
control-server
Run a read-only MCP control server over stdio. This exposes MCPlexer's internal state (workspaces, routes, servers, audit logs) as MCP tools that an AI client can query.
Set MCPLEXER_CONTROL_READONLY=true to enforce read-only mode.
| Name | Type | Default | Description |
|---|---|---|---|
MCPLEXER_CONTROL_READONLY | env var | true | When true, the control server only exposes read operations. |