n8n
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"peakviker-mcpn8n": {
"command": "uvicorn",
"args": [
"mcp_server:app",
"--reload",
"--port",
"8080"
],
"env": {
"N8N_URL": "http://localhost:5678/api/v1/",
"N8N_API_KEY": "YOUR_N8N_API_KEY",
"N8N_TIMEOUT": "30.0"
}
}
}
}You run an MCP (Model Context Protocol) server to manage n8n workflows through a dedicated HTTP interface and an SSE-based response channel. This server lets you list, create, update, delete, and run workflows, and to monitor execution status, all from an MCP client. It is designed to be run locally and connected to your n8n instance via REST API calls secured by an API token if needed.
How to use
You interact with the MCP server through a client that sends MCP requests to the server. The core actions you can perform include listing available workflows, creating new ones, updating or deleting existing workflows, starting a workflow run, and checking the status of a running execution. All responses are delivered asynchronously via the server’s SSE stream, with results containing the MCP-formatted data retrieved from n8n.
To start a workflow or check status, ensure your MCP client is configured to point at the MCP server you run locally or remotely, and that your n8n instance is accessible via REST API with any required API key. Use the standard start and monitor patterns to execute workflows and track their progress over time.
How to install
Prerequisites you need on your machine before installing the MCP server:
-
Python 3.10 or newer
-
A running n8n instance with REST API enabled and an API token if you require authenticated access
Install and run the MCP server
Clone the repository and navigate to the project directory.
git clone https://github.com/Peakviker/MCPn8n.git
cd MCPn8n
Create a virtual environment and install dependencies.
python -m venv .venv
source .venv/bin/activate
pip install fastapi uvicorn[standard] sse-starlette httpx python-dotenv
Copy the example configuration and set environment variables for your n8n instance.
cp .env.example .env
# Edit values as needed
Start the MCP server. This runs locally on port 8080 and enables hot reload for development.
uvicorn mcp_server:app --reload --port 8080
Optional: verify the server is up and responding on its health and discovery endpoints.
curl http://localhost:8080/healthz
curl http://localhost:8080/mcp/discover
Configuration and environment
Configure the connection to n8n by setting these environment variables (you can place them in a .env file or export them in your shell):
N8N_URL=http://localhost:5678/api/v1/
N8N_API_KEY=YOUR_N8N_API_KEY
N8N_TIMEOUT=30.0
In addition, you may pass these values to the MCP client so it can authenticate and reach n8n as needed.
Notes and troubleshooting
-
Ensure your Python version matches the minimum requirement and that the virtual environment is activated when you install dependencies.
-
If you modify configuration, restart the MCP server to apply changes.
-
If you encounter connectivity issues to n8n, verify the N8N_URL and N8N_API_KEY values and confirm that the n8n REST API is reachable from the MCP server host.
Available tools
list_workflows
List workflows in n8n via GET /rest/workflows, supports pagination/limits as defined by the MCP request.
create_workflow
Create a new workflow in n8n via POST /rest/workflows with the provided workflow payload.
update_workflow
Update an existing workflow in n8n via PATCH /rest/workflows/{id} with new properties.
delete_workflow
Delete a workflow in n8n via DELETE /rest/workflows/{id}.
run_workflow
Trigger execution of a workflow via POST /rest/workflows/run with the specified run data.
get_execution_status
Query the status of a running or completed workflow execution via GET /rest/executions/{id}.
healthz
Health check endpoint to verify MCP server is running.
discover
Endpoint to expose MCP discovery information for clients.