draftgate-mcp

draftgate-mcp

Enables email agents to send emails with granular trust levels per contact, ensuring human approval for high-risk or unknown recipients while allowing automatic sending for trusted ones.

Category
Visit Server

README

draftgate-mcp

An MCP server for email agents that cannot send mail without a human saying yes — unless you've explicitly told it otherwise for that contact.

Most "AI email assistant" demos either send freely (fine for a toy, unacceptable in production) or gate everything behind approval (safe, but defeats the point of automation for routine, low-stakes contacts). draftgate-mcp does neither: each contact carries its own trust level, and the send path enforces it deterministically — not by asking the model to "please be careful."

The pattern

Every contact has an auth_level:

Level Behaviour
full Sends immediately. No gate.
high Sends immediately, unless the body contains a flagged keyword (contract, invoice, payment, password, confidential, legal) — then it's held for review instead.
ask Always held as a draft. A human must explicitly call confirm_draft().
ask_before_draft The agent isn't even allowed to compose a draft without permission first. This is the default for anyone not in contacts.json.

send_email() returns a status field — sent, draft_created, needs_review, or blocked — and the server's own instructions tell the calling model exactly what each status requires before it's allowed to proceed. The gate lives in code, not in a prompt asking the model nicely not to send things.

Unknown recipients default to the most restrictive level. An agent can't accidentally email someone it's never been told about — it has to be extended a trust level explicitly, by a human, first.

Tools

  • read_inbox, read_message — read mail via IMAP
  • send_email — the gated send path described above
  • list_drafts, confirm_draft, discard_draft — manage held drafts
  • list_contacts, add_contact, update_contact_auth — manage trust levels

Setup

pip install -r requirements.txt
cp .env.example .env        # fill in your IMAP/SMTP credentials
cp data/contacts.example.json data/contacts.json   # add your real contacts
python server.py

Point any MCP client (Claude Desktop, Claude Code, etc.) at server.py over stdio.

Why

This was extracted from the trust-tiering logic in a production email agent I run for my own inbox. The rest of that system — voice, telephony, task tracking, internal chat bridges — is specific to my own setup and not worth open-sourcing as-is, but the draft-gate pattern is a genuinely reusable answer to "how do you let an agent act without letting it act unsupervised." This repo is that pattern, stripped down to ~250 lines with no dependencies beyond the standard library, fastmcp, and python-dotenv.

License

MIT — see LICENSE.

Derek Manthorpe · github.com/DRMM101

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured