Docs
Documentation

Gateway

Configure the gateway

The gateway reads one validated AppConfig YAML file. How to scaffold it from a template, understand its top-level blocks, inject secrets safely, validate before boot, and reload without downtime.

Configuration sources

How the gateway assembles its config from files, remote URLs, and inline base64 — the MCPG_CONFIG env var and the repeatable --config flag, how layers merge, how secrets resolve, and what hot-reloads.

Protocol versions

MCPG negotiates two MCP revisions on one listener — the stateful 2025-11-25 release and the stateless 2026-07-28 revision. How version selection works, what changed between them, and why a single deployment serves both.

MCP federation

Make MCPG act as an MCP client to other MCP servers and re-serve their tools, resources, templates, and prompts under your own names, governance, and auth — one MCP endpoint that aggregates many upstreams.

Reverse tunnels

Expose a gateway that binds no public port — it dials out to an MCPG relay and is answered through its own full request path. Get a public MCP URL for dev preview, reach a gateway behind NAT, or federate a customer's gateway so their secrets never leave their infrastructure.

Templated MCP Apps

Turn any tool into an interactive UI from config alone. The gateway ships one reviewed HTML bundle per kind and mints ui://mcpg/<id> resources from a declarative binding — no HTML, no plugin, no build step.

SQL backend cookbook

Worked, copy-pasteable recipes for the SQL backend (backend.kind sql) — reads, writes, upserts, streaming, fire-and-wait jobs, watch feeds, transactions, multi-tenancy, reporting, and ops probes across Postgres, MySQL, and SQLite.

Migrating REST-wrapped DB tools to the SQL backend

Collapse a Flask/Express/FastAPI service that's a thin REST wrapper around a database into a direct MCPG SQL backend (backend.kind sql) — a before/after example, a step-by-step conversion, and what you gain and lose.