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

Cursor, Windsurf & Cline Integration

Dmint integrates with IDE coding agents (Cursor, Windsurf, and Cline / Roo Code) in two complementary ways:
  1. Pre-Tool Execution Hooks (dmint hook): Intercepts native IDE terminal commands (run_terminal_cmd, Bash), file reads/edits (Read, Write, Edit), and MCP calls via .cursor/hooks.json, .windsurf/hooks.json, and .clinerules/hooks.json.
  2. MCP Security Gateway (dmint-mcp): Wraps external Model Context Protocol servers (PostgreSQL, GitHub, Stripe, custom tools) in a fail-closed proxy.

1. Quick Setup for IDE Hooks (dmint init)

Run dmint init in your repository root to generate keys, a starter policy.json (shell + filesystem templates), and IDE hook configs:
# Configure Cursor, Windsurf, and Cline hooks in one command: dmint init --harness cursor,windsurf,cline # Or configure all supported harnesses at once: dmint init --harness all
Test how your policy behaves before running the agent:
dmint check --tool filesystem.read_file --resource "src/app.py" # -> ALLOW dmint check --tool filesystem.read_file --resource ".env" # -> DENY dmint check --tool shell.execute --resource "git push origin main" # -> APPROVAL_REQUIRED

2. Protecting External MCP Servers (dmint-mcp)

To wrap an MCP server (such as @modelcontextprotocol/server-postgres) inside Cursor:

Step A: Generate policy.json and mcp_protection.json

dmint create-mcp-policy \ --command npx \ --args "-y @modelcontextprotocol/server-postgres postgresql://localhost/mydb" \ --integration-id postgres \ -f access.md \ -o policy.json \ --config-output mcp_protection.json \ -y

Step B: Configure .cursor/mcp.json

In your project root, create or edit .cursor/mcp.json:
.cursor/mcp.json
{ "mcpServers": { "dmint-protected-gateway": { "command": "dmint-mcp", "args": [ "run", "--config", "/absolute/path/to/mcp_protection.json" ] } } }
Always use absolute paths in .cursor/mcp.json so Cursor can locate the configuration regardless of which subfolder is open.

3. Approving Paused Tool Calls

When an IDE agent triggers an APPROVAL_REQUIRED rule (via either dmint hook or dmint-mcp):
  1. Execution pauses before the tool runs, and a PENDING record (apr_...) is written to .dmint/approvals.sqlite3 (or your configured approval_db).
  2. Approve from your terminal or local web dashboard:
    # Option A: Terminal CLI dmint pending dmint approve apr_abc123... --by dev@company.com # Option B: Local Web Dashboard dmint dashboard
  3. Ask the agent in Cursor/Windsurf/Cline to retry the exact tool call. Dmint automatically looks up the approved assertion matching the request's RFC 8785 fingerprint, consumes it atomically (APPROVED -> CONSUMED), and executes the call once.