36 lines
1.1 KiB
YAML

# yaml-language-server: $schema=https://agentgateway.dev/schema/config
binds:
- port: 3000
listeners:
- routes:
- policies:
cors:
allowOrigins:
- "*"
allowHeaders:
- "*"
exposeHeaders:
- "Mcp-Session-Id"
backendAuth:
passthrough: {}
jwtAuth:
issuer: agentgateway.dev
audiences: [test.agentgateway.dev]
jwks:
# Relative to the folder the binary runs from, not the config file
file: ./manifests/jwt/pub-key
mcpAuthorization:
rules:
# Allow anyone to call 'echo'
- 'mcp.tool.name == "echo"'
# Only the test-user can call 'add'
- 'jwt.sub == "test-user" && mcp.tool.name == "add"'
# Any authenticated user with the claim `nested.key == value` can access 'printEnv'
- 'mcp.tool.name == "printEnv" && jwt.nested.key == "value"'
backends:
- mcp:
targets:
- name: mcp2
mcp:
host: http://localhost:3001/mcp