The n8n MCP Tools server enables seamless integration between n8n workflows and AI assistants using the Model Context Protocol (MCP). This implementation provides access to n8n's complete Public API through a set of specialized tools that AI assistants can use via natural language.
The easiest way to get started is to install the package globally:
# Install globally
npm install -g n8n-mcp-tools
# Create a .env file in your working directory
echo "N8N_API_BASE_URL=https://your-n8n-instance.com/api/v1
N8N_API_KEY=your-api-key
PORT=3000" > .env
# Start the MCP server
n8n-mcp-server
Alternatively, you can clone and set up the repository directly:
Clone the repository:
git clone https://github.com/yourusername/n8n-mcp-tools.git
cd n8n-mcp-tools
Install dependencies:
npm install
Create a .env
file with your configuration:
N8N_API_BASE_URL=https://your-n8n-instance.com/api/v1
N8N_API_KEY=your-api-key
PORT=3000
Start the server:
npm start
Access the API documentation at:
http://localhost:3000/api-docs
The server can be configured using environment variables:
N8N_API_BASE_URL
: Base URL for the n8n APIN8N_API_KEY
: API key for authenticationPORT
: Port to run the server onHOST
: Host to bind the server toLOG_LEVEL
: Logging level (info, error, debug)MCP_SOCKET_PATH
: Path for the MCP socket (for STDIO transport)MCP_USE_TCP
: Whether to use TCP for MCP transportMCP_TCP_PORT
: TCP port for MCP transportMCP_TCP_HOST
: TCP host for MCP transportThe server provides multiple tool categories that enable AI assistants to interact with n8n:
The server also includes tools for:
To fetch all workflows from your n8n instance using an AI assistant:
Ask the AI: "Get all my workflows from n8n"
Behind the scenes, the AI assistant will use the get-workflows
tool provided by the MCP server.
To create a new workflow:
Ask the AI: "Create a new workflow called 'Email Notification' with the tag 'communication'"
The AI assistant will use the create-workflow
tool, passing the appropriate parameters.
To activate a specific workflow:
Ask the AI: "Activate the workflow with ID 5"
The assistant will utilize the activate-workflow
tool to perform this action.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.