Skip to main content

MCP Server

The @n8n-as-code/mcp package is a dedicated Model Context Protocol server that exposes n8n-as-code tools to any MCP-compatible AI client — Claude Desktop, Cursor, VS Code Copilot, Windsurf, and others.

It gives AI assistants offline access to the full n8n node catalogue, community workflow examples, and workflow validation without requiring a live n8n instance.

What the MCP server provides

ToolDescription
search_n8n_knowledgeSearch the bundled n8n node catalogue and documentation
get_n8n_node_infoGet the full schema and metadata for a specific node
search_n8n_workflow_examplesSearch 7 000+ community workflow examples
get_n8n_workflow_exampleGet metadata and download URL for a specific example
validate_n8n_workflowValidate a workflow against the bundled JSON schema
search_n8n_docsSearch bundled n8n documentation pages

All tools operate entirely on bundled, offline data — no network access to n8n is required.

Installation

The MCP server (@n8n-as-code/mcp) delegates all tool calls to the n8nac CLI at runtime. n8nac is declared as a dependency and is installed automatically.

Option 1 — npx (no persistent install)

npx -y @n8n-as-code/mcp
npm install -g @n8n-as-code/mcp
n8nac-mcp

Option 3 — Docker

The Docker images bundle both n8nac and @n8n-as-code/mcp — no separate installation needed. See the Docker guide below.

Transport modes

The server supports three transport protocols:

ModeFlagUse case
stdio(default)Local clients (Claude Desktop, Cursor, VS Code) that launch the process directly
http--httpPersistent container or remote server, accessed via Streamable HTTP
sse--sseLegacy clients that require SSE — prefer http for new setups
SSE is deprecated

The SSE transport is officially deprecated in the MCP specification. Always prefer HTTP for new setups. SSE is supported only for backwards compatibility with older clients.

Starting with HTTP transport

n8nac-mcp --http --host 0.0.0.0 --port 3000

The server then listens at http://localhost:3000/mcp.

Client configuration

Claude Desktop

stdio (~/Library/Application Support/Claude/claude_desktop_config.json):

{
"mcpServers": {
"n8n-as-code": {
"command": "npx",
"args": ["-y", "@n8n-as-code/mcp"]
}
}
}

HTTP — start the server first (n8nac-mcp --http), then add:

{
"mcpServers": {
"n8n-as-code": {
"url": "http://localhost:3000/mcp"
}
}
}

Cursor

stdio (.cursor/mcp.json):

{
"mcpServers": {
"n8n-as-code": {
"command": "npx",
"args": ["-y", "@n8n-as-code/mcp"]
}
}
}

HTTP (.cursor/mcp.json):

{
"mcpServers": {
"n8n-as-code": {
"url": "http://localhost:3000/mcp"
}
}
}

VS Code (GitHub Copilot)

stdio (.vscode/mcp.json):

{
"servers": {
"n8n-as-code": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@n8n-as-code/mcp"]
}
}
}

HTTP (.vscode/mcp.json):

{
"servers": {
"n8n-as-code": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}

Windsurf

stdio (~/.codeium/windsurf/mcp_config.json):

{
"mcpServers": {
"n8n-as-code": {
"command": "npx",
"args": ["-y", "@n8n-as-code/mcp"]
}
}
}

HTTP (~/.codeium/windsurf/mcp_config.json):

{
"mcpServers": {
"n8n-as-code": {
"serverUrl": "http://localhost:3000/mcp"
}
}
}

Docker

Pre-built images are published to the GitHub Container Registry for every release, in both Node.js and Bun variants:

ghcr.io/etiennelescot/n8nac-mcp:latest # Node.js LTS Alpine
ghcr.io/etiennelescot/n8nac-mcp:latest-bun # Bun Alpine

Quick start

# stdio (for use with docker run via client config)
docker run -i \
-v /path/to/your/workflows:/data \
ghcr.io/etiennelescot/n8nac-mcp:latest

# HTTP transport
docker run -p 3000:3000 \
-v /path/to/your/workflows:/data \
-e MCP_TRANSPORT=http \
ghcr.io/etiennelescot/n8nac-mcp:latest

Environment variables

VariableDefaultDescription
N8N_AS_CODE_PROJECT_DIR/dataWorking directory for n8n workflow files
MCP_TRANSPORTstdioTransport: stdio, http, or sse
MCP_HOST0.0.0.0Bind host for http/sse transport
MCP_PORT3000Bind port for http/sse transport

For the full Docker reference including all image tags, Docker Compose examples, and local build instructions, see the Docker README.

How it works

The MCP server is a thin protocol layer. Every tool call is delegated to the n8nac CLI, which ships with a bundled knowledge index:

MCP Client → @n8n-as-code/mcp → n8nac CLI → bundled knowledge index

No live n8n instance, no network calls — everything runs locally from the installed packages.