Skip to main content

dmint-mcp

MCP Proxy Server and Tool Enforcement Gateway for Dmint.

dmint-mcp allows developers to wrap existing Model Context Protocol (MCP) servers with deterministic policy enforcement gates. It intercepts agent tools/call requests over stdio, evaluates Dmint security policy, and routes only authorized calls downstream.

┌─────────────────┐
│    AI Client    │
└────────┬────────┘
         │ stdio (tools/list, tools/call)
         ▼
┌─────────────────────────────────┐
│        Dmint MCP Proxy          │
│                                 │
│  ┌───────────────────────────┐  │
│  │     Enforcement Gate      │  │
│  └─────────────┬─────────────┘  │
└────────────────┼────────────────┘
                 │ stdio (authorized call only)
                 ▼
┌─────────────────────────────────┐
│     Downstream MCP Server       │
└─────────────────────────────────┘

Why This Exists

When using external MCP servers that you cannot modify, dmint-mcp acts as an out-of-process security proxy between the AI agent and the MCP server.

  • Tool Discovery Control: Expose or hide tools dynamically from tools/list based on configuration.
  • Pre-Call Interception: Intercepts tools/call, maps parameters to a Dmint ToolRequest, and enforces ALLOW, DENY, or APPROVAL_REQUIRED.
  • Zero Downstream Leakage: Unapproved or denied calls never reach the downstream MCP server process.
  • Approved Retries: Supports Ed25519-signed retry assertion credentials to execute approved workflows over stdio.

Installation

pip install dmint-mcp

Quickstart

import anyio
from dmint_mcp import DmintMCPProxy, MCPIntegrationConfig, MCPToolBinding, DiscoveryMode
from dmint.policy import Policy

# 1. Define integration configuration
config = MCPIntegrationConfig(
    integration_id="sqlite-server",
    command="python3",
    args=["-m", "sqlite_server"],
    tool_bindings=[
        MCPToolBinding(tool_name="read_query", capability="db.read", discovery=DiscoveryMode.EXPOSED),
        MCPToolBinding(tool_name="delete_query", capability="db.delete", discovery=DiscoveryMode.HIDDEN),
    ],
)

# 2. Define policy
policy = Policy.from_mapping({
    "rules": [
        {"effect": "allow", "tool": "db", "action": "read", "resource": "*"},
        {"effect": "deny", "tool": "db", "action": "delete", "resource": "*"},
    ]
})

# 3. Instantiate and run proxy over stdio
proxy = DmintMCPProxy(integration_config=config, policy=policy)

async def main():
    await proxy.serve_stdio()

if __name__ == "__main__":
    anyio.run(main)

Disclosure Modes

Control error disclosure returned to the AI client on denied or approval-required requests:

  • DOG (default): Returns structured recovery JSON containing request_id, approval_id, and request_fingerprint.
  • GOD: Returns minimal opaque error responses (DMT_403: access denied).
  • CAT: Returns structured error codes without revealing internal request fingerprints.

Supported Transports

  • Stdio (stdio): Standard input/output process transport for local MCP servers.

Testing

Run the MCP integration and unit test suite:

pytest -v

License

Licensed under the Apache License, Version 2.0. See the LICENSE file for the complete license text.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dmint_mcp-0.1.0.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dmint_mcp-0.1.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file dmint_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: dmint_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dmint_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e478e4d05c8583c631d6b5883213f6603cd78eab8a26f5941e04905682121c4f
MD5 9f7d19ac5f09e888caaa60dbbe6993ca
BLAKE2b-256 073806624d13ebf98d736abb2e0ca5fedc08f37c036c599387f3778df0e64944

See more details on using hashes here.

Provenance

The following attestation bundles were made for dmint_mcp-0.1.0.tar.gz:

Publisher: publish.yml on dmint-app/dmint-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dmint_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dmint_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dmint_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d2a01a0885bf8b67c6d2160d0c485cfaab01fced62155d761fef9f428c783f5
MD5 b77586dcab7f55162578744bc2609acf
BLAKE2b-256 13c6533b736164387ed0105d1f239ab6eec6dd7117941559bc4f4b2ed76d1f75

See more details on using hashes here.

Provenance

The following attestation bundles were made for dmint_mcp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on dmint-app/dmint-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page