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

@j_mcnally/n8n-nodes-claudecode

v0.3.1

Published

n8n node for Claude Code SDK integration with MCP support

Downloads

10

Readme

🚀 Claude Code for n8n

Bring the power of Claude Code directly into your n8n automation workflows!

Imagine having an AI coding assistant that can analyze your codebase, fix bugs, write new features, manage databases, interact with APIs, and automate your entire development workflow - all within n8n. That's exactly what this node enables.

n8n Claude Code npm License

🌟 What Can You Build?

🔧 Automated Code Reviews

Create workflows that automatically review pull requests, suggest improvements, and even fix issues before merging.

🐛 Intelligent Bug Fixing

Connect error monitoring tools to Claude Code - automatically diagnose and fix production issues in real-time.

📊 Database Management

Let Claude Code write complex SQL queries, optimize database schemas, and generate migration scripts based on your requirements.

🤖 Self-Improving Workflows

Build n8n workflows that can modify and improve themselves using Claude Code's capabilities.

📝 Documentation Generation

Automatically generate and update documentation for your entire codebase, APIs, or databases.

🔄 Code Migration

Automate the migration of legacy codebases to modern frameworks with intelligent refactoring.

🎫 Customer Support Automation

Transform support tickets into code fixes automatically:

  • Analyze customer bug reports and reproduce issues
  • Generate fixes for reported problems
  • Create test cases to prevent regression
  • Update documentation based on common questions
  • Auto-respond with workarounds while fixes are deployed

⚡ Quick Start

Prerequisites

  1. Claude Code CLI (required on your n8n server):
    npm install -g @anthropic-ai/claude-code
    claude  # Authenticate (requires Claude Pro/Team subscription)

Install in n8n

Option 1: Via n8n UI (Recommended)

  1. Open your n8n instance
  2. Go to SettingsCommunity Nodes
  3. Click Install a community node
  4. Enter: @j_mcnally/n8n-nodes-claudecode
  5. Click Install
  6. Restart n8n when prompted

Option 2: Manual Installation

cd ~/.n8n/nodes
npm install @j_mcnally/n8n-nodes-claudecode
# Restart n8n

Option 3: Docker

docker run -it --rm \
  -p 5678:5678 \
  -e SHELL=/bin/bash \
  -e ANTHROPIC_API_KEY=your_api_key_here \
  -e N8N_COMMUNITY_NODE_PACKAGES=@j_mcnally/n8n-nodes-claudecode \
  -v ~/.n8n:/home/node/.n8n \
  -v /path/to/your/projects:/projects \
  n8nio/n8n

Important for Docker users: The Claude Code SDK requires a properly configured shell environment. See DOCKER_DEPLOYMENT.md for detailed Docker setup instructions, including custom Dockerfiles and docker-compose configurations.

📦 NPM Package: @j_mcnally/n8n-nodes-claudecode

🎯 Real-World Use Cases

1. GitHub Issue to Code

Webhook (GitHub Issue) → Claude Code → Create PR → Notify Slack

Automatically implement features or fix bugs when issues are created.

2. Database Query Builder

Form Trigger → Claude Code → Execute Query → Send Results

Natural language to SQL - let non-technical users query databases safely.

3. Code Quality Guardian

Git Push → Claude Code → Analyze Code → Block/Approve → Notify

Enforce coding standards and catch issues before they reach production.

4. API Integration Builder

HTTP Request → Claude Code → Generate Integration → Test → Deploy

Automatically create integrations with third-party APIs.

5. Intelligent Log Analysis

Error Logs → Claude Code → Diagnose → Create Fix → Open PR

Turn error logs into actionable fixes automatically.

6. Customer Support to Code Fix

Support Ticket → Claude Code → Reproduce Issue → Generate Fix → Test → Deploy → Auto-Reply

Transform customer complaints into deployed fixes in minutes, not days.

🛠️ Powerful Features

Claude 4-5 Models (New in v0.3.0)

Choose the right model for your task:

  • Sonnet 4.5 (Recommended): Latest balanced model - excellent for most coding tasks with optimal speed and capability
  • Opus 4.5: Most capable model - ideal for highly complex tasks, deep analysis, and critical decision-making
  • Haiku 4: Fast and efficient - perfect for simple tasks, quick code generation, and rapid iterations

Project Context Awareness

Set a project path and Claude Code understands your entire codebase context:

  • Analyzes existing code patterns
  • Follows your coding standards
  • Understands your architecture
  • Respects your dependencies

Tool Arsenal

Claude Code comes equipped with powerful tools:

  • 📁 File Operations: Read, write, edit multiple files
  • 💻 Bash Commands: Execute any command
  • 🔍 Smart Search: Find patterns across your codebase
  • 🌐 Web Access: Fetch documentation and resources
  • 📊 Database Access: Via MCP servers
  • 🔗 API Integration: GitHub, Slack, and more via MCP

