A Python MCP (Model Context Protocol) server that wraps the n8n public REST API, exposing 40 tools any MCP-compatible client (Claude Code, Claude Desktop, Cursor, Windsurf) can call.
n8n ships its own MCP server, but in self-hosted v2.8.x it depends on a per-workflow availableInMCP toggle that silently fails to persist. It's also limited to read + execute on opt-in workflows — you can't create, update, or manage executions from an MCP client.
This server uses n8n's public REST API (no opt-in flags, no UI bug), giving full coverage on workflows, executions, credentials, tags, variables, users, projects, source control, and audit.
| Category | Tools |
|---|---|
| Workflows | list_workflows, get_workflow, get_workflow_tags, create_workflow, update_workflow, delete_workflow, activate_workflow, deactivate_workflow, transfer_workflow |
| Executions | list_executions, get_execution, delete_execution (with output truncation) |
| Tags | list_tags, get_tag, create_tag, update_tag, delete_tag, set_workflow_tags |
| Credentials | get_credential_schema, create_credential, delete_credential, transfer_credential |
| Variables | list_variables, create_variable, update_variable, delete_variable |
| Users | list_users, get_user, create_users, change_user_role, delete_user |
| Projects (Enterprise) | list_projects, create_project, update_project, delete_project, add_users_to_project, change_project_user_role, remove_user_from_project |
| Source control (Enterprise) | source_control_pull |
| Audit | generate_audit |
All mutating tools accept dry_run=True to preview the request without calling the API. Destructive tools carry MCP destructiveHint annotations so clients can surface confirmation prompts.
pip install n8n-mcp-pyOr from source:
git clone https://github.com/CKSoupen/n8n-mcp-python
cd n8n-mcp-python
pip install -e ".[dev]"Set two environment variables — either in your shell, in a .env file (see .env.example), or via your MCP client's config:
N8N_BASE_URL=https://your-n8n.example.com
N8N_API_KEY=eyJhbGc... # public-api JWT, from n8n Settings → API
Optional knobs:
N8N_TIMEOUT_SECONDS=30
N8N_USER_AGENT=Mozilla/5.0 (compatible; n8n-mcp-py)
N8N_VERIFY_SSL=true
Cloudflare note: the default User-Agent is browser-like because many self-hosted n8n instances sit behind Cloudflare, whose default WAF rules can block bare
python/requestsclients with a 1010 error.
claude mcp add n8n-py -- n8n-mcpThen put N8N_BASE_URL and N8N_API_KEY in ~/.claude.env or set them in your shell profile.
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"n8n-py": {
"command": "n8n-mcp",
"env": {
"N8N_BASE_URL": "https://your-n8n.example.com",
"N8N_API_KEY": "eyJhbGc..."
}
}
}
}Edit ~/.cursor/mcp.json:
{
"mcpServers": {
"n8n-py": {
"command": "n8n-mcp",
"env": {
"N8N_BASE_URL": "https://your-n8n.example.com",
"N8N_API_KEY": "eyJhbGc..."
}
}
}
}Edit ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"n8n-py": {
"command": "n8n-mcp",
"env": {
"N8N_BASE_URL": "https://your-n8n.example.com",
"N8N_API_KEY": "eyJhbGc..."
}
}
}
}# install
pip install -e ".[dev]"
# lint
ruff check src tests
# test
pytest -q
# run the server locally (stdio) — useful for ad-hoc debugging
N8N_BASE_URL=https://... N8N_API_KEY=... n8n-mcpMIT