MCPG
Reference
Reference

CLI reference

Every MCPG command-line tool — the gateway (mcpg), plugin artifacts (mcpg-plugins), the config tooling, the control-plane CLI (mcpg-ctl), the control-plane server, and the Kubernetes operator — and how they fit together.

MCPG ships a small family of command-line tools. One is the hub — mcpg, the gateway — and the rest are focused binaries that produce, validate, or manage what the gateway runs, or operate the control plane around it.

The crates are publish = false, so there is no cargo install mcpg from crates.io: build the binaries from the workspace, or pull the release container images. Two planes stay deliberately separate — the data plane (the gateway, its config, its plugins) and the control plane (the CP server, mcpg-ctl, and the operator).

Reference pages

The ecosystem at a glance

BinaryWhat it isPlane
mcpgThe gateway server and the front-door CLI (mcpg plugin …, mcpg dev …)Data
mcpg-pluginsPlugin artifact tool — scaffold / hash / sign / pack / push / pull / test plugin filesData (build/release)
mcpg-config-* (7 binaries)Author, validate, and inspect the gateway config (AppConfig)Data (config)
mcpg-ctlControl-plane CLI — run the CP, enrol gateways, provision Cloud, admin clustersControl
mcpg-control-plane-serverThe control-plane REST + gRPC server mcpg-ctl and gateways talk toControl
mcpg-operator + crdgenKubernetes operator that reconciles the eight mcpg.dev CRDs; CRD-YAML generatorControl (K8s)

How they connect

The config tooling authors and validates an AppConfig (YAML). The gateway loads it from MCPG_CONFIG (standalone) or from MCPGGateway.spec.config (on Kubernetes, set by the operator). mcpg plugin <cmd> execs the mcpg-plugins binary to package and publish plugins to an OCI registry; the gateway then loads them by path or OCI reference. On the control plane, mcpg-ctl and gateway agents talk to mcpg-control-plane-server over REST /v1 and gRPC.

Common workflows

Author and run a plugin locally

bash
mcpg plugin new --kind tool_gate --name rate-limit          # scaffold a crate
cd mcpg-plugin-tool-gate-rate-limit && cargo build --release
mcpg dev --plugin target/release/libmcpg_plugin_tool_gate_rate_limit.so   # load into a live gateway
# Package + publish when ready:
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

bash
mcpg-config-init --template production-single-redis --output config.yaml
# edit config.yaml (add capabilities/bindings, plugins referencing ghcr.io/…)
mcpg-config-check   config.yaml          # validate before boot
mcpg-config-secrets config.yaml          # review which secrets it will resolve
mcpg-config-wiring  config.yaml          # confirm each slot resolves to the right kind
MCPG_CONFIG=config.yaml mcpg             # run it

Control plane + gateway enrolment

bash
mcpg-ctl quickstart                      # run the CP locally (or mcpg-control-plane-server in prod)
# In the UI/API, create an enrolment URL, then:
mcpg-ctl gateway --enrollment-url "http://127.0.0.1:7843/enroll/<token>"
mcpg-ctl status && mcpg-ctl gateway-status

Environment-variable quick reference

VariableUsed byMeaning
MCPG_CONFIGmcpgConfig file path, or a path-separator-joined overlay list
MCPG_* (__-nested)mcpgPer-field config overrides (e.g. MCPG_GATEWAY__SERVER__BIND_ADDRESS)
MCPG_PLUGIN_DIRmcpg-plugins listDefault plugin directory
MCPG_STATE_DIRmcpg-ctlState / DB / credentials directory (default ~/.mcpg)
MCPG_CP_URLmcpg-ctlCP HTTP base URL (default http://127.0.0.1:7843)
MCPG_SESSION_COOKIEmcpg-ctl provision / clustermcpg_sid session cookie value
MCPG_ENROLLMENT_URLmcpg-ctl gatewayFirst-run gateway enrolment URL
MCPG_FED_ISSUERmcpg-ctl loginOIDC issuer
MCPG_CP_* (or MCPG_CONTROL_PLANE_*)CP serverAll CP server options (short form wins)
MCPG_OPERATOR_*operatorAll operator options
RUST_LOGallLog filter

Port quick reference

ServiceDefaultProtocol
Gateway (mcpg, HTTP)127.0.0.1:8787HTTP / SSE (MCP)
Control plane HTTP127.0.0.1:7843REST /v1 + UI
Control plane gRPC127.0.0.1:7844Agent contract
Operator admission webhook0.0.0.0:9443HTTPS
Operator metrics + health (/metrics, /healthz, /readyz)0.0.0.0:8443HTTPS

For the full configuration surface the gateway accepts, see the configuration reference.