Skip to main content

YAML Configuration Schema

Golf Gateway supports YAML configuration for Distributed mode deployments, where server configurations are defined locally in a YAML file while organization policies and monitoring are managed through the Control Plane. This reference documents the complete YAML schema with all fields, types, and validation rules.

When to Use YAML Configuration

Use YAML configuration when you want to:
  • Version control your MCP server configurations alongside your infrastructure code
  • GitOps workflows where server definitions are managed through pull requests
  • Local server definitions while still benefiting from Control Plane’s centralized policy management and monitoring
YAML configuration works in Distributed mode only. For fully managed deployments without local configuration files, use Centralized mode where all settings are managed through the Golf Control Plane.

Quick Start Example

Here’s a complete, annotated configuration showing the most common settings:
golf-gateway.yaml
# ============================================================
# Golf Gateway Configuration - Distributed Mode
# ============================================================
# Schema version (required, must be "1.0")
version: "1.0"

# Distributed mode: servers from YAML, policies from Control Plane
mode: hybrid

# -------------------- Control Plane Connection ---------------
# Required for distributed mode - get these values from Control Plane
control_plane:
  url: https://control-plane.example.com
  api_key: ${GOLF_CP_API_KEY}
  gateway_id: 550e8400-e29b-41d4-a716-446655440000
  organization_id: 660e8400-e29b-41d4-a716-446655440001

# -------------------- Gateway Identity ----------------------
# Required: identifies this gateway instance
gateway:
  id: 550e8400-e29b-41d4-a716-446655440000  # UUID (generate or from Control Plane)
  name: production-gateway                    # Human-readable name
  description: "Main production MCP gateway"  # Optional

# -------------------- Identity Providers --------------------
# Configure OAuth/OIDC providers for authentication
identity_providers:
  - name: auth0                              # Unique name (referenced by servers)
    type: auth0                              # auth0, okta, microsoft-entra-id, descope
    issuer: https://myorg.auth0.com/
    jwks_uri: https://myorg.auth0.com/.well-known/jwks.json
    api_identifiers:
      - https://api.example.com              # Must match JWT audience
    # Management API credentials (optional, for group sync)
    client_id: ${AUTH0_MGMT_CLIENT_ID}       # Environment variable substitution
    client_secret: ${AUTH0_MGMT_CLIENT_SECRET}

# -------------------- MCP Servers ---------------------------
# Configure upstream MCP servers with RBAC
servers:
  - name: github-mcp                         # Unique server name
    url: http://github-mcp:3001              # Server URL
    description: "GitHub integration"
    server_type: third_party                 # third_party or inhouse
    enabled: true

    # RBAC: Control who can access this server
    rbac_enabled: true
    rbac_mode: allow                         # allow (whitelist) or deny (blacklist)
    allowed_groups:
      - engineering
      - devops

    # Link to identity provider for group resolution
    idp: auth0

    # Per-server security settings
    security:
      enabled: true
      sensitive_fields: [token, password]    # Additional fields to mask

  - name: internal-tools
    url: http://tools-mcp:3002
    server_type: inhouse
    rbac_enabled: false                      # No RBAC for internal tools

# -------------------- Rate Limiting -------------------------
rate_limiting:
  enabled: true
  requests_per_minute: 100                   # Per-user limit
  window_seconds: 60

# -------------------- Audit Log Export ----------------------
exporters:
  elasticsearch:
    - name: primary
      enabled: true
      url: ${ELASTICSEARCH_URL}              # Self-hosted URL
      api_key: ${ELASTICSEARCH_API_KEY}
      index_prefix: golf-gateway             # Creates: golf-gateway-YYYY.MM.DD
Use ${VAR} for required environment variables or ${VAR:default} for optional ones with defaults.
Scroll down for detailed documentation of each section.

File Location

