Listeners
You can use the built-in agentgateway UI or a configuration file to create, update, and delete listeners.
Create listeners
Set up a listener on your agentgateway.
-
Start your agentgateway.
agentgateway
-
Open the agentgateway listener UI.
-
Click Add Bind.
-
Enter a Port number such as
3000
and then click Add Bind. -
Expand the port that you just created and click Add Listener.
-
For your listener, configure the details.
- Name: If you omit this, a name is generated for you.
- Gateway Name: An optional field to group together listeners for ease of management, such as listeners for the same app or team.
- Target Bind: The port bind that you set up in the previous step.
- Protocol: The protocol that you want your listener to use, such as
HTTP
. - Hostname: The hostname that the listener binds to, which can include a wildcard
*
. To use an address that is compatible with IPv4 and IPv6, enter[::]
. - Click Add Listener to save your configuration.
-
Download a configuration file that contains your listener configuration.
curl -L https://raw.githubusercontent.com/agentgateway/agentgateway/refs/heads/main/examples/basic/config.yaml -o config.yaml
-
Review the configuration file. The example sets up an HTTP listener with the MCP protocol that listens for incoming traffic on port 3000.
cat config.yaml
binds: - port: 3000 listeners: - routes: - policies: cors: allowOrigins: - "*" allowHeaders: - mcp-protocol-version - content-type backends: - mcp: name: default targets: - name: everything stdio: cmd: npx args: ["@modelcontextprotocol/server-everything"]
-
Run the agentgateway.
agentgateway -f config.yaml
-
Open the agentgateway listener UI and verify that your listener is added successfully.
Delete listeners
Remove agentgateway listeners by using the UI or deleting the configuration file.
Remove agentgateway listeners with the UI.
-
Run the agentgateway from which you want to remove a listener.
agentgateway -f config.yaml
-
Open the agentgateway listener UI and find the listener that you want to remove.
-
Click the trash icon and then Delete to remove the listener.
Update the configuration file to remove the listener.
-
Remove the listener from your configuration file.
-
Apply the updated configuration file to your agentgateway.
agentgateway -f config.yaml