Listeners
You can use the built-in Agent Gateway UI, a configuration file, or the admin API to create, update, and delete listeners.
Create listeners
Set up an SSE listener on your Agent Gateway.
-
Start your Agent Gateway.
agentgateway
-
Open the Agent Gateway listener UI.
-
Click Add Listener.
-
Enter a Name for your listener, select a protocol, and configure the Address and Port that you want your listener to be exposed on. To use an address that is compatible with IPv4 and IPv6, enter
[::]
. -
Click Add Listener to save your configuration.
-
Create a JSON file that contains your listener configuration. The following example sets up an SSE listener with the MCP protocol that listens for incoming traffic on port 3000.
cat <<EOF > ./config.json { "type": "static", "listeners": [ { "name": "sse", "protocol": "MCP", "sse": { "address": "[::]", "port": 3000 } } ] } EOF
-
Run the Agent Gateway.
agentgateway -f config.json
-
Open the Agent Gateway listener UI and verify that your listener is added successfully.
Use the Agent Gateway admin API to configure an SSE listener on your Agent Gateway.
-
Start your Agent Gateway. The Agent Gateway automatically exposes its admin API on port 19000.
agentgateway
-
Create an SSE listener by using the
/listeners
endpoint. In the following example, the listener is configured with the MCP protocol and exposed on port 3000.curl -X POST -H content-type:application/json http://localhost:19000/listeners -d '{"name":"sse","protocol":"MCP","sse":{"address":"[::]","port":3000,"rbac":[]}}'
-
Verify that the listener is created.
curl http://localhost:19000/listeners
Example output:
[{"name":"sse","protocol":"MCP","sse":{"address":"[::]","port":3000,"rbac":[]}}]
Delete listeners
Remove Agent Gateway listeners by using the UI or admin API.
Remove Agent Gateway listeners with the UI.
-
Run the Agent Gateway from which you want to remove a listener.
agentgateway -f config.json
-
Open the Agent Gateway listener UI and find the listener that you want to remove.
-
Click the trash icon to remove the listener and confirm the deletion.
Update the configuration file to remove the listener.
-
Remove the listener from your configuration file.
-
Apply the updated configuration file to your Agent Gateway.
agentgateway -f config.json
Use the Agent Gateway admin API to delete listeners from your Agent Gateway.
-
Run the Agent Gateway from which you want to remove a listener.
agentgateway -f config.json
-
List the listeners that are currently configured on your Agent Gateway and note the name of the listener that you want to delete. In the following example, the listener is named
sse
.curl http://localhost:19000/listeners
Example output:
[{"name":"sse","protocol":"MCP","sse":{"address":"[::]","port":3000,"rbac":[]}}]
-
Delete the listener. The following example shows how to delete the
sse
listener.curl -X DELETE http://localhost:19000/listeners/sse
-
Verify that the listener is removed.
curl http://localhost:19000/listeners
Example output:
[]