Local configuration defines the full runtime behavior of the gateway: which ports to listen on, how to route traffic, which backends to proxy to, and what policies to apply. It lives in the same YAML or JSON file as static configuration, alongside or below theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/agentgateway/agentgateway/llms.txt
Use this file to discover all available pages before exploring further.
config key.
The gateway watches the config file for changes. When you save an update, it reloads local configuration automatically — no restart required.
File structure
A complete config file has two top-level sections:config— static global settings (optional; see static config)binds— array of port bindings with listeners, routes, and backends
YAML vs JSON
Both formats are supported. Use YAML for human-authored configs — it supports comments and is less verbose. Use JSON when generating configs programmatically.Top-level structure
Array of port bindings. Each bind defines a port and the listeners attached to it.
Binds and listeners
A bind opens a TCP port. Each bind can have one or more listeners that match traffic by hostname and protocol. Each listener defines a set of routes that map requests to backends.Listener fields
Optional name for the listener. Used for identification in logs and metrics.
Namespace for the listener resource. Used in multi-tenant and Kubernetes deployments.
Hostname this listener matches. Supports wildcards, for example
*.example.com. When not set, the listener matches all hostnames on the port.Protocol for this listener. Accepted values:
HTTP, HTTPS. When using HTTPS, provide a tls block.TLS configuration. Required when
protocol is HTTPS.Array of routes for this listener. Routes are evaluated in order; the first match wins.See Routes reference →
Routes
A route matches incoming requests and forwards them to one or more backends. Routes support matching on path, headers, method, and query parameters.Backends
Backends define where traffic is sent. The local config supports several backend types:MCP backend
MCP backend
Routes traffic to one or more MCP servers. Each server is defined as a target with a name and transport (stdio or SSE).
HTTP / host backend
HTTP / host backend
Route to a plain HTTP upstream using a
host shorthand. The gateway resolves this into a full backend definition.A2A backend
A2A backend
Route A2A agent traffic. Mark the route with
a2a: {} to enable A2A processing and telemetry.Hot reload behavior
Agentgateway uses filesystem watching to detect config file changes. When the file is saved:- The new configuration is parsed and validated.
- If validation passes, the runtime configuration is updated atomically.
- Existing in-flight requests complete against the old configuration.
- New requests use the updated configuration immediately.
Static configuration fields (under
config) are not reloaded on file change. Only binds, listeners, routes, backends, and policies are hot-reloaded.Complete examples
- MCP proxy
- A2A proxy
- TLS termination
- Multi-backend
A minimal MCP proxy with CORS enabled for browser-based clients:
Mapping to internal representation
Local configuration translates into an internal representation (IR) shared with XDS. Most fields map directly, but some are transformed for ergonomics:| Local config field | IR behavior |
|---|---|
host: localhost:9999 | Expanded into a full backend definition with hostname and port |
mcp.targets[].sse.host | Resolved to a backend + TLS configuration based on the URL scheme |
tls.cert / tls.key | File paths are read at load time and stored as PEM bytes in the IR |
Route policies | Merged and applied at runtime; precedence handled by the proxy, not the control plane |