Model Context Protocol (MCP) server for n8n workflow automation
N8Net.Mcp is a .NET 8.0 MCP server that provides seamless integration between Claude Desktop and n8n workflow automation platform. This enables you to manage n8n workflows and executions directly through natural language conversations with Claude.
- Workflow Management: Create, retrieve, activate, deactivate, and delete n8n workflows
- Execution Monitoring: View and manage workflow executions with advanced filtering
- Dynamic Node Support: Automatically uses the latest n8n node versions
- Flexible Triggers: Support for webhook, manual, schedule, and various integration triggers (Slack, Telegram, GitHub, Discord, etc.)
- Natural Language Interface: Interact with n8n through conversational commands in Claude Desktop
N8Net.Mcp currently supports the following n8n API operations through MCP tools:
- GetConfiguration - View current n8n configuration and connection status
- GetActiveWorkflowsAsync - List all active workflows with pagination
- GetWorkflowByIdAsync - Get detailed information about a specific workflow
- CreateWorkflowAsync - Create new workflows with custom nodes and triggers
- DeleteWorkflowAsync - Delete a workflow by ID
- ActivateWorkflowAsync - Activate a workflow to enable automatic execution
- DeactivateWorkflowAsync - Deactivate a workflow to prevent automatic execution
- GetExecutionsAsync - List workflow executions with filtering (status, workflow ID, project ID)
- GetExecutionByIdAsync - Get detailed execution information including data
- DeleteExecutionAsync - Delete a specific execution record
- .NET 8.0 SDK
- n8n instance (local or remote) - tested with n8n v1.122.4
- n8n API key
- Claude Desktop application
cd path/to/N8Net.Mcp
dotnet build -c ReleaseAdd the following configuration to your Claude Desktop config file:
Location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
{
"mcpServers": {
"n8net": {
"command": "/usr/local/share/dotnet/dotnet",
"args": [
"/absolute/path/to/N8Net.Mcp/N8Net.Mcp/bin/Release/net8.0/N8Net.Mcp.dll"
],
"env": {
"N8n__ServiceUrl": "http://localhost:5678/api/v1/",
"N8n__ApiKey": "your-n8n-api-key-here",
"ASPNETCORE_ENVIRONMENT": "Production"
}
}
}
}Important:
- Use the absolute path to your dotnet executable (find it with
which dotnet) - Update the DLL path to match your project location
- Replace
your-n8n-api-key-herewith your actual n8n API key - Ensure the
N8n__ServiceUrlmatches your n8n instance URL
After saving the configuration, restart Claude Desktop to load the MCP server.
Retrieves the current n8n configuration (service URL and API key status).
Example: "Show me my n8n configuration"
Lists active workflows from your n8n instance.
Parameters:
limit(optional, default: 10): Number of workflows to retrieve
Example: "Show me my active workflows"
Example: "Get the first 20 active workflows"
Retrieves detailed information about a specific workflow.
Parameters:
workflowId(required): The ID of the workflow
Example: "Get workflow details for workflow ID abc123"
Creates a new workflow in n8n with automatic node configuration.
Parameters:
workflowName(required): Name of the workflowdescription(required): Description of what the workflow doestriggerType(optional, default: "webhook"): Type of trigger to use- Common triggers:
webhook,manual,schedule,slack,telegram,github,discord,gmail,notion, etc.
- Common triggers:
nodes(optional): Nodes to add to the workflow- Format: "3 slack, 1 gmail, 2 notion"
- Supported nodes: slack, gmail, notion, http, code, set, if, switch, webhook, discord, telegram, and many more
Example: "Create a workflow called 'Slack Notifications' that sends messages to Slack"
Example: "Create a workflow with 2 slack nodes and 1 gmail node called 'Email to Slack'"
Example: "Create a manual trigger workflow for data processing"
Note: Workflows with webhook triggers can be activated/deactivated. Use manual trigger for workflows that need to be executed manually.
Deletes a workflow from n8n.
Parameters:
workflowId(required): The ID of the workflow to delete
Example: "Delete workflow xyz789"
Activates a workflow, enabling it to run automatically based on its trigger.
Parameters:
workflowId(required): The ID of the workflow to activate
Example: "Activate workflow abc123"
Deactivates a workflow, preventing it from running automatically.
Parameters:
workflowId(required): The ID of the workflow to deactivate
Example: "Deactivate workflow abc123"
Retrieves a list of workflow executions with advanced filtering options.
Parameters:
limit(optional, default: 5): Number of executions to retrieveincludeData(optional, default: false): Include execution data in responsestatus(optional): Filter by execution status- Values:
error,success,waiting
- Values:
workflowId(optional): Filter by specific workflow IDprojectId(optional): Filter by project ID
Example: "Show me the last 10 executions"
Example: "Get failed executions"
Example: "Show executions for workflow abc123"
Example: "Get all successful executions with data"
Retrieves detailed information about a specific execution.
Parameters:
executionId(required): The ID of the executionincludeData(optional, default: false): Include execution data in response
Example: "Get execution details for exec_456"
Example: "Show execution exec_789 with data"
Deletes a specific execution from n8n.
Parameters:
executionId(required): The ID of the execution to delete
Example: "Delete execution exec_456"
"Create a workflow called 'Process Orders' with a webhook trigger that processes incoming orders"
This creates an activatable workflow that can receive webhook requests.
"Create a schedule trigger workflow called 'Daily Report' that runs every day at 9 AM"
"Create a workflow called 'Slack to Gmail' with description 'Forward Slack messages to Gmail' using webhook trigger with 2 slack nodes and 1 gmail node"
"Show me all failed executions from the last 20 runs"
"Show me my active workflows, then activate workflow abc123"
N8Net.Mcp does not hardcode node type versions. Instead, it allows n8n to automatically use the latest available version of each node type. This ensures compatibility when n8n releases updates and prevents breaking changes.
All requests to the n8n API include the X-N8N-API-KEY header for authentication. The API key is configured through environment variables in the Claude Desktop configuration.
The project uses the Model Context Protocol SDK (ModelContextProtocol v0.4.1-preview.1) to expose n8n functionality as tools that Claude can use. Each tool is marked with the [McpServerTool] attribute and includes detailed descriptions for natural language understanding.
{
"N8n": {
"ServiceUrl": "http://localhost:5678/api/v1/",
"ApiKey": "your-n8n-api-key"
}
}N8n__ServiceUrl: Your n8n instance API URLN8n__ApiKey: Your n8n API key
Environment variables override appsettings.json values and are the recommended approach for Claude Desktop integration.
N8Net.Mcp/
├── N8Net/ # Main MCP server project
│ ├── Services/
│ │ ├── IN8nService.cs # Service interface
│ │ ├── N8nService.cs # MCP tools implementation
│ │ ├── IWorkflowBuilder.cs # Workflow builder interface
│ │ └── WorkflowBuilder.cs # Workflow JSON builder
│ ├── Models/
│ │ ├── N8nConfiguration.cs # Configuration model
│ │ └── Workflow/ # Workflow domain models
│ ├── Extensions/
│ │ └── ServiceCollectionExtensions.cs # DI setup
│ └── Program.cs # Application entry point
├── N8Net.Tests/ # Unit tests
│ ├── Services/
│ │ └── N8nServiceTests.cs # Service tests
│ ├── Extensions/
│ │ └── ServiceCollectionExtensionsTests.cs
│ └── Models/
│ └── N8nConfigurationTests.cs
└── N8Net.Client/ # Future: Client library
N8Net.Mcp writes detailed logs to help with debugging and monitoring:
Log Path: ~/.n8net/logs/n8net-YYYYMMDD.log
Example: ~/.n8net/logs/n8net-20251216.log
The log file includes:
- Service initialization and configuration
- All n8n API calls and responses
- Errors with full stack traces
- MCP tool invocations
- Debug information for troubleshooting
# View today's log
cat ~/.n8net/logs/n8net-$(date +%Y%m%d).log
# Follow log in real-time
tail -f ~/.n8net/logs/n8net-$(date +%Y%m%d).log
# View last 50 lines
tail -50 ~/.n8net/logs/n8net-$(date +%Y%m%d).logLogs are automatically rotated daily and kept for 7 days.
- Check the logs:
cat ~/.n8net/logs/n8net-$(date +%Y%m%d).log - Look for initialization errors in the log file
- Verify configuration: Ensure API key and service URL are correct
- Check n8n is running:
curl http://localhost:5678/api/v1/workflows?limit=1 -H "X-N8N-API-KEY: your-key"
Use the absolute path to dotnet in your Claude Desktop config. Find it with:
which dotnetMake sure you're running the pre-built DLL directly, not using dotnet run. Always build first:
dotnet build -c ReleaseThis has been fixed in the current version. The server no longer sends read-only fields like active, versionId, id, meta, or tags during workflow creation.
Verify that:
- Your n8n instance is running
- The
N8n__ServiceUrlis correct - The API endpoint is accessible
The project includes comprehensive unit tests. See N8Net.Tests/README.md for details.
Run tests:
dotnet testRun tests with custom configuration:
N8n__ServiceUrl="http://localhost:5678/api/v1/" \
N8n__ApiKey="your-api-key" \
dotnet testContributions are welcome! Please feel free to submit issues and pull requests.
This project is licensed under the MIT License.