n8n MCP Server
A Model Context Protocol (MCP) server that allows AI assistants to interact with n8n workflows through natural language.
Overview
This project provides a Model Context Protocol (MCP) server that empowers AI assistants to seamlessly interact with n8n, a popular workflow automation tool. It acts as a bridge, enabling AI assistants to programmatically manage and control n8n workflows and executions using natural language commands.
Installation
Prerequisites
- Node.js 20 or later
- n8n instance with API access enabled
Install from npm
Install from source
Docker Installation
You can also run the server using Docker:
Updating the Server
How you update the server depends on how you initially installed it.
1. Installed globally via npm
If you installed the server using npm install -g @leonardsellem/n8n-mcp-server
:
- Open your terminal or command prompt.
- Run the following command to get the latest version:
- If the server is currently running (e.g., as a background process or service), you'll need to restart it for the changes to take effect.
2. Installed from source
If you cloned the repository and installed from source:
- Open your terminal or command prompt.
- Navigate to the directory where you cloned the project:
- If you've made any local changes to the code that you want to keep, consider stashing them (optional):You can apply them later with
git stash pop
. - Pull the latest changes from the repository (assuming you are on the
main
branch):If you are on a different branch, replacemain
with your branch name. - Install or update any changed dependencies:
- Rebuild the project to include the latest updates:
- If you previously installed it globally from this source folder using
npm install -g .
, you might want to run this command again to update the global link: - Restart the server.
- If you run the server directly using a command like
node build/index.js
in your AI assistant's MCP configuration, ensure the path is still correct. Usingnpm install -g .
and thenn8n-mcp-server
as the command should keep this consistent.
- If you run the server directly using a command like
3. Using Docker
If you are running the server using Docker:
- Pull the latest image from Docker Hub:
- Stop and remove your old container. You'll need your container's name or ID (you can find it using
docker ps
): - Start a new container with the updated image. Use the same
docker run
command you used previously, including all your necessary environment variables (refer to the "Docker Installation" section for an example command). For instance:Ensure you use:latest
or the specific version tag you intend to run.
Configuration
Create a .env
file in the directory where you'll run the server, using .env.example
as a template:
Configure the following environment variables:
Variable | Description | Example |
---|---|---|
N8N_API_URL | Full URL of the n8n API, including /api/v1 | http://localhost:5678/api/v1 |
N8N_API_KEY | API key for authenticating with n8n | n8n_api_... |
N8N_WEBHOOK_USERNAME | Username for webhook authentication (if using webhooks) | username |
N8N_WEBHOOK_PASSWORD | Password for webhook authentication | password |
DEBUG | Enable debug logging (optional) | true or false |
Generating an n8n API Key
- Open your n8n instance in a browser
- Go to Settings > API > API Keys
- Create a new API key with appropriate permissions
- Copy the key to your
.env
file
Usage
Running the Server
From the installation directory:
Or if installed globally:
Integrating with AI Assistants
After building the server (npm run build
), you need to configure your AI assistant (like VS Code with the Claude extension or the Claude Desktop app) to run it. This typically involves editing a JSON configuration file.
Example Configuration (e.g., in VS Code settings.json
or Claude Desktop claude_desktop_config.json
):
Key Points:
- Replace
/path/to/your/cloned/n8n-mcp-server/
with the actual absolute path where you cloned and built the repository. - Use the correct path separator for your operating system (forward slashes
/
for macOS/Linux, double backslashes\\
for Windows). - Ensure you provide the correct
N8N_API_URL
(including/api/v1
) andN8N_API_KEY
. - The server needs to be built (
npm run build
) before the assistant can run thebuild/index.js
file.
Available Tools
The server provides the following tools:
Using Webhooks
This MCP server supports executing workflows through n8n webhooks. To use this functionality:
- Create a webhook-triggered workflow in n8n.
- Set up Basic Authentication on your webhook node.
- Use the
run_webhook
tool to trigger the workflow, passing just the workflow name.
Example:
The webhook authentication is handled automatically using the N8N_WEBHOOK_USERNAME
and N8N_WEBHOOK_PASSWORD
environment variables.
Workflow Management
workflow_list
: List all workflowsworkflow_get
: Get details of a specific workflowworkflow_create
: Create a new workflowworkflow_update
: Update an existing workflowworkflow_delete
: Delete a workflowworkflow_activate
: Activate a workflowworkflow_deactivate
: Deactivate a workflow
Execution Management
execution_run
: Execute a workflow via the APIrun_webhook
: Execute a workflow via a webhookexecution_get
: Get details of a specific executionexecution_list
: List executions for a workflowexecution_stop
: Stop a running execution
Resources
The server provides the following resources:
n8n://workflows/list
: List of all workflowsn8n://workflow/{id}
: Details of a specific workflown8n://executions/{workflowId}
: List of executions for a workflown8n://execution/{id}
: Details of a specific execution
Roadmap
The n8n MCP Server is a community-driven project, and its future direction will be shaped by your feedback and contributions!
Currently, our roadmap is flexible and under continuous development. We believe in evolving the server based on the needs and ideas of our users.
We encourage you to get involved in shaping the future of this tool:
- Suggest Features: Have an idea for a new tool, resource, or improvement?
- Discuss Priorities: Want to weigh in on what we should focus on next?
Please share your thoughts, feature requests, and ideas by opening an issue on our GitHub Issues page. Let's build a powerful tool for AI assistants together!
Development
Building
Running in Development Mode
Testing
Linting
Contributing
We welcome contributions from the community and are excited to see how you can help improve the n8n MCP Server! Whether you're fixing a bug, proposing a new feature, or improving documentation, your help is valued.
Reporting Bugs
If you encounter a bug, please report it by opening an issue on our GitHub Issues page.
When submitting a bug report, please include the following:
- A clear and descriptive title.
- A detailed description of the problem, including steps to reproduce the bug.
- Information about your environment (e.g., Node.js version, n8n MCP Server version, operating system).
- Any relevant error messages or screenshots.
Suggesting Enhancements
We're always looking for ways to make the server better. If you have an idea for an enhancement or a new feature, please open an issue on our GitHub Issues page.
Please provide:
- A clear and descriptive title for your suggestion.
- A detailed explanation of the proposed enhancement and why it would be beneficial.
- Any potential use cases or examples.
Submitting Pull Requests
If you'd like to contribute code, please follow these steps:
- Fork the repository: Create your own fork of the n8n-mcp-server repository.
- Create a branch: Create a new branch in your fork for your changes (e.g.,
git checkout -b feature/your-feature-name
orbugfix/issue-number
). - Make your changes: Implement your feature or bug fix.
- Ensure your code adheres to the existing coding style. (We use Prettier for formatting, which can be run with
npm run lint
). - Include tests for your changes if applicable. You can run tests using
npm test
.
- Ensure your code adheres to the existing coding style. (We use Prettier for formatting, which can be run with
- Commit your changes: Write clear and concise commit messages.
- Push to your fork: Push your changes to your forked repository.
- Open a Pull Request (PR): Submit a PR to the
main
branch of the officialn8n-mcp-server
repository.- Provide a clear title and description for your PR, explaining the changes you've made and referencing any related issues.
We'll review your PR as soon as possible and provide feedback. Thank you for your contribution!
License
🚀 Join Our Team: Call for Co-Maintainers!
This project is a vibrant, community-driven tool actively used by AI enthusiasts and developers. Currently, it's maintained on a part-time basis by a passionate individual who isn't a seasoned engineer but is dedicated to bridging AI with workflow automation. To help this project flourish, ensure its long-term health, and keep up with its growing user base, we're looking for enthusiastic co-maintainers to join the team!
Why Contribute?
- Learn and Grow: Sharpen your skills in areas like TypeScript, Node.js, API integration, and AI tool development.
- Collaborate: Work alongside other motivated developers and AI users.
- Make an Impact: Directly shape the future of this project and help build a valuable tool for the AI community.
- Open Source: Gain experience contributing to an open-source project.
How You Can Help
We welcome contributions in many forms! Here are some areas where you could make a big difference:
- Bug Fixing: Help us identify and squash bugs to improve stability.
- Feature Development: Implement new tools and functionalities based on user needs and your ideas.
- Documentation: Improve our guides, examples, and API references to make the project more accessible.
- Testing: Enhance our test suite (unit, integration) to ensure code quality and reliability.
- CI/CD: Help streamline our development and deployment pipelines.
- Code Reviews: Provide feedback on pull requests and help maintain code standards.
- Community Support: Assist users with questions and help manage discussions.
Get Involved!
If you're excited about the intersection of AI and workflow automation, and you're looking for a rewarding open-source opportunity, we'd love to hear from you!
Ready to contribute?
- Check out our GitHub Issues page to find existing tasks, suggest new ideas, or express your interest in becoming a co-maintainer.
- You can open an issue titled "Co-maintainer Application" to formally apply, or simply start contributing to existing issues.
- Alternatively, feel free to reach out to the existing maintainers if you have questions.
Let’s build the future of AI-powered workflow automation together! 🙌
Thanks to the community for the support!
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.
AI 어시스턴트가 자연어를 통해 n8n 워크플로와 상호 작용할 수 있도록 하는 모델 컨텍스트 프로토콜 서버로, 워크플로 나열, 생성, 업데이트, 실행 및 모니터링과 같은 작업을 지원합니다.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants to interact with n8n workflows through natural language, providing access to n8n's complete API functionality including workflow management, user administration, and credential handling.Last updated -95MIT License
- -securityFlicense-qualityA comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.Last updated -71
- -securityFlicense-qualityA Model Context Protocol server that enables AI agents to interact with n8n workflows and automation tools through a standardized interface, allowing execution of workflows and access to n8n functions.Last updated -
- -securityAlicense-qualityA Model Context Protocol server that allows AI agents to interact with n8n workflows through natural language, enabling workflow management and execution via SSE connections.Last updated -786MIT License