Skip to main content
Connect n8n-MCP to Antigravity IDE (Chat in IDE powered by Gemini) for enhanced n8n workflow development.

Prerequisites

This setup requires:
  • Antigravity IDE installed
  • Node.js installed on your system
  • n8n instance running locally or remotely
  • n8n API key (optional, for full workflow management)
The deployment process is documented in the HTTP Deployment Guide.

Installation

1

Install n8n-MCP Globally

Install n8n-mcp as a global npm package:
npm install -g n8n-mcp
This makes the n8n-mcp package available system-wide for Antigravity to access.
2

Access MCP Configuration

Open the MCP configuration in Antigravity:
  1. Click the three dots ... on the top right of the chat
  2. Click MCP Servers
  3. Click “Manage MCP Servers”
  4. Click “View raw config”
This will open: C:\Users\<USER_NAME>\.gemini\antigravity\mcp_config.json
3

Add n8n-MCP Configuration

Add the following configuration to mcp_config.json:
For locally running n8n (default configuration):
mcp_config.json
{
  "mcpServers": {
    "n8n-mcp": {
      "command": "node",
      "args": [
        "C:\\Users\\<USER_NAME>\\AppData\\Roaming\\npm\\node_modules\\n8n-mcp\\dist\\mcp\\index.js"
      ],
      "env": {
        "MCP_MODE": "stdio",
        "LOG_LEVEL": "error",
        "DISABLE_CONSOLE_OUTPUT": "true",
        "N8N_API_URL": "http://localhost:5678",
        "N8N_BASE_URL": "http://localhost:5678",
        "N8N_API_KEY": ""
      }
    }
  }
}
Replace <USER_NAME> with your actual Windows username.
Path Format: Windows paths use double backslashes (\\) in JSON. The path points to the globally installed n8n-mcp package.
4

Enable MCP Server

  1. Save the mcp_config.json file
  2. Go back to “Manage MCP servers”
  3. Click the refresh button
  4. Verify n8n-mcp is enabled with all the tools
5

Set Up Project Instructions

Create an AGENTS.md file in the root directory of your project:
# Create the file
type nul > AGENTS.md
Copy the enhanced system instructions below into AGENTS.md:
AGENTS.md
You are an expert in n8n automation software using n8n-MCP tools. Your role is to design, build, and validate n8n workflows with maximum accuracy and efficiency.

## Core Principles

### 1. Silent Execution
CRITICAL: Execute tools without commentary. Only respond AFTER all tools complete.

❌ BAD: "Let me search for Slack nodes... Great! Now let me get details..."
✅ GOOD: [Execute search_nodes and get_node in parallel, then respond]

### 2. Parallel Execution
When operations are independent, execute them in parallel for maximum performance.

✅ GOOD: Call search_nodes, list_nodes, and search_templates simultaneously
❌ BAD: Sequential tool calls (await each one before the next)

### 3. Templates First
ALWAYS check templates before building from scratch (2,709 available).

### 4. Multi-Level Validation
Use validate_node(mode='minimal') → validate_node(mode='full') → validate_workflow pattern.

### 5. Never Trust Defaults
⚠️ CRITICAL: Default parameter values are the #1 source of runtime failures.
ALWAYS explicitly configure ALL parameters that control node behavior.

## Workflow Process

1. **Start**: Call `tools_documentation()` for best practices

2. **Template Discovery Phase** (FIRST - parallel when searching multiple)
   - `search_templates({searchMode: 'by_metadata', complexity: 'simple'})` - Smart filtering
   - `search_templates({searchMode: 'by_task', task: 'webhook_processing'})` - Curated by task
   - `search_templates({query: 'slack notification'})` - Text search (default searchMode='keyword')

3. **Node Discovery** (if no suitable template - parallel execution)
   - Think deeply about requirements. Ask clarifying questions if unclear.
   - `search_nodes({query: 'keyword', includeExamples: true})` - Parallel for multiple nodes

4. **Configuration Phase** (parallel for multiple nodes)
   - `get_node({nodeType, detail: 'standard', includeExamples: true})` - Essential properties (default)
   - Show workflow architecture to user for approval before proceeding

5. **Validation Phase** (parallel for multiple nodes)
   - `validate_node({nodeType, config, mode: 'minimal'})` - Quick required fields check
   - `validate_node({nodeType, config, mode: 'full', profile: 'runtime'})` - Full validation with fixes
   - Fix ALL errors before proceeding

6. **Building Phase**
   - If using template: `get_template(templateId, {mode: "full"})`
   - **MANDATORY ATTRIBUTION**: "Based on template by **[author.name]** (@[username]). View at: [url]"
   - Build from validated configurations
   - ⚠️ EXPLICITLY set ALL parameters - never rely on defaults
   - Build in artifact (unless deploying to n8n instance)

7. **Workflow Validation** (before deployment)
   - `validate_workflow(workflow)` - Complete validation
   - `validate_workflow_connections(workflow)` - Structure check
   - `validate_workflow_expressions(workflow)` - Expression validation
   - Fix ALL issues before deployment

8. **Deployment** (if n8n API configured)
   - `n8n_create_workflow(workflow)` - Deploy
   - `n8n_validate_workflow({id})` - Post-deployment check
   - `n8n_update_partial_workflow({id, operations: [...]})` - Batch updates

## Important Rules

