npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@davidfei/n8n-mcp

v1.0.1

Published

MCP server for managing n8n workflows

Downloads

7

Readme

n8n MCP Server

A Model Context Protocol (MCP) server for managing n8n workflows on your self-hosted n8n instance. This server enables AI assistants like Claude to interact with your n8n workflows through a standardized interface.

Features

  • Workflow Management: List, create, update, and delete workflows
  • Workflow Control: Activate, deactivate, and execute workflows
  • Execution Monitoring: List and inspect workflow executions
  • Credentials Access: View available credentials (without sensitive data)
  • Full API Coverage: Comprehensive support for n8n API operations

Prerequisites

  • Node.js 18 or higher
  • A self-hosted n8n instance
  • n8n API key (generated from your n8n instance)

Installation

  1. Clone or download this repository
  2. Install dependencies:
npm install
  1. Build the project:
npm run build

Configuration

The server requires two environment variables:

  • N8N_BASE_URL: The base URL of your n8n instance (e.g., https://n8n.example.com/api/v1)
  • N8N_API_KEY: Your n8n API key

Getting your n8n API Key

  1. Log in to your n8n instance
  2. Go to Settings → API
  3. Click "Create API Key"
  4. Copy the generated key

Usage with Claude Desktop

Add this to your Claude Desktop configuration file:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "n8n": {
      "command": "node",
      "args": ["/path/to/n8n-mcp-server/build/index.js"],
      "env": {
        "N8N_BASE_URL": "https://your-n8n-instance.com/api/v1",
        "N8N_API_KEY": "your-api-key-here"
      }
    }
  }
}

Usage with Claude Code

To use this MCP server with Claude Code (the CLI tool), you can add it using the claude mcp add command.

Installation

First, install the package from npm:

npm install @davidfei/n8n-mcp

Or install globally:

npm install -g @davidfei/n8n-mcp

Adding to Claude Code

Use the claude mcp add command to register this MCP server with Claude Code:

claude mcp add n8n \
  --command node \
  --args "node_modules/@davidfei/n8n-mcp/build/index.js" \
  --env N8N_BASE_URL="https://your-n8n-instance.com/api/v1" \
  --env N8N_API_KEY="your-api-key-here"

Or if installed globally:

claude mcp add n8n \
  --command n8n-mcp-server \
  --env N8N_BASE_URL="https://your-n8n-instance.com/api/v1" \
  --env N8N_API_KEY="your-api-key-here"

Verifying Installation

Check that the MCP server was added successfully:

claude mcp list

You should see n8n in the list of available MCP servers.

Using with Claude Code

Once added, you can interact with your n8n workflows directly within Claude Code. Claude will automatically have access to all 13 tools provided by this MCP server:

  • Workflow Management: List, create, update, and delete workflows
  • Workflow Control: Activate, deactivate, and execute workflows
  • Execution Monitoring: List and inspect workflow executions
  • Credentials Access: View available credentials

For more information about managing MCP servers with Claude Code, see the Claude Code documentation.

Available Tools

Workflow Management

list_workflows

List all workflows in your n8n instance.

Parameters:

  • active (optional): Filter by active status ("true" or "false")

Example:

List all active workflows

get_workflow

Get details of a specific workflow.

Parameters:

  • workflow_id (required): The workflow ID

Example:

Show me workflow 123

create_workflow

Create a new workflow.

Parameters:

  • name (required): Workflow name
  • nodes (required): JSON string of workflow nodes
  • connections (required): JSON string of workflow connections
  • active (optional): Whether to activate immediately (default: false)
  • settings (optional): JSON string of workflow settings

Example:

Create a new workflow called "Data Sync" with these nodes...

update_workflow

Update an existing workflow.

Parameters:

  • workflow_id (required): The workflow ID
  • name (optional): New workflow name
  • nodes (optional): JSON string of updated nodes
  • connections (optional): JSON string of updated connections
  • active (optional): Activation status
  • settings (optional): JSON string of workflow settings

Example:

Update workflow 123 to change its name to "New Name"

delete_workflow

Delete a workflow.

Parameters:

  • workflow_id (required): The workflow ID

Example:

Delete workflow 123

Workflow Control

activate_workflow

Activate a workflow.

Parameters:

  • workflow_id (required): The workflow ID

Example:

Activate workflow 123

deactivate_workflow

Deactivate a workflow.

Parameters:

  • workflow_id (required): The workflow ID

Example:

Deactivate workflow 123

execute_workflow

Manually execute a workflow.

Parameters:

  • workflow_id (required): The workflow ID
  • data (optional): JSON string of input data

Example:

Execute workflow 123 with this data: {"name": "test"}

Execution Monitoring

list_executions

List workflow executions.

Parameters:

  • workflow_id (optional): Filter by workflow ID
  • status (optional): Filter by status ("success", "error", "waiting", "running")
  • limit (optional): Maximum number of results (default: 20)

Example:

Show me the last 10 failed executions

get_execution

Get details of a specific execution.

Parameters:

  • execution_id (required): The execution ID

Example:

Show me execution 456

delete_execution

Delete an execution.

Parameters:

  • execution_id (required): The execution ID

Example:

Delete execution 456

Credentials

list_credentials

List all credentials (without sensitive data).

Example:

Show me all available credentials

Example Workflows

Simple HTTP Request Workflow

{
  "name": "Simple HTTP Request",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [250, 300]
    },
    {
      "parameters": {
        "url": "https://api.example.com/data",
        "options": {}
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [450, 300]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Development

Watch Mode

For development with auto-rebuild:

npm run dev

Building

npm run build

Testing

You can test the server by running it directly:

N8N_BASE_URL=https://your-n8n-instance.com/api/v1 \
N8N_API_KEY=your-api-key \
npm start

Troubleshooting

Connection Issues

  • Verify your N8N_BASE_URL includes the /api/v1 path
  • Check that your API key is valid
  • Ensure your n8n instance is accessible from the machine running the MCP server

Authentication Errors

  • Regenerate your API key in n8n settings
  • Verify the API key is correctly set in the environment variables

Workflow Execution Fails

  • Check that the workflow is properly activated
  • Verify all required credentials are configured in n8n
  • Review execution logs using get_execution

Security Notes

  • Keep your API key secure and never commit it to version control
  • Use environment variables or secure secret management
  • The list_credentials tool does not expose sensitive credential data
  • Consider using n8n's permission system to limit API key access

API Documentation

For more information about the n8n API, see:

License

MIT

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.