Configuration Reference

Both binaries are configured via YAML config files. Pass the config file path with the --config flag:

mitrity-gateway --config /etc/mitrity/mitrity-gateway.yaml
mitrity-mcp-sidecar --config /path/to/mitrity-mcp-sidecar.yaml

This reference covers all configuration fields for both binaries.

Mitrity Gateway Fields

Mitrity Gateway is configured via mitrity-gateway.yaml.

Core

FieldTypeRequiredDefaultDescription
gateway_idstringYes--Unique identifier for this gateway instance. Shown in audit logs and the dashboard
api_keystringYes--API key from the MITRITY dashboard (Settings > API Keys)
control_plane.base_urlstringYes--URL of the MITRITY control plane (https://api.mitrity.com)

Upstreams

Define the MCP servers that the gateway aggregates tools from.

FieldTypeRequiredDefaultDescription
upstreams[]listYes--List of upstream MCP server definitions
upstreams[].namestringYes--Human-readable name for this upstream (e.g., filesystem, database)
upstreams[].commandstringYes--Path to the upstream MCP server binary
upstreams[].argslist of stringsNo[]Arguments to pass to the upstream MCP server command
upstreams[].envmapNo{}Environment variables to set for the upstream process
upstreams:
  - name: "filesystem"
    command: "/usr/local/bin/mcp-filesystem"
    args: ["--root", "/data"]
  - name: "database"
    command: "/usr/local/bin/mcp-postgres"
    args: ["--connection-string", "postgres://..."]

Native Tools

Define HTTP API endpoints as tools alongside MCP upstreams.

FieldTypeRequiredDefaultDescription
native_tools[]listNo[]List of native HTTP API tool definitions
native_tools[].namestringYes--Tool name exposed to agents
native_tools[].descriptionstringNo--Human-readable description of the tool
native_tools[].methodstringYes--HTTP method (GET, POST, PUT, DELETE)
native_tools[].urlstringYes--Target URL for the HTTP request
native_tools[].headersmapNo{}Static headers to include with every request
native_tools:
  - name: "get_weather"
    description: "Get current weather for a location"
    method: "GET"
    url: "https://api.weather.example.com/current"
    headers:
      Authorization: "Bearer ${WEATHER_API_KEY}"

Credentials

Credential definitions for upstream authentication. Credentials are held by the gateway and never shared with agents.

FieldTypeRequiredDefaultDescription
credentialsmapNo{}Named credential definitions referenced by upstreams and native tools
credentials:
  weather_api:
    type: "api_key"
    value: "${WEATHER_API_KEY}"
  database:
    type: "connection_string"
    value: "${DATABASE_URL}"

Logging

FieldTypeRequiredDefaultDescription
logging.levelstringNoinfoLog verbosity: debug, info, warn, error
logging.formatstringNojsonLog output format: json or text

Cache

FieldTypeRequiredDefaultDescription
cache.profile_ttldurationNo5mHow long to cache mission profiles locally before re-fetching from the control plane
cache.max_entriesintegerNo1000Maximum number of cached mission profiles

Full Mitrity Gateway config example

gateway_id: "gateway-001"
api_key: "sk-..."
control_plane:
  base_url: "https://api.mitrity.com"

upstreams:
  - name: "filesystem"
    command: "/usr/local/bin/mcp-filesystem"
    args: ["--root", "/data"]
  - name: "database"
    command: "/usr/local/bin/mcp-postgres"
    args: ["--connection-string", "${DATABASE_URL}"]

native_tools:
  - name: "get_weather"
    description: "Get current weather for a location"
    method: "GET"
    url: "https://api.weather.example.com/current"
    headers:
      Authorization: "Bearer ${WEATHER_API_KEY}"

credentials:
  weather_api:
    type: "api_key"
    value: "${WEATHER_API_KEY}"

logging:
  level: "info"
  format: "json"

cache:
  profile_ttl: "5m"
  max_entries: 1000

Mitrity MCP Sidecar Fields

Mitrity MCP Sidecar is configured via mitrity-mcp-sidecar.yaml.

FieldTypeRequiredDefaultDescription
sentinel_idstringYes--Unique identifier for this sidecar instance. Shown in audit logs and the dashboard
api_keystringYes--API key from the MITRITY dashboard (Settings > API Keys)
control_plane.base_urlstringYes--URL of the MITRITY control plane (https://api.mitrity.com)
upstream_commandstringYes--Path to the upstream MCP server binary that the sidecar will wrap
upstream_argslist of stringsNo[]Arguments to pass to the upstream MCP server command
agent_idstringYes--Identifier for the agent using this sidecar. Appears in audit logs and enables per-agent governance
logging.levelstringNoinfoLog verbosity: debug, info, warn, error
logging.formatstringNojsonLog output format: json or text
cache.profile_ttldurationNo5mHow long to cache mission profiles locally before re-fetching from the control plane
cache.max_entriesintegerNo1000Maximum number of cached mission profiles

The sidecar launches the upstream MCP server as a child process, communicating via stdio. It intercepts tools/call JSON-RPC 2.0 requests from the MCP client, evaluates them against governance policies, and either forwards allowed calls to the upstream server or returns a JSON-RPC error for denied calls.

Full Mitrity MCP Sidecar config example

sentinel_id: "mcp-agent-001"
api_key: "sk-..."
control_plane:
  base_url: "https://api.mitrity.com"

upstream_command: "/usr/local/bin/some-mcp-server"
upstream_args: ["--mode", "stdio"]
agent_id: "my-agent"

logging:
  level: "info"
  format: "json"

cache:
  profile_ttl: "5m"
  max_entries: 1000

Environment Variable Overrides

Core configuration fields can be overridden via environment variables. Environment variables take precedence over values in the YAML config file.

Mitrity Gateway

Environment VariableConfig FieldDescription
MITRITY_GATEWAY_IDgateway_idGateway instance identifier
MITRITY_GATEWAY_API_KEYapi_keyAPI key for control plane authentication
MITRITY_GATEWAY_CONTROL_PLANE_URLcontrol_plane.base_urlControl plane URL
MITRITY_GATEWAY_LOG_LEVELlogging.levelLog verbosity
MITRITY_GATEWAY_LOG_FORMATlogging.formatLog output format

Mitrity MCP Sidecar

Environment VariableConfig FieldDescription
MITRITY_MCP_IDsentinel_idSidecar instance identifier
MITRITY_MCP_API_KEYapi_keyAPI key for control plane authentication
MITRITY_MCP_CONTROL_PLANE_URLcontrol_plane.base_urlControl plane URL
MITRITY_MCP_LOG_LEVELlogging.levelLog verbosity
MITRITY_MCP_LOG_FORMATlogging.formatLog output format

Backward compatibility: The legacy SENTINEL_MCP_* environment variable prefix is still supported for the sidecar. New deployments should use the MITRITY_MCP_* prefix.

Environment variable overrides are useful for injecting secrets in containerized deployments without writing them to the config file:

docker run -d \
  --name mitrity-gateway \
  -e MITRITY_GATEWAY_API_KEY=sk-your-key \
  -v /path/to/mitrity-gateway.yaml:/etc/mitrity/config.yaml \
  ghcr.io/mitrity-io/mitrity-mcp-gateway:latest

Related Documentation

Configuration Reference — Documentation | MITRITY