Skip to main content
Glama
dmint-app

Dmint MCP Proxy

by dmint-app

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.

Related MCP server: protect-mcp

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.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Security gateway that wraps any MCP server with per-tool policies, approval gates, and optional Ed25519-signed decision receipts. Shadow mode logs every tool call without blocking; enforce mode applies block, rate-limit, and minimum-tier rules. Receipts are independently verifiable offline with no accounts needed.
    5
    1,279 npm
    10
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Security gateway for MCP servers. Wraps any MCP server with per-tool policies (Cedar + JSON), Ed25519-signed decision receipts, human approval gates, and trust tiers. Shadow mode by default — logs everything, blocks nothing.
    1,279 npm
    9
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Security gateway for MCP tool calls. Sits between your LLM client and MCP servers, enforcing per-tool policies (allow/block/approve/read-only), logging every call, and pausing dangerous operations for human approval in terminal or Slack.
    4 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Self-hosted MCP gateway that applies deterministic, compiled policy to tool discovery, invocation, and outbound data flow, with no model in the enforcement path. Every decision emits a hash-chained receipt sealed with Ed25519 and verifiable using public keys only.
    Apache 2.0