Reference
CLI reference
Every MCPG command-line tool — the gateway (mcpg) with its composition flags, the control plane (mcpg cp), the tenant + platform CLIs (mcpg cloud / mcpg admin), config tooling, plugin artifacts, and how they fit together.
MCPG Command-Line Tools
One front door — mcpg, the gateway — and one binary per persona
behind it. The rule that makes the family coherent: flags shape the
gateway; subcommands run or operate everything else.
Reference pages
mcpg— the gateway — run it,MCPG_CONFIG, the composition flags (--enroll,--no-cp,--control-plane/--cp),mcpg status,devmode,--stdio.mcpg cp— the control plane —serve [--dev],enroll new,status.mcpg cloud— the tenant CLI — login, publish, instances/operations/logs, versions/diff/rollback, domains,use.mcpg admin— the platform-operator CLI — cluster fleet (CP) + tenant org seeding (federation).mcpg config— config tooling — init / check / doc / explain / schema / secrets / wiring (one binary).mcpg plugin— plugin artifacts — pack / sign / push / pull / test / cache gc (binary:mcpg-plugin).mcpg-operator&crdgen— the Kubernetes operator + CRD generator.- control-plane server & cloud backend —
mcpg-cp servein production + themcpg-cloud-*backend services.
The ecosystem at a glance
| Invocation | Binary | What it is | Audience |
|---|---|---|---|
mcpg | mcpg | The gateway server and the front-door dispatcher | Everyone |
mcpg cp <sub> | mcpg-cp | The control plane: serve / enroll / status | Self-hosters, platform |
mcpg cloud <sub> | mcpg-cloud | mcpg.cloud tenant CLI | Tenants |
mcpg admin <sub> | mcpg-admin | mcpg.cloud platform-operator CLI | Platform operators |
mcpg config <sub> | mcpg-config | Author / validate / inspect the gateway config | Config authors |
mcpg plugin <sub> | mcpg-plugin | Plugin artifact tool — pack / sign / push / pull / test | Plugin authors |
mcpg status | (in-process) | This box: gateway, agent pairing, local CP | Everyone |
| — | mcpg-operator + crdgen | Kubernetes operator + CRD-YAML generator | K8s operators |
| — | mcpg-cloud-{federation,marketplace,provisioner} | Managed-cloud backend services | Platform (not self-host) |
mcpg <word> execs the sibling mcpg-<word> binary (PATH, or next to
mcpg for tarball installs), inheriting env + stdio.
How they work together
One command, everything local
bash
mcpg --cp # gateway + embedded control plane, auto-enrolled over loopback
# console: http://127.0.0.1:7843 gateway: 127.0.0.1:8787
mcpg status # see all of it
Self-host with a standalone control plane
bash
mcpg cp serve --dev # terminal 1: the CP + console
mcpg cp enroll new # mint an enrollment URL
mcpg --enroll "<URL>" # terminal 2: gateway attaches + enrolls
# The pairing is sticky: from now on plain `mcpg` re-attaches.
# One-off detached run: mcpg --no-cp
Author and run a plugin locally
bash
mcpg plugin new --kind tool_gate --name rate-limit
cd mcpg-plugin-tool-gate-rate-limit && cargo build --release
mcpg dev --plugin target/release/libmcpg_plugin_tool_gate_rate_limit.so
mcpg plugin pack -d plugin.yaml -a target/release/lib….so -v 0.1.0 -o rl.zip
mcpg plugin push rl.zip ghcr.io/acme/plugins/rate-limit:0.1.0 -u me -p env:GHCR_TOKEN
Self-host the gateway with config tooling
bash
mcpg config init --template production-single-redis --output config.yaml
mcpg config check config.yaml # validate before boot
mcpg config secrets config.yaml # review which secrets it resolves
mcpg config wiring config.yaml # confirm each slot wires correctly
MCPG_CONFIG=config.yaml mcpg # run it
mcpg.cloud (managed)
bash
mcpg cloud login --issuer https://auth.mcpg.dev
mcpg cloud use --org acme --workspace prod --env eu
mcpg cloud publish edge --config gw.yaml
mcpg cloud logs edge --follow
Kubernetes (operator-managed)
bash
cargo run -p mcpg-operator --bin crdgen -- --split-by-kind helm/charts/mcpg-operator/crds/
# The operator reconciles MCPGGateway (spec.config IS the AppConfig) into a Deployment.
(See the IaC guides for Terraform/Pulumi.)
Environment-variable quick reference
| Variable | Used by | Meaning |
|---|---|---|
MCPG_CONFIG | mcpg | Config file path or :/;-joined overlay list |
MCPG_* (__-nested) | mcpg | Per-field config overrides (foreign family vars below are filtered out) |
MCPG_STATE_DIR | all CLIs + mcpg | State/credentials/pairing dir (default ~/.mcpg) |
MCPG_ENROLLMENT_URL | mcpg (cp-attached) | Enrollment URL (flag twin: --enroll) |
MCPG_CP_URL | mcpg cloud/admin/cp status | CP HTTP base URL |
MCPG_CP_* (or MCPG_CONTROL_PLANE_*) | mcpg cp serve | All CP server options |
MCPG_ORG / MCPG_WORKSPACE / MCPG_ENV | mcpg cloud | Coordinate defaults (between flags and the use context) |
MCPG_FED_ISSUER | cloud login / admin login | OIDC issuer |
MCPG_FED_URL, MCPG_FED_ADMIN_TOKEN | mcpg admin org | Federation admin API |
MCPG_PLUGIN_DIR | mcpg plugin list | Default plugin directory |
MCPG_OPERATOR_* | operator | All operator options |
RUST_LOG | all | Log filter |
Port quick reference
| Service | Default | Protocol |
|---|---|---|
Gateway (mcpg, http) | 127.0.0.1:8787 | HTTP / SSE (MCP) |
Control plane HTTP (mcpg cp serve) | 127.0.0.1:7843 | REST /v1 + console |
| Control plane gRPC | 127.0.0.1:7844 | Agent contract |
| Operator admission webhook | 0.0.0.0:9443 | HTTPS |
| Operator metrics + health | 0.0.0.0:8443 | HTTPS |
| Cloud federation / marketplace / provisioner | :8443 / :8444 / :7100 | HTTP / HTTP / gRPC |