Reference
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

The ecosystem at a glance

InvocationBinaryWhat it isAudience
mcpgmcpgThe gateway server and the front-door dispatcherEveryone
mcpg cp <sub>mcpg-cpThe control plane: serve / enroll / statusSelf-hosters, platform
mcpg cloud <sub>mcpg-cloudmcpg.cloud tenant CLITenants
mcpg admin <sub>mcpg-adminmcpg.cloud platform-operator CLIPlatform operators
mcpg config <sub>mcpg-configAuthor / validate / inspect the gateway configConfig authors
mcpg plugin <sub>mcpg-pluginPlugin artifact tool — pack / sign / push / pull / testPlugin authors
mcpg status(in-process)This box: gateway, agent pairing, local CPEveryone
mcpg-operator + crdgenKubernetes operator + CRD-YAML generatorK8s operators
mcpg-cloud-{federation,marketplace,provisioner}Managed-cloud backend servicesPlatform (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

VariableUsed byMeaning
MCPG_CONFIGmcpgConfig file path or :/;-joined overlay list
MCPG_* (__-nested)mcpgPer-field config overrides (foreign family vars below are filtered out)
MCPG_STATE_DIRall CLIs + mcpgState/credentials/pairing dir (default ~/.mcpg)
MCPG_ENROLLMENT_URLmcpg (cp-attached)Enrollment URL (flag twin: --enroll)
MCPG_CP_URLmcpg cloud/admin/cp statusCP HTTP base URL
MCPG_CP_* (or MCPG_CONTROL_PLANE_*)mcpg cp serveAll CP server options
MCPG_ORG / MCPG_WORKSPACE / MCPG_ENVmcpg cloudCoordinate defaults (between flags and the use context)
MCPG_FED_ISSUERcloud login / admin loginOIDC issuer
MCPG_FED_URL, MCPG_FED_ADMIN_TOKENmcpg admin orgFederation admin API
MCPG_PLUGIN_DIRmcpg plugin listDefault plugin directory
MCPG_OPERATOR_*operatorAll operator options
RUST_LOGallLog filter

Port quick reference

ServiceDefaultProtocol
Gateway (mcpg, http)127.0.0.1:8787HTTP / SSE (MCP)
Control plane HTTP (mcpg cp serve)127.0.0.1:7843REST /v1 + console
Control plane gRPC127.0.0.1:7844Agent contract
Operator admission webhook0.0.0.0:9443HTTPS
Operator metrics + health0.0.0.0:8443HTTPS
Cloud federation / marketplace / provisioner:8443 / :8444 / :7100HTTP / HTTP / gRPC