- **Silent execution** - No commentary between tools
- **Parallel by default** - Execute independent operations simultaneously
- **Templates first** - Always check before building (2,709 available)
- **Multi-level validation** - Quick check → Full validation → Workflow validation
- **Never trust defaults** - Explicitly configure ALL parameters
- **USE CODE NODE ONLY WHEN NECESSARY** - Prefer standard nodes
AGENTS.md is the standard file for giving special instructions in Antigravity.

Configuration Options

Environment Variables

MCP_MODE
string
default:"stdio"
required
Mode for MCP communication. Use “stdio” for Antigravity.
LOG_LEVEL
string
default:"info"
Logging level. Set to “error” to reduce noise.
DISABLE_CONSOLE_OUTPUT
string
default:"false"
Set to “true” to disable console output.
N8N_API_URL
string
Your n8n instance API URL (e.g., http://localhost:5678 or https://your-n8n-instance.com)
N8N_BASE_URL
string
Your n8n instance base URL (typically same as API URL)
N8N_API_KEY
string
Your n8n API key for workflow management operations (can be empty for local instances without auth)

Finding the Installation Path

Windows

The global npm installation path is typically:
C:\Users\<USER_NAME>\AppData\Roaming\npm\node_modules\n8n-mcp\dist\mcp\index.js
To verify the path, run:
npm list -g n8n-mcp

macOS/Linux

For macOS or Linux, the path would be different:
# Find the global npm path
npm root -g

# The n8n-mcp path will be:
# <npm-root>/n8n-mcp/dist/mcp/index.js
Example configuration for macOS/Linux:
mcp_config.json
{
  "mcpServers": {
    "n8n-mcp": {
      "command": "node",
      "args": [
        "/usr/local/lib/node_modules/n8n-mcp/dist/mcp/index.js"
      ],
      "env": {
        "MCP_MODE": "stdio",
        "LOG_LEVEL": "error",
        "DISABLE_CONSOLE_OUTPUT": "true",
        "N8N_API_URL": "http://localhost:5678",
        "N8N_BASE_URL": "http://localhost:5678",
        "N8N_API_KEY": ""
      }
    }
  }
}

Verification

To verify your setup is working:
1

Check MCP Status

Go to Manage MCP servers in Antigravity and verify n8n-mcp is listed and enabled.
2

Open Antigravity Chat

Open the Antigravity chat panel.
3

Test a Command

Try a simple prompt:
Search for HTTP Request nodes in n8n
4

Verify Tools Available

You should see n8n-mcp tools being used in the response. With API credentials, you’ll have access to all workflow management tools.

Usage Examples

Building a Workflow

Create an n8n workflow that:
1. Triggers on a webhook POST request
2. Extracts data from the request body
3. Performs an HTTP request to an external API
4. Sends the response back via webhook

Template-Based Development

Find a template for Slack notifications and customize it to send alerts 
to #engineering channel when webhook receives an error event

Validation and Deployment

Validate this workflow configuration and deploy it to my n8n instance:
[paste workflow JSON]

Tips

  • Antigravity works best with explicit, detailed instructions in AGENTS.md
  • Always test with basic configuration before adding API credentials
  • Use parallel tool execution for faster responses
  • Leverage templates before building from scratch
  • Validate workflows before deploying to avoid runtime errors

Troubleshooting

  1. Verify n8n-mcp is installed globally: npm list -g n8n-mcp
  2. Check the path in mcp_config.json matches your installation
  3. Verify JSON syntax is correct (use a JSON validator)
  4. Click refresh in Manage MCP Servers
  5. Restart Antigravity IDE
  • Run npm list -g n8n-mcp to find the correct installation path
  • Ensure you’re using double backslashes (\\) in Windows paths
  • Verify the dist\mcp\index.js file exists at the specified path
  • Try reinstalling: npm uninstall -g n8n-mcp && npm install -g n8n-mcp
  • Verify n8n is running: Open http://localhost:5678 in browser
  • Check the N8N_API_URL and N8N_BASE_URL are correct
  • For local instances, ensure n8n is not using auth (or provide API key)
  • Test the API: curl http://localhost:5678/api/v1/workflows
  • Verify AGENTS.md exists in your project root
  • Check that Antigravity is loading the instructions file
  • Try removing and re-adding the MCP server
  • Review Antigravity console for error messages
  • Ensure n8n-mcp version is up to date: npm update -g n8n-mcp
  • Verify Node.js is installed: node --version
  • Add Node.js to your PATH environment variable
  • Try using the full path to node.exe in the configuration
  • Reinstall Node.js if necessary

Platform-Specific Notes

Windows

  • Use double backslashes (\\) in JSON paths
  • Default global npm path: C:\Users\<USER_NAME>\AppData\Roaming\npm\node_modules
  • Configuration file: C:\Users\<USER_NAME>\.gemini\antigravity\mcp_config.json

macOS

  • Use forward slashes (/) in paths
  • Default global npm path: /usr/local/lib/node_modules or ~/.npm-global/lib/node_modules
  • Configuration file: ~/.gemini/antigravity/mcp_config.json

Linux

  • Use forward slashes (/) in paths
  • Default global npm path: /usr/local/lib/node_modules or ~/.npm-global/lib/node_modules
  • Configuration file: ~/.gemini/antigravity/mcp_config.json

Next Steps

Claude Project Setup

Get enhanced project instructions

Available Tools

Explore all n8n-MCP tools

Building Workflows

Learn workflow best practices

HTTP Deployment

Deploy n8n-MCP as HTTP server

Build docs developers (and LLMs) love