This guide requires
npx (Node.js 18+) to run the example MCP server. If you prefer Docker, see the alternative command in step 3.Prerequisites
- Rust 1.86+ and
cargo— for building from source npm10+ — to run the example MCP server vianpx- Basic familiarity with YAML configuration files
Run the basic MCP proxy
Install Agentgateway
Build and install Agentgateway from source. First, build the UI, then compile the binary.The compiled binary is placed at
./target/release/agentgateway.Create your config file
Create a This configuration:
config.yaml file in your working directory. The following config is taken directly from the basic example:config.yaml
- Binds the gateway to port 3000
- Defines a single listener with one route that accepts all traffic
- Applies a CORS policy allowing browser-based MCP clients
- Proxies traffic to the
everythingMCP server, launched vianpx
If you do not have
npx available, you can run the server with Docker instead:Run Agentgateway
Start the gateway, pointing it at your config file:When the gateway starts, it will launch the
everything MCP server as a child process over stdio. The gateway is now listening on http://localhost:3000.You can also open the admin UI at http://localhost:15000/ui to inspect your running configuration.Connect with MCP Inspector
Use the MCP Inspector to verify your gateway is working:The inspector will print the local URL it’s running on. Open it in your browser, then configure the connection:
Once connected, navigate to the Tools tab in the inspector to see the tools exposed by the
| Setting | Value |
|---|---|
| Transport | SSE or Streamable HTTP |
| URL | http://localhost:3000/sse or http://localhost:3000/mcp |
Agentgateway exposes two MCP transport endpoints:
- SSE at
/sse— Server-Sent Events transport (MCP spec §transport) - Streamable HTTP at
/mcp— newer bidirectional HTTP transport
everything server. Try calling everything:echo — the gateway will proxy the request and return the response.Understanding the configuration
The basic config introduces the four core building blocks of every Agentgateway configuration:Binds
Each bind defines a port the gateway listens on. You can have multiple binds for different ports or protocols.
Listeners
Listeners group routes within a bind. They can represent different virtual hosts, protocols, or tenant namespaces.
Routes
Routes match incoming traffic and apply policies — such as CORS, authentication, or rate limiting — before forwarding to a backend.
Backends
Backends define where traffic is sent. An MCP backend can aggregate multiple upstream MCP servers into a single endpoint.
Next steps
Installation
Install via pre-built binary, Docker, or build from source with all options.
MCP Proxy Guide
Add authentication, authorization, and observability to your MCP proxy.
Configuration reference
Explore the full configuration schema for binds, listeners, routes, and backends.
A2A Proxy Guide
Connect AI agents to each other using the Agent2Agent protocol.