Skip to main content
The cors policy handles CORS preflight requests and appends configured CORS headers to applicable responses. This is required when MCP clients running in browsers (such as web-based AI agents) need to call Agentgateway from a different origin. cors is configured under binds[].listeners[].routes[].policies:

Fields

object
CORS policy configuration.

Examples

Suitable for development or public MCP endpoints:
Suitable for production when specific origins are known:
This is the exact CORS configuration from the MCP authentication example:
Agentgateway automatically handles CORS preflight (OPTIONS) requests and appends the configured headers to all applicable responses. You do not need to configure a separate route for OPTIONS requests.