Skip to main content
Glama
mcp-n8n-voice-orchestrator

mcp-n8n-voice-orchestrator

npm version License: MIT

mcp-n8n-voice-orchestrator

A small Model Context Protocol (MCP) server that lets Claude (Desktop, Code, or the API) trigger self-hosted n8n webhook workflows with an idempotency key, plus a reference n8n workflow and Postgres schema for de-duplicating voice and messaging webhooks.

Status: early (v1.x). One MCP tool, one example workflow, one SQL schema. Feedback and PRs welcome.

The problem

Voice and messaging automations often receive overlapping webhooks. For example, a Vapi end-of-call report and an inbound WhatsApp message can arrive within a few hundred milliseconds of each other. Without a lock, both can trigger an outbound message, and the lead gets double-texted.

This repo shows one way to handle it:

  1. Claude calls an MCP tool with a stable idempotencyKey (a call ID or message ID).

  2. The server forwards it to your n8n webhook with an X-Idempotency-Key header.

  3. The n8n workflow tries to insert that key into Postgres/Supabase. Only the first delivery succeeds, so only one branch continues.

Related MCP server: n8n MCP Server

What is in the repo

Path

What it does

src/index.ts

MCP server (stdio). Exposes one tool, dispatch_idempotent_n8n_workflow, with Zod-validated input. Forwards the call to n8n with X-Idempotency-Key and X-Source-Channel headers.

workflows/vapi-missed-call-recovery.json

Example n8n workflow: webhook in, Postgres insert with ON CONFLICT DO NOTHING, then an IF node that separates first delivery from duplicates. Add your own WhatsApp/SMS nodes on the first-delivery branch.

state-machine/schema.sql

The webhook_locks table the workflow writes to.

.env.example

Environment variables for the server.

The lock itself lives in the n8n workflow and database. The MCP server only forwards the key.

Quick start

git clone https://github.com/Code-With-Vishal/mcp-n8n-voice-orchestrator.git
cd mcp-n8n-voice-orchestrator
npm install
cp .env.example .env
npm run build

Or install from npm:

npm i mcp-n8n-voice-orchestrator
  1. Run state-machine/schema.sql in your Postgres or Supabase database.

  2. Import workflows/vapi-missed-call-recovery.json into n8n and attach your Postgres credentials.

  3. Set N8N_WEBHOOK_BASE_URL (and optionally N8N_API_KEY) in .env.

Claude Desktop config

{
  "mcpServers": {
    "n8n-voice-orchestrator": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-n8n-voice-orchestrator/dist/index.js"],
      "env": {
        "N8N_WEBHOOK_BASE_URL": "http://localhost:5678/webhook"
      }
    }
  }
}

Tool reference

dispatch_idempotent_n8n_workflow

Field

Type

Notes

workflowId

string

n8n webhook path, appended to N8N_WEBHOOK_BASE_URL

idempotencyKey

string

Stable ID for the event, such as a call ID or message ID

channel

vapi_voice | twilio_sms | whatsapp_cloud

Sent as X-Source-Channel

payload

object

Forwarded as the JSON body, with a timestamp added

Roadmap

  • Tests for the dispatch handler

  • More example workflows (lead qualification, session handoff)

  • CLI to generate MCP tool definitions from n8n workflow JSON

Contributing

Issues and pull requests are welcome, especially anonymized n8n workflows that handle webhook de-duplication.

License

MIT

Available Tools

1 tool
dispatch_idempotent_n8n_workflowC

Dispatches a deterministic, lock-verified webhook payload to a self-hosted n8n workflow from Vapi, Twilio, or WhatsApp Cloud API.

Inputs: channel (required), payload (required), workflowId (required), idempotencyKey (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only a single tool, there is no possibility of confusing it with another; its purpose as a workflow dispatcher is unmistakable.

    Naming Consistency4/5

    The lone name follows a clear snake_case verb_noun pattern (dispatch_idempotent_n8n_workflow), though with one tool there is no pattern to actually be consistent across.

    Tool Count2/5

    A single tool is too thin for an orchestration server; dispatch is the only operation, leaving no room for status, verification, or management operations.

    Completeness2/5

    The surface offers fire-and-forget dispatch with no way to check workflow status, list available workflows, or handle failures, which are significant gaps for an orchestration role.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables users to manage workflows, monitor executions, and perform administrative tasks in n8n through natural language conversations with Claude. It provides over 40 tools to control self-hosted or cloud n8n instances via the Model Context Protocol.
      42
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Production-ready MCP server that brings N8N workflow automation to both Claude.ai and ChatGPT. Supports multi-tenant OAuth/SSE integration with dynamic N8N instance configuration.
      128 npm
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Wraps the n8n self-hosted REST API to let Claude and MCP-compatible LLMs manage workflows, executions, credentials, and more via natural language.
      39
      -