Provides comprehensive workflow management capabilities for n8n instances, including creating, updating, deleting, and executing workflows, managing workflow activation states, and retrieving webhook URLs for integration with external systems.
n8n-mcp
An MCP (Model Context Protocol) server for managing n8n workflows. This server allows AI agents to create, retrieve, update, and manage n8n workflows through the n8n API.
Features
Workflow Management
- List Workflows: Get all workflows from your n8n instance
- Get Workflow: Retrieve a specific workflow by ID
- Create Workflow: Create new workflows with nodes and connections
- Update Workflow: Modify existing workflows
- Delete Workflow: Remove workflows
- Activate/Deactivate: Control workflow execution state
- Credential Management: List credentials and resolve credential aliases
- Credential Aliasing: Use human-friendly names for credentials in workflows
- Source Control: Pull changes from source control to sync with remote
- Get Credential Schema: Fetch JSON schema for credential types to validate or drive UIs
- Transfer Workflows: Move workflows across projects or owners
- Transfer Credentials: Move credentials across projects or owners
- List Executions: Get workflow executions with pagination support
- Get Execution: Retrieve specific execution details by ID
- Delete Execution: Remove execution records
Tags Management
- Tags CRUD: Create, read, update, and delete tags with pagination support
- List Tags: Get all tags with optional pagination
- Create Tag: Create new tags with name and optional color
- Update Tag: Update existing tag name and/or color
- Delete Tag: Remove tags by ID
Variables Management
- List Variables: Get all variables with pagination support
- Create Variable: Create new key-value variables (enforces unique keys)
- Update Variable: Modify existing variable values
- Delete Variable: Remove variables
- CLI & MCP Support: Full access via both command line and MCP tools
Installation
From GitHub Packages
From Source
Configuration
Set the following environment variables:
Option 1: API Key Authentication
Option 2: Basic Authentication
Usage
As an MCP Server
The server runs on stdio and implements the MCP protocol for integration with AI agents.
As a CLI Tool
For testing and development, you can use the CLI interface:
Available Tools
Workflow Tools
- list_workflows - List all workflows
- get_workflow - Get workflow by ID
- create_workflow - Create a new workflow
- update_workflow - Update existing workflow (supports optional optimistic concurrency)
- delete_workflow - Delete a workflow
- activate_workflow - Activate a workflow
- deactivate_workflow - Deactivate a workflow
- deactivate_workflow - Deactivate a workflow
- list_credentials - List all credentials
- resolve_credential_alias - Resolve a credential alias to its ID
- source_control_pull - Pull changes from source control
- get_credential_schema - Get JSON schema for a credential type
- list_workflow_tags - List tags for a specific workflow
- set_workflow_tags - Set tags for a specific workflow
- transfer_workflow - Transfer a workflow to a different project or owner
- transfer_credential - Transfer a credential to a different project or owner
- list_executions - List workflow executions with pagination
- get_execution - Get execution by ID
- delete_execution - Delete an execution
- webhook_urls - Get webhook URLs for a webhook node
- run_once - Execute a workflow manually once
Variables Tools
- list_variables - List all variables with pagination support
- create_variable - Create a new variable (requires unique key)
- update_variable - Update an existing variable value
- delete_variable - Delete a variable
Tag Tools
- list_tags - List all tags with optional pagination
- get_tag - Get tag by ID
- create_tag - Create a new tag
- update_tag - Update existing tag
- delete_tag - Delete a tag
Optimistic Concurrency for Updates
The update_workflow
tool supports optional optimistic concurrency control via the ifMatch
parameter:
When ifMatch
is provided:
- The request includes an
If-Match
header with the provided value - If the workflow has been modified by another user (412 Precondition Failed), you'll receive a clear error message
- This helps prevent conflicting updates in multi-user environments
Example Workflow Creation
Basic Workflow with Credential IDs
Workflow with Credential Aliases
You can now use human-friendly credential names instead of IDs:
The system will automatically resolve "my-api-credentials"
to the appropriate credential ID before creating or updating the workflow.
Credential Management
Listing Credentials
Use the list_credentials
tool to see all available credentials in your n8n instance:
Resolving Credential Aliases
Use the resolve_credential_alias
tool to resolve a credential name to its ID:
Alias Resolution Rules
- Unique Match: If exactly one credential matches the alias, it returns the credential ID
- No Match: Throws an error if no credentials match the alias
- Multiple Matches: Throws an error if multiple credentials have the same name
- Numeric Values: Credential values that are all digits are treated as IDs and left unchanged
Transfer Operations (Enterprise)
The transfer tools allow moving workflows and credentials across projects and owners in enterprise n8n setups:
Transfer Workflow
Transfer Credential
Note: Transfer operations require:
- Enterprise n8n installation with project/ownership features enabled
- Appropriate permissions for the user performing the transfer
- Valid target project IDs and user IDs
Permission errors will be returned with clear error messages if the operation is not allowed.
Tag Management
Tags are used to organize and group workflows in n8n. The MCP server provides comprehensive tag management capabilities:
Tag Operations
- List Tags: Get all tags with optional pagination
- Get Tag: Retrieve a specific tag by ID
- Create Tag: Create a new tag with name and optional color
- Update Tag: Modify tag name and/or color
- Delete Tag: Remove a tag
Tag Examples
The tag API supports:
- Pagination: Use
limit
andcursor
parameters when listing tags - Color Support: Optional hex color codes for visual organization
- Error Handling: Proper 409 responses for duplicate names, 404 for missing tags
Example Variable Management
Variables in n8n are simple key-value pairs that can be used for configuration and state management:
CLI Usage Examples
MCP Tool Usage
Variables can be managed through MCP tools for integration with AI agents:
list_variables()
- Returns paginated list of all variablescreate_variable({ key: "config_mode", value: "advanced" })
- Creates new variableupdate_variable({ id: "var-123", value: "new_value" })
- Updates existing variabledelete_variable({ id: "var-123" })
- Removes variable
Execution Management
The server provides comprehensive execution management capabilities:
Listing Executions
The list_executions
tool supports:
- limit: Maximum number of executions to return (pagination)
- cursor: Pagination cursor for getting next/previous pages
- workflowId: Filter executions by specific workflow ID
Getting Execution Details
Returns complete execution data including:
- Execution status and timing
- Input/output data
- Error details (if failed)
- Node execution results
Deleting Executions
Permanently removes execution records to help manage storage.
Pagination Notes
When listing executions:
- Use
limit
parameter to control page size - Use
nextCursor
from response to get the next page - Cursors are opaque strings - store and use them as-is
- Empty
nextCursor
indicates no more pages available
Webhook URLs
The webhook_urls
tool helps you get the correct webhook URLs for webhook nodes in your workflows. This is useful for:
- Getting URLs to configure external systems that need to call your webhooks
- Testing webhook endpoints during development
- Documentation and integration guides
Prerequisites for Webhook Nodes
For the webhook_urls
tool to work correctly, your webhook node must:
- Be of type
n8n-nodes-base.webhook
- Have a
path
parameter configured - Be part of an existing workflow
URL Format
The tool returns URLs in n8n's standard format:
- Test URL:
${baseUrl}/webhook-test/${path}
- Used for testing during workflow development - Production URL:
${baseUrl}/webhook/${path}
- Used when the workflow is active
Example Usage
Manual Workflow Execution
The run_once
tool allows you to manually execute workflows, which is useful for:
- Testing workflows during development
- Triggering workflows programmatically
- Running workflows with specific input data
- Debugging workflow issues
Workflow Types
The tool handles different workflow types gracefully:
- Manual Workflows: Workflows that start with manual triggers (e.g., Start node)
- Trigger Workflows: Workflows with automatic triggers (e.g., Webhook, Cron, etc.)
Input Data
You can optionally provide input data when executing a workflow:
Response Format
The tool returns execution details:
Development
Setup
Testing
Scripts
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
All contributions are welcome! Please make sure to update tests as appropriate and follow the existing code style.
Releases
This project uses automated releases. When a new release is published on GitHub:
- The release workflow automatically triggers
- The package is built and tested
- If all tests pass, the package is published to GitHub Packages
- The package can then be installed using:
npm install @get2knowio/n8n-mcp
To create a new release:
- Update the version in
package.json
- Create a new release on GitHub with a tag matching the version
- The automated workflow will handle the rest
License
MIT
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI agents to create, retrieve, update, and manage n8n workflows through the n8n API. Supports full workflow lifecycle management including activation, deactivation, and deletion operations.