{"_id":"@emmanuelsharkscale/n8n-mcp-server","name":"@emmanuelsharkscale/n8n-mcp-server","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.2":{"name":"@emmanuelsharkscale/n8n-mcp-server","version":"1.0.2","description":"MCP server for n8n workflow management","type":"module","main":"dist/index.js","bin":{"n8n-mcp-server":"dist/index.js"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"tsc --watch & node --watch dist/index.js","prepublishOnly":"npm run build"},"keywords":["mcp","n8n","workflow","automation","model-context-protocol","claude-code"],"author":{"name":"Emmanuel Rodriguez"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/emansharkscale/n8n-mcp-server.git"},"homepage":"https://github.com/emansharkscale/n8n-mcp-server#readme","bugs":{"url":"https://github.com/emansharkscale/n8n-mcp-server/issues"},"dependencies":{"@modelcontextprotocol/sdk":"^0.5.0","axios":"^1.6.0","dotenv":"^16.5.0","zod":"^3.22.0"},"devDependencies":{"@types/node":"^20.0.0","typescript":"^5.0.0"},"engines":{"node":">=18"},"_id":"@emmanuelsharkscale/n8n-mcp-server@1.0.2","types":"./dist/index.d.ts","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-kODWm72IGDfNh1pP5yzdGSLEhymjryLjJ6XtYBZXuu7VjeXxv1APIEjftgFxg5ytAC43eg22S9ORxhppVU6sQw==","shasum":"a2afbf383c01eeff2da6e1289fe14161cdeb6269","tarball":"https://registry.npmjs.org/@emmanuelsharkscale/n8n-mcp-server/-/n8n-mcp-server-1.0.2.tgz","fileCount":9,"unpackedSize":74517,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA7XiU5G8D15ed0Aulppga6OR0a466rIYvO0rWnEtLiEAiEA6F9zx2B02gLqSDK3i4cxOIiwG/mpZnHG+Yt1OxZghCU="}]},"_npmUser":{"name":"emmanuelsharkscale","email":"emmanuel@sharkscale.io","actor":{"name":"emmanuelsharkscale","email":"emmanuel@sharkscale.io","type":"user"}},"directories":{},"maintainers":[{"name":"emmanuelsharkscale","email":"emmanuel@sharkscale.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/n8n-mcp-server_1.0.2_1750897019862_0.027243432624648012"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-26T00:16:59.747Z","1.0.2":"2025-06-26T00:17:00.017Z","modified":"2025-06-26T00:17:00.301Z"},"maintainers":[{"name":"emmanuelsharkscale","email":"emmanuel@sharkscale.io"}],"description":"MCP server for n8n workflow management","homepage":"https://github.com/emansharkscale/n8n-mcp-server#readme","keywords":["mcp","n8n","workflow","automation","model-context-protocol","claude-code"],"repository":{"type":"git","url":"git+https://github.com/emansharkscale/n8n-mcp-server.git"},"author":{"name":"Emmanuel Rodriguez"},"bugs":{"url":"https://github.com/emansharkscale/n8n-mcp-server/issues"},"license":"MIT","readme":"# n8n MCP Server\n\nA Model Context Protocol (MCP) server that provides tools for managing n8n workflows. This allows you to interact with your n8n instance directly through Claude Code or any MCP-compatible client.\n\n## Features\n\n### Read Operations\n- **List Workflows** - Get all workflows with optional filtering\n- **Get Workflow** - Retrieve a specific workflow by ID\n- **Get Workflow by Name** - Find and retrieve a workflow by name\n- **Health Check** - Test n8n API connectivity\n\n### Write Operations\n- **Create Workflow** - Create new workflows\n- **Update Workflow** - Modify existing workflows\n- **Activate Workflow** - Activate workflows to start execution\n- **Deactivate Workflow** - Stop workflow execution\n- **Delete Workflow** - Remove workflows from n8n\n\n## Installation\n\n### Option 1: NPX Package (Recommended)\n\nInstall globally via npm:\n```bash\nnpm install -g n8n-mcp-server\n```\n\nOr use npx without installing:\n```bash\nnpx n8n-mcp-server\n```\n\n### Option 2: Local Development\n\n1. **Clone or create the MCP server directory:**\n   ```bash\n   cd /path/to/your/glass-fruit-asmr-development\n   cd n8n-mcp\n   ```\n\n2. **Install dependencies:**\n   ```bash\n   npm install\n   ```\n\n3. **Build the TypeScript code:**\n   ```bash\n   npm run build\n   ```\n\n## Configuration\n\n### Environment Variables\n\nCreate a `.env` file or set these environment variables:\n\n```bash\n# Your n8n instance URL (without trailing slash)\nN8N_URL=https://sharkscale.app.n8n.cloud\n\n# Your n8n API key\nN8N_API_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJlMTJiNzA4ZC03NTgzLTRlZmYtYThiNy00ODA5YmYzMWU5MmYiLCJpc3MiOiJuOG4iLCJhdWQiOiJwdWJsaWMtYXBpIiwiaWF0IjoxNzUwODkyMzM1fQ.WXCTYn5NEvu_PPtv3BpYYE467b6x5Ezm7zxtlXJjwec\n```\n\n### Claude Code Configuration\n\nAdd this MCP server to your Claude Code configuration file (`~/.claude/mcp.json`):\n\n#### For NPX Installation:\n```json\n{\n  \"mcpServers\": {\n    \"n8n\": {\n      \"command\": \"npx\",\n      \"args\": [\"n8n-mcp-server\"],\n      \"env\": {\n        \"N8N_URL\": \"https://sharkscale.app.n8n.cloud\",\n        \"N8N_API_KEY\": \"your-api-key-here\"\n      }\n    }\n  }\n}\n```\n\n#### For Global Installation:\n```json\n{\n  \"mcpServers\": {\n    \"n8n\": {\n      \"command\": \"n8n-mcp-server\",\n      \"env\": {\n        \"N8N_URL\": \"https://sharkscale.app.n8n.cloud\",\n        \"N8N_API_KEY\": \"your-api-key-here\"\n      }\n    }\n  }\n}\n```\n\n#### For Local Development:\n```json\n{\n  \"mcpServers\": {\n    \"n8n\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/your/glass-fruit-asmr-development/n8n-mcp/dist/index.js\"],\n      \"env\": {\n        \"N8N_URL\": \"https://sharkscale.app.n8n.cloud\",\n        \"N8N_API_KEY\": \"your-api-key-here\"\n      }\n    }\n  }\n}\n```\n\n## Usage Examples\n\n### 1. List All Workflows\n```typescript\n// List all workflows\nn8n_list_workflows({})\n\n// List only active workflows\nn8n_list_workflows({ active: true })\n\n// List workflows with specific tags\nn8n_list_workflows({ tags: \"production,analytics\" })\n```\n\n### 2. Get Specific Workflow\n```typescript\n// Get workflow by ID\nn8n_get_workflow({ id: \"h9g2AcK6qSbAznmy\" })\n\n// Get workflow by name\nn8n_get_workflow_by_name({ name: \"Analytics workflow\" })\n```\n\n### 3. Create New Workflow\n```typescript\nn8n_create_workflow({\n  name: \"My New Workflow\",\n  nodes: [\n    {\n      id: \"trigger-node\",\n      name: \"Schedule Trigger\",\n      type: \"n8n-nodes-base.scheduleTrigger\",\n      typeVersion: 1,\n      position: [0, 0],\n      parameters: {\n        rule: {\n          interval: [{ field: \"hours\", hoursInterval: 1 }]\n        }\n      }\n    }\n  ],\n  connections: {},\n  settings: {\n    executionOrder: \"v1\"\n  }\n})\n```\n\n### 4. Update Existing Workflow\n```typescript\nn8n_update_workflow({\n  id: \"workflow-id-here\",\n  name: \"Updated Workflow Name\",\n  nodes: [...], // Updated nodes array\n  connections: {...}, // Updated connections\n  settings: {...} // Updated settings\n})\n```\n\n### 5. Activate/Deactivate Workflows\n```typescript\n// Activate workflow\nn8n_activate_workflow({ id: \"h9g2AcK6qSbAznmy\" })\n\n// Deactivate workflow\nn8n_deactivate_workflow({ id: \"h9g2AcK6qSbAznmy\" })\n```\n\n### 6. Health Check\n```typescript\n// Test API connectivity\nn8n_health_check({})\n```\n\n## Available Tools\n\n| Tool Name | Description | Required Parameters |\n|-----------|-------------|-------------------|\n| `n8n_list_workflows` | List workflows with optional filters | None |\n| `n8n_get_workflow` | Get workflow by ID | `id` |\n| `n8n_get_workflow_by_name` | Get workflow by name | `name` |\n| `n8n_create_workflow` | Create new workflow | `name`, `nodes`, `connections` |\n| `n8n_update_workflow` | Update existing workflow | `id`, `name`, `nodes`, `connections` |\n| `n8n_activate_workflow` | Activate workflow | `id` |\n| `n8n_deactivate_workflow` | Deactivate workflow | `id` |\n| `n8n_delete_workflow` | Delete workflow | `id` |\n| `n8n_health_check` | Test API connectivity | None |\n\n## Development\n\n### Scripts\n- `npm run build` - Compile TypeScript to JavaScript\n- `npm run dev` - Watch mode for development\n- `npm start` - Start the MCP server\n\n### Testing the Server\n```bash\n# Build the project\nnpm run build\n\n# Test with environment variables\nN8N_URL=https://sharkscale.app.n8n.cloud N8N_API_KEY=your-key npm start\n```\n\n## Error Handling\n\nThe MCP server includes comprehensive error handling:\n\n- **API Errors** - n8n API errors are properly formatted and returned\n- **Validation Errors** - Input validation using Zod schemas\n- **Connection Errors** - Network and timeout handling\n- **Authentication Errors** - Invalid API key detection\n\n## Security Notes\n\n- Keep your n8n API key secure and never commit it to version control\n- The API key has full access to your n8n instance\n- Use environment variables or Claude Code's secure environment configuration\n- Consider using API key scoping if you're on an n8n Enterprise plan\n\n## Troubleshooting\n\n### Common Issues\n\n1. **\"N8N_URL and N8N_API_KEY environment variables are required\"**\n   - Ensure both environment variables are set correctly\n   - Check that your API key is valid and not expired\n\n2. **\"n8n API connection failed\"**\n   - Verify your n8n instance URL is correct\n   - Check that your API key has the necessary permissions\n   - Ensure your n8n instance is accessible from your machine\n\n3. **\"request/body must NOT have additional properties\"**\n   - This occurs when trying to update workflows with read-only fields\n   - The MCP server automatically filters these out\n\n### Getting Help\n\n- Check the n8n API documentation: https://docs.n8n.io/api/\n- Verify your API key in n8n: Settings > n8n API\n- Test connectivity using the health check tool\n\n## License\n\nMIT License - see LICENSE file for details.","readmeFilename":"README.md","_rev":"1-fb683d071773eec460229d9b6a47c153"}