Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

MCP Protection Schema Specification

mcp_protection.json defines the policy, approval storage, trusted issuers, and downstream MCP integrations used by dmint-mcp.
The file is parsed strictly: unknown duplicates are rejected, credentials must not be embedded, relative paths resolve against the config file’s directory, and an invalid config exits before the gateway starts.

Configuration Example

mcp_protection.json
{ "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).

Top-Level Fields

FieldTypeRequiredDescription
policy_filestringOne of policy/policy_fileRelative or absolute path to policy.json, or an https:// URL. Remote URLs require expected_policy_digest.
policyobjectOne of policy/policy_fileEmbedded policy object containing rules. Cannot be combined with policy_file.
integrationsarrayYesNon-empty array (maximum 50) of downstream MCP integrations.
approval_dbstringNoSQLite 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_ttlnumberNoApproval TTL in seconds; must be positive. Required for approval persistence/retry.
deployment_epochstringNoDeployment epoch identifier (default "default"). Matches the default used by dmint pending, dmint approve, and dmint dashboard.
disclosure_modestringNodog (default; structured approval IDs/fingerprints), cat (structured code without internal fingerprints), or god (minimal opaque denial).
agent_idstringNoPrincipal for every request (default mcp-agent).
contextobjectNoTrusted context values available to policy conditions. Do not populate from model output.
server_namestringNoAgent-facing MCP server name (default dmint-mcp-gateway).
trusted_issuersarrayNoPublic 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_audiencestringNoExpected assertion audience (default dmint/dashboard/v1). Must match the issuer’s audience.
expected_policy_digeststringNoExpected SHA-256 policy digest. Also settable through --expected-policy-digest or DMINT_EXPECTED_POLICY_DIGEST.
timeoutnumberNoDefault 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" } ]
Only public keys belong here. The gateway has no private key and cannot mint approvals. Duplicate issuer IDs, non-hex values, or wrong lengths are rejected.

Integration Object Fields

FieldTypeRequiredDescription
integration_idstringYesUnique ID matching [A-Za-z0-9_-]+.
transportstringNostdio (default) or streamable_http / streamable-http.
connectionobjectYes for stdio; optional for HTTPConnection settings. Command/args/env/cwd and url/headers must be nested here, not at the integration top level.
tool_bindingsobject or arrayYesAt least one mapping from downstream tool to capability.
timeoutnumberNoOperation timeout; can be placed at integration, connection, or top level (connection wins).
connect_timeoutnumberNoConnection/handshake timeout.
call_timeoutnumberNoPer-tool-call timeout.
list_timeoutnumberNotools/list timeout.
Timeout values must be positive numbers. The effective precedence is 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 Binding Specification

Bindings map the downstream tool name to a canonical Dmint capability evaluated by policy.
"tool_bindings": { "query": { "tool_name": "query", "capability": "postgres.query", "discovery": "exposed", "resource_key": "table_name" } }
FieldTypeRequiredDescription
tool_namestringNoDownstream tool name. Defaults to the binding key.
capabilitystringYesDmint capability (<tool>.<action>) evaluated by the policy.
discoverystringNoexposed (default; visible in tools/list) or hidden (not advertised, but still enforced on invocation). Discovery is not an authorization boundary.
resource_keystringNoArgument name used as the resource for resource-aware policy matching.
A concise string form is also accepted:
"tool_bindings": { "query": "postgres.query", "exec": "postgres.exec" }
A list form is accepted for discovery-driven tooling:
"tool_bindings": [ {"tool_name": "query", "capability": "postgres.query"}, {"tool_name": "exec", "capability": "postgres.exec", "discovery": "hidden"} ]
Duplicate tool names within one integration are rejected.

Policy Interaction

Each call is evaluated as the capability split into tool/action (for example 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: "*".
For a global rule use resource: "*"; omitting resource matches only calls with no resource.

Validation Checklist

  1. dmint verify-policy policy.json
  2. Validate the config by starting dmint-mcp -c mcp_protection.json in a staging environment; invalid config exits with DMT_MCP_CONFIG_ERROR.
  3. Pin the policy digest (--expected-policy-digest) for production.
  4. Keep private keys out of this file; only public_key_hex belongs in trusted_issuers.
  5. Use $ENV_VAR placeholders for HTTP headers.
  6. Re-pin tool schemas deliberately after reviewing a downstream schema change (DMT_MCP_SCHEMA_MISMATCH).