52 lines
1.6 KiB
YAML

# yaml-language-server: $schema=https://agentgateway.dev/schema/config
config:
tracing:
otlpEndpoint: http://localhost:4317
randomSampling: true
binds:
- port: 3000
listeners:
- routes:
- policies:
remoteRateLimit:
domain: "agentgateway"
host: "127.0.0.1:8081"
# failureMode controls behavior when the rate limit service is unavailable.
# "failOpen" (default): allow requests through on service failure.
# "failClosed": deny requests with 500 on service failure.
failureMode: failOpen
descriptors:
- entries:
- key: "user"
value: '"test-user"'
- key: "tool"
value: '"echo"'
type: "requests"
cors:
allowOrigins:
- "*"
allowHeaders:
- "*"
exposeHeaders:
- "Mcp-Session-Id"
jwtAuth:
issuer: agentgateway.dev
audiences: [test.agentgateway.dev]
jwks:
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: everything
stdio:
cmd: npx
args: ["@modelcontextprotocol/server-everything"]