Model Context Protocol (MCP) (Enhanced in v0.3.1)

Extend Claude Code with specialized capabilities:

  • PostgreSQL/MySQL database access
  • GitHub repository management
  • Slack workspace integration
  • Custom tool development

New: Full support for loading MCP servers from:

  • User-level: ~/.claude.json (your personal MCP servers available across all workflows)
  • Project-level: .mcp.json (project-specific MCP servers)
  • Local: .claude/settings.local.json (personal overrides, not shared with team)

📋 Configuration Examples

Simple Code Analysis

{
  "operation": "query",
  "prompt": "Analyze this codebase and suggest performance improvements",
  "projectPath": "/path/to/your/project",
  "model": "sonnet"  // Claude Sonnet 4.5 - Latest model
}

Advanced Database Operations

{
  "operation": "query",
  "prompt": "Create an optimized query to find users who haven't logged in for 30 days",
  "projectPath": "/path/to/project",
  "model": "sonnet"  // Claude Sonnet 4.5 recommended for complex tasks
}

Customer Support Automation

{
  "operation": "query",
  "prompt": "Customer reports: 'Login button not working on mobile devices'\n\nAnalyze this issue, find the root cause, and create a fix",
  "projectPath": "/path/to/web-app",
  "model": "sonnet",  // Claude Sonnet 4.5 - Best for complex debugging
  "allowedTools": ["Read", "Write", "Edit", "Bash", "Grep"],
  "additionalOptions": {
    "systemPrompt": "Focus on mobile compatibility issues. Check responsive CSS and JavaScript event handlers."
  }
}

MCP Server Configuration (New in v0.3.1)

Option 1: User-Level MCP Servers (Recommended)

Configure MCP servers in ~/.claude.json to use them across all n8n workflows:

{
  "projects": {
    "/Users/yourname": {
      "mcpServers": {
        "postgres": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-postgres", "${DATABASE_URL}"]
        },
        "github": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-github"],
          "env": {
            "GITHUB_TOKEN": "${GITHUB_TOKEN}"
          }
        }
      }
    }
  }
}

Then in your n8n node:

{
  "operation": "query",
  "prompt": "List all open issues in the repository",
  "settingSources": ["user", "project", "local"],  // Default: loads all configs
  "allowedTools": ["mcp__github__list_issues"]
}

Option 2: Project-Level MCP Servers

Create .mcp.json in your project directory:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "${DATABASE_URL}"]
    }
  }
}

🔄 Workflow Patterns

Pattern 1: Continuous Code Improvement

Schedule Trigger (Daily)
  ↓
Claude Code (Analyze codebase for improvements)
  ↓
Create GitHub Issues
  ↓
Assign to Team

Pattern 2: Natural Language to Code

Slack Command
  ↓
Claude Code (Generate code from description)
  ↓
Create Pull Request
  ↓
Run Tests
  ↓
Notify Results

Pattern 3: Intelligent Monitoring

Error Webhook
  ↓
Claude Code (Diagnose issue)
  ↓
If (Can fix automatically)
  ├─ Yes: Create Fix PR
  └─ No: Create Detailed Issue

🚦 Getting Started

1. Verify Prerequisites

Make sure Claude Code CLI is installed and authenticated on your n8n server:

claude --version  # Should show the version

If not installed, see the Quick Start section above.

2. Create Your First Workflow

  1. In n8n, create a new workflow
  2. Add a Manual Trigger node (for testing)
  3. Add the Claude Code node
  4. Configure:
    • Operation: Query
    • Prompt: "Analyze the code in this directory and suggest improvements"
    • Project Path: /path/to/your/project
    • Model: Sonnet 4.5 (recommended), Opus 4.5 (most capable), or Haiku 4 (fastest)
  5. Click Execute Workflow
  6. Watch Claude Code analyze your project!

3. Explore Advanced Features

💡 Pro Tips

🎯 Use Project Paths

Always set a project path for better context and results:

/home/user/projects/my-app

🔒 Configure Permissions

Control what Claude Code can do in .claude/settings.json:

{
  "permissions": {
    "allow": ["Read(*)", "Write(*)", "Bash(npm test)"],
    "deny": ["Bash(rm -rf *)"]
  }
}

🔗 Chain Operations

Use "Continue" operation to build complex multi-step workflows while maintaining context.

📊 Output Formats

  • Structured: Full details with metrics
  • Messages: For debugging
  • Text: Simple results for chaining

🤝 Community & Support

📈 What's Next?

We're constantly improving! Upcoming features:

  • Visual workflow builder for Claude Code operations
  • Pre-built workflow templates
  • Enhanced debugging tools
  • More MCP server integrations

📄 License

MIT - Build amazing things!


Ready to revolutionize your development workflow? Install Claude Code for n8n today and join the future of automated software development!

Made with ❤️ by Adam Holt