Skip to main content
Glama
mcp-review-gate-example

mcp-review-gate-example

by BindaasDavid

mcp-review-gate-example

A small Model Context Protocol server in TypeScript that shows one pattern I use in production: the model can propose an outgoing email, SMS or post, but it can't send or approve anything. Drafts wait in a queue until a person reviews them.

Terminal session: the client proposes a draft, then a reviewer approves it

Why

When an agent can send messages on someone's behalf, one bad tool call goes straight to a customer. Keeping the approve step out of the model's tool list is a simple fix. The model gets a tool that writes a draft, and the approval lives somewhere only a person can reach (here, a CLI; in a real app, an admin screen or a chat approval card).

flowchart LR
    A[AI client<br/>Claude, Cursor, etc.] -- propose_message --> S[MCP server]
    S -- saves draft<br/>status: pending_review --> Q[(drafts.json)]
    R[Person running<br/>npm run review] -- approve / reject --> Q
    Q -- approved drafts only --> X[Your sender<br/>not included]

Related MCP server: douyin-lead-workbench MCP Server

Tools

Tool

What it does

Side effects

text_stats

Counts characters, words and sentences and estimates reading time

None

propose_message

Saves an email, SMS or post as a draft with status pending_review

Writes one draft. Sends nothing.

list_drafts

Lists drafts, optionally filtered by status

None

There is no approve or send tool on purpose. Approval is in src/review-cli.ts, which the model can't call.

Run it

Requires Node 20 or later.

npm install
npm run build
npm test                    # 4 tests, using the SDK's in-memory transport
node examples/client.mjs    # starts the server over stdio and proposes a draft
npm run review              # list drafts waiting for review
npm run review -- approve <id> "optional note"
npm run review -- reject <id> "optional note"

Drafts are stored in drafts.json in the current folder. Set DRAFTS_FILE to use another path.

Use it from an MCP client

Add it to your client's MCP config (Claude Desktop, Cursor and others use this shape):

{
  "mcpServers": {
    "review-gate": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-review-gate-example/dist/src/index.js"],
      "env": { "DRAFTS_FILE": "/absolute/path/to/drafts.json" }
    }
  }
}

Then ask the assistant to draft a follow-up email. It will call propose_message, tell you the draft id, and stop there.

Files

src/drafts.ts      JSON-file draft store (swap for a database table in real use)
src/server.ts      MCP server and its three tools
src/index.ts       stdio entry point
src/review-cli.ts  the human side: list, approve, reject
test/              node:test tests against the server through an in-memory client
examples/client.mjs  a minimal stdio client

Taking it further

  • Store drafts in a database with row-level security so only reviewers can change status.

  • Send approved drafts from a separate worker that checks the status again right before sending.

  • Record who approved what and when (the store already keeps reviewer and reviewedAt).

License

MIT

Available Tools

3 tools
list_draftsList draftsB
Read-only

List saved drafts and their review status.

Inputs: status.

propose_messagePropose a message for human reviewA

Save an outgoing email, SMS or post as a draft for a person to review. Nothing is sent. The draft stays pending until someone approves it with the review CLI.

Inputs: to (required), body (required), channel (required), subject.

text_statsText statsA
Read-only

Count characters, words and sentences in a piece of text and estimate reading time.

Inputs: text (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 3 tools

    Disambiguation4/5

    Each tool targets a clearly different operation: text analysis, draft creation, and draft listing. The only mild wrinkle is text_stats, which is a generic utility that sits oddly beside the review-gate workflow, but it is not confusable with the other two.

    Naming Consistency4/5

    All names use consistent snake_case, which is good. However, propose_message and list_drafts follow a verb_noun pattern while text_stats is noun-first, a minor deviation from the otherwise predictable convention.

    Tool Count3/5

    Three tools is on the thin side for a review-gate server, and one of them (text_stats) is a peripheral utility rather than core functionality. The set is small enough to be scoped but borders on under-specified.

    Completeness2/5

    The draft lifecycle is incomplete: agents can create and list drafts but cannot approve, reject, retrieve a single draft, or delete/withdraw one—approval is only possible via an external CLI. This is a significant gap for the stated review-gate purpose and will cause dead ends for an agent trying to complete the workflow.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to create, list, update, and delete Microsoft 365 email drafts, with a hard guarantee that no message can be sent automatically, ensuring human review before any email goes out.
      12
      36 PyPI
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to write, preview, publish, schedule, and track posts across X, LinkedIn, Bluesky, Mastodon, Pinterest, TikTok, and YouTube with per-network cost receipts and an explicit user approval step. Also supports voice writing, media uploads, trend finding, and queue management through natural language.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables an AI agent to request human approval before sending anything, check approval status, and claim approved text exactly once. Human reviewers can approve, edit, or reject drafts, with no tool available for the agent to approve itself.
      MIT