n8n MCP
Provides tools for interacting with an n8n instance's Public API, enabling listing and inspecting workflows, activating and deactivating workflows, and retrieving execution history.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@n8n MCPShow me the list of workflows and their active status."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
n8n MCP over HTTPS — Remote n8n Workflow Control for AI Assistants
6 tools for inspecting and controlling an n8n instance's workflows and executions — over a standard HTTPS MCP endpoint, reachable from any client, anywhere, behind a bearer token.
What is this?
n8n MCP is a Model Context Protocol server that gives AI assistants structured access to n8n's Public REST API — listing and inspecting workflows, flipping them active/inactive, and reading execution history.
It speaks MCP's streamable HTTP transport, so any client that supports remote MCP servers can point at a URL and connect. No subprocess, no SSH, no client-side install — which also means it works from clients that can't spawn local processes at all.
Because the endpoint is reachable from anywhere, it carries its own auth: a static bearer token that every request must present. Requests without it get a 401 before touching n8n.
Looking for the no-public-endpoint version? Its sibling project n8n-mcp-via-ssh exposes the same 6 tools over SSH/stdio, where SSH access is the auth boundary and nothing new listens publicly. Same tools, opposite trade-off — pick by whether you need reach or minimal exposure.
Supported platform: any MCP client that supports remote HTTP servers, talking to a server running Python 3.10+ (or Docker).
Related MCP server: n8n-mcp
Tools
Category | Tools | What you can do |
Workflows | 4 | List all workflows, fetch one's full detail, turn its triggers on or off |
Executions | 2 | List recent execution history (optionally filtered to one workflow), fetch full detail for one execution |
Tool | Description |
| id, name, and active status for every workflow |
| full detail for one workflow |
| turn a workflow's triggers on |
| turn a workflow's triggers off |
| recent execution history |
| full detail for one execution |
There's deliberately no generic "run this workflow now" tool — n8n's Public API doesn't expose a clean manual-trigger endpoint for arbitrary workflows. If a workflow has a webhook trigger, running it is just an HTTP call to that webhook's URL; that's a detail of your own workflow, not something this server fabricates.
Requirements
Requirement | Version |
Docker + Compose | any current version (or Python 3.10+ for the bare-process path) |
n8n | Public API enabled (Settings → n8n API → Create an API key) |
Reverse proxy | anything that terminates TLS — Caddy, nginx, Traefik |
Domain | a hostname pointed at your server |
Installation
git clone https://github.com/jimsimoy/n8n-mcp.git
cd n8n-mcp
cp .env.example .env && chmod 600 .envFill in .env:
# generate a bearer token — the server refuses to start without one
openssl rand -hex 32Variable | What to set it to |
|
|
| n8n UI → Settings → n8n API → Create an API key |
| the |
| your public hostname, e.g. |
|
|
Then bring it up:
docker compose up -d --build
docker compose logs -fThe container publishes to 127.0.0.1:8097 — loopback only. Your reverse proxy is what puts it on the internet, over TLS.
python3 -m venv venv
./venv/bin/pip install -r requirements.txt
# set MCP_HOST=127.0.0.1 in .env, then:
./run.shReverse Proxy
Full walkthrough — Caddy, nginx, DNS, and how to verify each layer by hand — in docs/https-access-guide.md. Caddy, which handles TLS certificates automatically:
mcp.example.com {
reverse_proxy 127.0.0.1:8097 {
# MCP replies on long-lived SSE streams; buffering stalls them
flush_interval -1
transport http {
read_timeout 300s
write_timeout 300s
}
}
}Auth deliberately lives in the app, not the proxy — so the token stays out of your shared proxy config and this repo works the same behind any proxy.
Client Setup
Claude Code:
claude mcp add --transport http n8n https://mcp.example.com/mcp \
--header "Authorization: Bearer YOUR_TOKEN"Any client using the standard JSON config:
{
"mcpServers": {
"n8n": {
"type": "http",
"url": "https://mcp.example.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}Restart your MCP client after saving. The 6 tools will appear automatically.
Usage Examples
See what's running
List all workflows in n8n and tell me which ones are inactiveCheck recent runs
Show me the last 10 executions for workflow abc123, and get full detail on any
that failedTurn something off
Deactivate the workflow called "Old Backup Job"Security
This server puts workflow control on the public internet. That's the point of it, and it's also the thing to be deliberate about:
The bearer token is the whole boundary. Generate it with
openssl rand -hex 32— not a guessable string. The server refuses to start ifMCP_AUTH_TOKENis unset, so an open endpoint can't happen by accident. Tokens are compared in constant time..envis gitignored and holds two secrets (the n8n API key and the bearer token). Never commit it.chmod 600it.Always terminate TLS. A bearer token over plain HTTP is a token in cleartext. Never publish this on
:80.Bind the app to loopback. The compose file publishes
127.0.0.1:8097on purpose — the proxy is the only way in.Set
MCP_ALLOWED_HOSTS/MCP_ALLOWED_ORIGINSto your real hostname. This enables DNS-rebinding protection; requests with a mismatchedHost/Originget a421./healthzis intentionally unauthenticated so proxies and orchestrators can probe it. It returns{"status":"ok"}and nothing else — no version, config, or n8n detail.Scope the n8n key to what you're willing to expose. It can activate/deactivate workflows and read execution data, which may contain whatever your workflows processed.
Rotate by changing
MCP_AUTH_TOKENand runningdocker compose up -d, then update your clients.
Project Structure
n8n-mcp/
server.py # MCP server, tool definitions, ASGI app assembly
n8n_client.py # n8n Public API client (workflows, executions)
auth.py # bearer-token ASGI middleware
Dockerfile
docker-compose.yml
run.sh # bare-process entry point (non-Docker)
docs/
https-access-guide.md # proxy, DNS, TLS, and client wiringThe server communicates over MCP's streamable HTTP transport using JSON-RPC 2.0.
A note on testing
Verified end-to-end against a live n8n instance through a real public HTTPS endpoint behind Caddy and Cloudflare: Let's Encrypt certificate issuance, the MCP initialize handshake, list_tools returning all 6 tools, and call_tool("list_workflows") returning real workflow data (16 workflows, a mix of active and inactive) from a production instance. The auth gate was verified in all four states — no token → 401, wrong token → 401, correct token → 200, mismatched Host → 421. get_workflow, activate_workflow, deactivate_workflow, list_executions, and get_execution all go through the same n8n_client.py request/error-handling path.
License
MIT — free to use, modify, and distribute.
This server cannot be installed
Maintenance
Related MCP Connectors
n8n MCP — query your own n8n instance (BYO).
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Create, browse, remix, collaborate on, and run durable AI workflow nodes from MCP hosts.
Give any MCP-compatible AI assistant a builder for live, hosted web tools and workflows.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceProvides seamless integration between MCP-compatible AI assistants and n8n workflow automation, enabling intelligent management and automation of n8n workflows through natural language.5-
- AlicenseNot gradedqualityDmaintenanceEnables AI models to manage workflows, credentials, nodes, templates, and monitor executions on the n8n automation platform through a standardized MCP interface.74,778MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to programmatically create, manage, and orchestrate n8n workflows through a standardized MCP interface.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to manage n8n workflows and executions, including creating, updating, deleting, activating, deactivating, and executing workflows, as well as listing and retrieving execution details.45MIT