All posts
5 min read

How to Add Slack & Telegram Approvals to MCP Servers in Claude Desktop and Cursor

Wrap any local stdio or Streamable HTTP MCP server with a fail-closed firewall, free zero-tunnel Slack/Telegram Approve & Reject, native in-chat Edit & Approve, and a SHA-256 hash-chained SQLite audit log.

#mcp#claude-desktop#cursor#human-in-the-loop#security

Human-in-the-loop (HITL) approval for Model Context Protocol (MCP) tools usually forces an awkward compromise: adopt a whole new agent runtime just to get chat connectors, rely on the LLM to voluntarily ask a human before calling a destructive tool, stitch together fragile webhook scripts, or route private payloads through a cloud dashboard behind an Enterprise contract.

A cleaner boundary is a standalone, local-first AI agent firewall sitting directly between your MCP client (Claude Desktop, Cursor, or a custom agent) and your MCP server. Every tools/call request is intercepted before execution, checked against fail-closed local rules, paused for interactive approval in Slack or Telegram with zero tunnels, and recorded in a tamper-evident SQLite ledger.

Four ways teams add Slack or Telegram approvals to MCP

Approach How it works Main trade-off
Full agent runtimes (e.g., OpenClaw, Hermes) Built-in Slack/Telegram connectors and command approvals inside the runtime. Requires moving your agent into that runtime; not a standalone proxy for existing Claude Desktop, Cursor, LangChain, or REST backends.
Voluntary HITL MCP servers Exposes an ask_human tool so the LLM can post a question in Slack before acting. Not enforced. A hallucinating or prompt-injected model can call the destructive tool directly and skip asking.
DIY firewall + webhook script Local policy gate calling a custom Bash/Python script to ping Telegram or Slack. One-way alerts or brittle glue code; no signed callbacks, no inline JSON editing, and no audit evidence pack.
Standalone local MCP firewall (Mont) Wraps stdio, Streamable HTTP, or SSE MCP transports with default-deny rules. Works with any existing agent, includes free zero-tunnel Slack/Telegram Approve & Reject, native in-chat Edit & Approve in Pro, and a SHA-256 hash-chained SQLite ledger.

5-minute setup: wrap any MCP server with Mont

Mont (agent-gateway-sdk) requires Node.js 20.17+ and stores rules, pending approvals, and audit logs in a single embedded SQLite (WAL) file—no Redis, Postgres, or cloud account.

Step 1: Wrap your MCP server in Claude Desktop or Cursor

Prepend npx -y agent-gateway-sdk mcp-stdio as the server command so every tool call passes through Mont. Use an absolute path for --data-dir so JSON configs do not rely on shell ~ expansion.

Claude Desktop (claude_desktop_config.json) or Cursor (.cursor/mcp.json):

json
{
  "mcpServers": {
    "filesystem-guarded": {
      "command": "npx",
      "args": [
        "-y",
        "agent-gateway-sdk",
        "mcp-stdio",
        "--data-dir",
        "/Users/yourname/.mont",
        "--",
        "npx",
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/allowed/dir"
      ]
    }
  }
}

Remote or Streamable HTTP MCP server? Run Mont as an HTTP proxy in front of your upstream server instead:

bash
npx agent-gateway-sdk mcp-http --upstream http://127.0.0.1:9000/mcp

Restart Claude Desktop or Cursor so it reconnects through the wrapper.

Step 2: Set fail-closed rules for each MCP tool

Mont is default-deny: any MCP tool you have not explicitly allowed is blocked (403) and logged. Open the local admin console (http://127.0.0.1:3000/agent-admin/ — the first-boot setup key prints in your terminal) and configure rules using the MCP pseudo-method:

Rule Decision What happens
MCP /api/mcp/tools/read_file ALLOW Executes immediately and logs to SQLite.
MCP /api/mcp/tools/write_file REQUIRE_APPROVAL Pauses tool execution until a human approves (expires after 24 h).
MCP /api/mcp/tools/delete_file BLOCK Refused immediately and recorded as a blocked attempt.

Fastest way to discover tool names: Let Claude or Cursor attempt a tool call once, open Audit Logs in the admin console, and click + Add to Rules on the captured request. To observe live traffic without interrupting execution first, start in SHADOW_APPROVAL or SHADOW_BLOCK dry-run mode.

Step 3: Turn on zero-tunnel Slack or Telegram approvals (free in Community)

Most approval gateways force you to expose a public webhook URL via ngrok or a reverse proxy so Slack or Telegram can call back into your machine. Mont avoids inbound ports completely:

  • Telegram: Uses outbound long-polling with signed inline Approve / Reject buttons.
  • Slack: Uses Socket Mode over an outbound WebSocket connection.

Because Mont runs as an external gateway process, only the firewall process holds your Slack or Telegram bot token—the AI agent never sees the credentials and cannot abuse your alert channel to exfiltrate local data.

Configure your Slack Socket Mode token or Telegram bot token inside Gateway Setup in the local admin console. On the free Community tier, you get 1 active approval channel (Telegram or Slack) on your workspace with zero license key required.

Step 4: Patch bad payloads directly in chat with Edit & Approve (Pro)

Binary approve/deny breaks down when an agent is almost right—for example, requesting a $250 refund when your policy cap is $50. Rejecting forces the model into a retry loop.

With Edit & Approve (Pro, Agency, and the built-in 7-day instant trial), you can fix the JSON arguments right from your phone without opening a browser:

  • In Slack: Tapping Edit & Approve opens a native Socket Mode modal pre-filled with the pending JSON body. Mont runs a dry-run validation before closing the modal so invalid JSON, rule blocks, or budget blocks show inline immediately.
  • In Telegram: Tapping Edit & Approve sends a copyable JSON prompt via ForceReply locked strictly to the approver who tapped the button (10-minute expiry, supports cancel and retry on invalid JSON).

Every edited payload is re-checked against both your access rules and hard-block spending budgets (onExceed: "BLOCK"), executed with a dedicated signed edit token, and logged alongside the original payload and the human approver (approved_by).

What lands in your audit log

Every allowed, approved, edited, and blocked MCP call is written to an append-only embedded SQLite table where each row is SHA-256 hash-chained to the previous entry:

  • Tamper detection: Editing, deleting, or truncating any row breaks the chain.
  • Recursive PII redaction: Configure audit.redactKeys to mask sensitive fields at any JSON depth before payloads touch disk.
  • Zero telemetry: Tool payloads never leave your machine or private server.

Community vs. Pro pricing (flat rate, no per-seat metering)

Mont is open-core and 100% self-hosted with offline Ed25519 license keys:

  • Community ($0 forever): Local REST & MCP firewall, fail-closed payload rules, spending budgets, zero-tunnel Telegram or Slack Approve & Reject (1 channel, 1 workspace), deep payload capture with recursive PII redaction, compliance presets, and hash-chained SQLite logging.
  • Pro ($30/month flat or $250/year — includes a 7-day instant trial + free 90-day trial with no credit card): Native in-chat Edit & Approve (Slack modal + Telegram ForceReply), both Telegram and Slack channels simultaneously, 3 workspaces, 500 agent keys, 1-Click Auditor Evidence Packs, Hash-Chain Verification, Rollback Webhooks, Team/Auditor roles, and Prometheus metrics.
  • Agency ($149/month flat or $1,280/year): Everything in Pro across 25 isolated client workspaces with per-client Telegram/Slack routing and an All-Clients Overview dashboard.
bash
npm install agent-gateway-sdk

Wrap one high-risk MCP tool locally first—you will know within ten minutes whether it replaces the custom approval middleware you were planning to write.