The gateway searches for configuration files in this order:
  1. GOLF_CONFIG_FILE environment variable (explicit path)
  2. /etc/golf-gateway/config.yaml
  3. /etc/golf-gateway/config.yml
  4. ./golf-gateway.yaml (current directory)
  5. ./golf-gateway.yml (current directory)
# Explicit path
export GOLF_CONFIG_FILE=/path/to/config.yaml

Environment Variable Interpolation

YAML configuration supports environment variable substitution:
SyntaxBehavior
${VAR}Required - fails if VAR is not set
${VAR:default}Optional - uses default if VAR is not set
# Required variable (fails if not set)
api_key: ${GOLF_API_KEY}

# Optional with default
timeout: ${GOLF_TIMEOUT:30}

# In nested structures
servers:
  - name: github-mcp
    url: ${MCP_SERVER_URL:http://localhost:3001}

Root Configuration

version: "1.0"                    # Required, only "1.0" supported
mode: hybrid                      # Distributed mode for YAML configuration

control_plane:                    # Required - Control Plane connection
  url: https://control-plane.example.com
  api_key: ${GOLF_CP_API_KEY}
  gateway_id: 550e8400-e29b-41d4-a716-446655440000
  organization_id: 660e8400-e29b-41d4-a716-446655440001

gateway:                          # Required - gateway identity
  id: 550e8400-e29b-41d4-a716-446655440000
  name: production-gateway
  description: "Main production gateway"

# Optional sections
identity_providers: []
servers: []
gateway_policy: {}
global_security: {}
rate_limiting: {}
exporters: {}

Root Fields

FieldTypeRequiredDefaultDescription
versionstringYes-Schema version, must be "1.0"
modehybridYes-Must be hybrid for Distributed mode YAML configuration
control_planeobjectYes-Control Plane connection settings
gatewayobjectYes-Gateway identity
identity_providersarrayNo[]Identity provider configurations
serversarrayNo[]MCP server configurations
gateway_policyobjectNo{}Gateway-level policy defaults
global_securityobjectNo{}Global security settings
rate_limitingobjectNo{}Rate limiting configuration
exportersobjectNo{}Log export destinations

Gateway Identity

Required section that identifies the gateway instance.
gateway:
  id: 550e8400-e29b-41d4-a716-446655440000  # UUID
  name: production-gateway                    # 1-255 characters
  description: "Optional description"
FieldTypeRequiredDescription
idUUIDYesGateway UUID (from Control Plane or self-assigned)
namestringYesHuman-readable name (1-255 chars)
descriptionstringNoOptional description

Identity Providers

Configure OAuth/OIDC identity providers for authentication.
identity_providers:
  - name: auth0-primary
    type: auth0
    issuer: https://myorg.auth0.com/
    jwks_uri: https://myorg.auth0.com/.well-known/jwks.json
    api_identifiers:
      - https://api.example.com
    client_id: ${AUTH0_CLIENT_ID}
    client_secret: ${AUTH0_CLIENT_SECRET}

  - name: descope-corp
    type: descope
    project_id: ${DESCOPE_PROJECT_ID}
    management_key: ${DESCOPE_MANAGEMENT_KEY}
    # issuer and jwks_uri auto-generated for Descope

Identity Provider Fields

FieldTypeRequiredDescription
namestringYesUnique provider name (1-255 chars)
typeenumYesauth0, okta, microsoft-entra-id, descope
issuerstringConditionalOIDC issuer URL (auto-generated for Descope)
jwks_uristringConditionalJWKS endpoint URL (auto-generated for Descope)
userinfo_endpointstringNoUserinfo endpoint URL
api_identifiersarrayNoAPI audience identifiers
timeoutintNoRequest timeout in seconds (default: 10, range: 1-60)
client_idstringNoManagement API client ID (for group sync)
client_secretstringNoManagement API client secret

Descope-Specific Fields

FieldTypeRequiredDescription
project_idstringYes (Descope)Descope Project ID
management_keystringNoDescope Management Key for group sync
tenant_idstringNoTenant ID for tenant-scoped operations

Servers

Configure MCP upstream servers with RBAC and security settings.
servers:
  - name: github-mcp
    url: http://github-mcp:3001
    description: "GitHub integration server"
    server_type: third_party
    enabled: true

    # RBAC
    rbac_enabled: true
    rbac_mode: allow
    allowed_groups:
      - engineering
      - devops

    # Capability RBAC
    capability_rbac_enabled: true
    capability_overrides:
      - capability: "tools/delete_repo"
        rbac_enabled: true
        rbac_mode: allow
        allowed_groups: [repo-admins]

    # Per-server security
    security:
      enabled: true
      sensitive_fields: [password, token]

    # Identity provider reference
    idp: auth0-primary

Server Schema

servers
array
List of upstream MCP server configurations.

Gateway Policy

Gateway-level policy defaults that apply to all servers unless overridden.
gateway_policy:
  scrubbing:
    enabled: true
    sensitive_fields:
      - password
      - api_key

  server_rbac:
    rbac_enabled: true
    rbac_mode: allow
    allowed_groups: [gateway-users]
    denied_groups: []
    capability_rbac_enabled: false

  capability_rbac:
    read_only:
      default_groups: [all-users]
    destructive:
      default_groups: [power-users]
    unspecified:
      default_groups: [all-users]

Scrubbing Policy

FieldTypeDefaultDescription
enabledbooltrueEnable PII scrubbing globally
sensitive_fieldsarray[]Additional sensitive field names

Server RBAC Policy

FieldTypeDefaultDescription
rbac_enabledboolfalseDefault RBAC enabled for new servers
rbac_modeenumallowDefault RBAC mode
allowed_groupsarray[]Default allowed groups
denied_groupsarray[]Default denied groups
capability_rbac_enabledboolfalseDefault capability RBAC enabled

Capability RBAC Policy

FieldTypeDescription
read_only.default_groupsarrayDefault groups for read-only tools
destructive.default_groupsarrayDefault groups for destructive tools
unspecified.default_groupsarrayDefault groups for unclassified tools

Global Security

Global security settings for data scrubbing and PII protection.
global_security:
  data_scrubbing:
    enabled: true
    sensitive_fields: [password, api_key, secret]

Data Scrubbing Fields

FieldTypeDefaultDescription
enabledbooltrueEnable PII scrubbing in audit logs
sensitive_fieldsarray[]Additional field names to mask

Rate Limiting

rate_limiting:
  enabled: true
  requests_per_minute: 50
  window_seconds: 60
FieldTypeDefaultRangeDescription
enabledbooltrue-Enable rate limiting
requests_per_minuteint201-1000Requests per minute per user
window_secondsint6010-300Rate limit window

Exporters

Configure multiple export destinations for audit logs. You can configure multiple exporters of each type.
exporters:
  elasticsearch:
    - name: primary-es
      enabled: true
      url: ${ELASTICSEARCH_URL}
      api_key: ${ELASTICSEARCH_API_KEY}
      index_prefix: golf-gateway
      timeout: 30

  otel:
    - name: primary-otel
      enabled: true
      endpoint: ${OTEL_ENDPOINT}
      protocol: grpc
      service_name: golf-gateway
      export_logs: true

  sentinel:
    - name: azure-sentinel
      enabled: true
      dcr_immutable_id: ${SENTINEL_DCR_ID}
      dcr_endpoint: ${SENTINEL_DCR_ENDPOINT}
      tenant_id: ${AZURE_TENANT_ID}
      client_id: ${AZURE_CLIENT_ID}
      client_secret: ${AZURE_CLIENT_SECRET}

Exporter Schema

exporters
object
Configure audit log export destinations.
For Elasticsearch, use either url (self-hosted) or cloud_id (Elastic Cloud), not both.

Control Plane Connection

Required section that connects the gateway to the Control Plane for centralized policy management and monitoring.
mode: hybrid

control_plane:
  url: https://control-plane.example.com
  api_key: ${GOLF_CP_API_KEY}
  gateway_id: 550e8400-e29b-41d4-a716-446655440000
  organization_id: 660e8400-e29b-41d4-a716-446655440001
  timeout: 30
  cache_ttl: 300
FieldTypeRequiredDefaultDescription
urlstringYes-Control Plane URL
api_keystringYes-API key for authentication
gateway_idUUIDYes-Gateway UUID
organization_idUUIDYes-Organization UUID
timeoutintNo30Request timeout (5-120 seconds)
cache_ttlintNo300Policy cache TTL in seconds (60-3600)

Complete Example

A complete Distributed mode configuration with Control Plane connection, identity providers, servers, and exporters:
version: "1.0"
mode: hybrid

# Control Plane connection (required)
control_plane:
  url: https://control-plane.example.com
  api_key: ${GOLF_CP_API_KEY}
  gateway_id: 550e8400-e29b-41d4-a716-446655440000
  organization_id: 660e8400-e29b-41d4-a716-446655440001

# Gateway identity
gateway:
  id: 550e8400-e29b-41d4-a716-446655440000
  name: production-gateway
  description: "Main production gateway"

# Identity providers for authentication
identity_providers:
  - name: auth0
    type: auth0
    issuer: https://myorg.auth0.com/
    jwks_uri: https://myorg.auth0.com/.well-known/jwks.json
    api_identifiers:
      - https://api.example.com
    client_id: ${AUTH0_MGMT_CLIENT_ID}
    client_secret: ${AUTH0_MGMT_CLIENT_SECRET}

# MCP servers (YAML is source of truth for servers in distributed mode)
servers:
  - name: github-mcp
    url: http://github-mcp:3001
    server_type: third_party
    rbac_enabled: true
    allowed_groups: [engineering]
    idp: auth0
    security:
      enabled: true
      sensitive_fields: [token]

  - name: internal-tools
    url: http://tools-mcp:3002
    server_type: inhouse
    rbac_enabled: false

# Local policy (merged with org policy from Control Plane)
gateway_policy:
  scrubbing:
    enabled: true
    sensitive_fields: [ssn, account_number]
  server_rbac:
    rbac_enabled: true
    allowed_groups: [gateway-users]

# Rate limiting
rate_limiting:
  enabled: true
  requests_per_minute: 100

# Audit log exporters
exporters:
  elasticsearch:
    - name: primary
      url: ${ELASTICSEARCH_URL}
      api_key: ${ELASTICSEARCH_API_KEY}

Validation Rules

Version

  • Must be exactly "1.0"
  • Required field

Gateway Identity

  • id must be a valid UUID
  • name must be 1-255 characters

Identity Providers

  • Names must be unique across all providers
  • For non-Descope providers: issuer and jwks_uri are required
  • For Descope: project_id is required; issuer and jwks_uri are auto-generated

Servers

  • Names must be unique across all servers
  • idp references must match an existing identity provider name
  • url must be a valid URL

Exporters

  • Names must be unique within each exporter type
  • Elasticsearch: use url OR cloud_id, not both
  • OTEL: endpoint required when enabled
  • Sentinel: all DCR and auth fields required when enabled

Control Plane

  • control_plane section is required
  • All Control Plane fields (url, api_key, gateway_id, organization_id) are required
  • mode must be set to hybrid for Distributed mode

Configuration Validation CLI

Validate configuration files before deployment:
# The gateway validates config on startup
GOLF_CONFIG_FILE=/path/to/config.yaml python -m golf_gateway.main --validate

# Check for undefined environment variables
GOLF_CONFIG_FILE=/path/to/config.yaml python -c "
from golf_gateway.config.yaml_loader import validate_yaml_config
errors = validate_yaml_config('/path/to/config.yaml')
for error in errors:
    print(error)
"