mcp_protection.json defines the policy, approval storage, trusted issuers, and downstream MCP integrations used by dmint-mcp.{ "policy_file": "policy.json", "approval_db": "./approvals.sqlite3", "approval_ttl": 300, "disclosure_mode": "dog", "agent_id": "mcp-agent", "context": { "environment": "production", "tenant": "acme" }, "trusted_issuers": [ { "issuer_id": "dmint-authority", "public_key_hex": "PASTE_64_CHARACTER_PUBLIC_KEY_HEX" } ], "approval_audience": "dmint/dashboard/v1", "integrations": [ { "integration_id": "postgres", "transport": "stdio", "connection": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"] }, "tool_bindings": { "query": { "tool_name": "query", "capability": "postgres.query", "discovery": "exposed", "resource_key": "table_name" } } }, { "integration_id": "metrics", "transport": "streamable_http", "connection": { "url": "https://mcp.example.com/mcp", "headers": { "Authorization": "$CLOUD_MCP_TOKEN" }, "timeout": 30 }, "tool_bindings": { "get_metrics": { "tool_name": "get_metrics", "capability": "cloud.get_metrics", "discovery": "hidden" } } } ] }
transport accepts stdio, streamable-http, or streamable_http (case-insensitive, hyphen/underscore equivalent).| Field | Type | Required | Description |
policy_file | string | One of policy/policy_file | Relative or absolute path to policy.json, or an https:// URL. Remote URLs require expected_policy_digest. |
policy | object | One of policy/policy_file | Embedded policy object containing rules. Cannot be combined with policy_file. |
integrations | array | Yes | Non-empty array (maximum 50) of downstream MCP integrations. |
approval_db | string | No | SQLite path for pending approvals. approval_store is an accepted alias. Relative paths resolve against the config directory. If unset and DMINT_DATABASE_URL is set, the gateway uses the configured database. |
approval_ttl | number | No | Approval TTL in seconds; must be positive. Required for approval persistence/retry. |
deployment_epoch | string | No | Deployment epoch identifier (default "default"). Matches the default used by dmint pending, dmint approve, and dmint dashboard. |
disclosure_mode | string | No | dog (default; structured approval IDs/fingerprints), cat (structured code without internal fingerprints), or god (minimal opaque denial). |
agent_id | string | No | Principal for every request (default mcp-agent). |
context | object | No | Trusted context values available to policy conditions. Do not populate from model output. |
server_name | string | No | Agent-facing MCP server name (default dmint-mcp-gateway). |
trusted_issuers | array | No | Public issuers accepted for approval assertions. When omitted in local setups, dmint-mcp automatically loads the public key from .dmint/signing.key or ~/.config/dmint/signing.key. |
approval_audience | string | No | Expected assertion audience (default dmint/dashboard/v1). Must match the issuer’s audience. |
expected_policy_digest | string | No | Expected SHA-256 policy digest. Also settable through --expected-policy-digest or DMINT_EXPECTED_POLICY_DIGEST. |
timeout | number | No | Default operation timeout at the top level, overridable per integration or connection. |
trusted_issuers entries"trusted_issuers": [ { "issuer_id": "dmint-authority", "public_key_hex": "64-lowercase-hex-characters" } ]
| Field | Type | Required | Description |
integration_id | string | Yes | Unique ID matching [A-Za-z0-9_-]+. |
transport | string | No | stdio (default) or streamable_http / streamable-http. |
connection | object | Yes for stdio; optional for HTTP | Connection settings. Command/args/env/cwd and url/headers must be nested here, not at the integration top level. |
tool_bindings | object or array | Yes | At least one mapping from downstream tool to capability. |
timeout | number | No | Operation timeout; can be placed at integration, connection, or top level (connection wins). |
connect_timeout | number | No | Connection/handshake timeout. |
call_timeout | number | No | Per-tool-call timeout. |
list_timeout | number | No | tools/list timeout. |
connection → integration → top level for timeout; the other timeouts are connection- or integration-level.stdio connection"connection": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"], "env": {"NODE_ENV": "production"}, "cwd": "/srv/mcp", "timeout": 30 }
command is required. args must be an array of strings. env is a string-to-string object; cwd is optional. HTTP-only fields are rejected for stdio.streamable_http connection"connection": { "url": "https://mcp.example.com/mcp", "headers": { "Authorization": "$CLOUD_MCP_TOKEN" }, "connect_timeout": 10, "call_timeout": 30, "list_timeout": 15 }
url is required. Non-loopback URLs must use HTTPS and pass the gateway’s SSRF/DNS-pinning checks. Header values beginning with $ are resolved from the environment at connect time ($VAR or ${VAR}); literal secrets are rejected by config validation. Do not put tokens directly in the file."tool_bindings": { "query": { "tool_name": "query", "capability": "postgres.query", "discovery": "exposed", "resource_key": "table_name" } }
| Field | Type | Required | Description |
tool_name | string | No | Downstream tool name. Defaults to the binding key. |
capability | string | Yes | Dmint capability (<tool>.<action>) evaluated by the policy. |
discovery | string | No | exposed (default; visible in tools/list) or hidden (not advertised, but still enforced on invocation). Discovery is not an authorization boundary. |
resource_key | string | No | Argument name used as the resource for resource-aware policy matching. |
"tool_bindings": { "query": "postgres.query", "exec": "postgres.exec" }
"tool_bindings": [ {"tool_name": "query", "capability": "postgres.query"}, {"tool_name": "exec", "capability": "postgres.exec", "discovery": "hidden"} ]
postgres.query → postgres / query), with the mapped resource_key value as the resource when present. Unmatched requests are denied by default. Rule precedence is DENY > APPROVAL_REQUIRED > ALLOW, independent of JSON order. Wildcards are whole-field only: tool: "*" and action: "*".resource: "*"; omitting resource matches only calls with no resource.dmint verify-policy policy.jsondmint-mcp -c mcp_protection.json in a staging environment; invalid config exits with DMT_MCP_CONFIG_ERROR.--expected-policy-digest) for production.public_key_hex belongs in trusted_issuers.$ENV_VAR placeholders for HTTP headers.DMT_MCP_SCHEMA_MISMATCH).