Overview
Environment variables control n8n-MCP’s behavior, from server modes to database configuration. This guide covers all available options.Common Configuration
Database Settings
Path to the SQLite database file. Must end with
.db.Examples:- Local:
./data/nodes.db - Docker:
/app/data/nodes.db - Custom:
/var/lib/n8n-mcp/nodes.db
Rebuild the database on server startup.Use cases:
- Development: Test database changes
- Production: Update after n8n version upgrades
- CI/CD: Ensure fresh database
Logging Configuration
Logging verbosity level.Options:
debug- Detailed logs for troubleshootinginfo- Normal operational logswarn- Warnings and errors onlyerror- Errors only
Alternative logging level variable (used in some contexts).
Disable console output to prevent interference with stdio mode.Required for Claude Desktop - Set to
true to prevent JSON parsing errors.Node Environment
Node.js environment mode.Options:
development- Development mode with detailed errorsproduction- Production mode with optimizations
Server Mode Configuration
MCP Mode
Server communication mode.Options:
stdio- Standard input/output (for Claude Desktop)http- HTTP server (for remote connections, n8n integration)
HTTP Server Settings
HTTP server port (only used when
MCP_MODE=http).HTTP server host binding.
Base URL for the server when running behind a proxy.Examples:
Alternative to
BASE_URL for public-facing URL.Authentication
Authentication token for HTTP mode (minimum 32 characters).Generate secure token:Usage:
Alternative authentication token variable. If set, must match
AUTH_TOKEN.CORS Configuration
CORS origin for HTTP mode.Examples:
Trust proxy configuration for correct IP logging.Options:
0- Disabled (direct connection)1- Trust first proxy (Nginx, Caddy, Traefik)2+- Number of proxy hops
Security Configuration
Rate Limiting
Rate limit window in milliseconds (default: 15 minutes).
Maximum authentication attempts per IP within window.
SSRF Protection
SSRF protection mode for webhooks.Modes:
strict- Block localhost + private IPs + cloud metadata (production)moderate- Allow localhost, block private IPs + cloud metadata (local dev)permissive- Allow localhost + private IPs, block cloud metadata (internal)
Use
moderate mode when connecting to n8n running on localhost or host.docker.internal.Disabled Tools
Comma-separated list of tool names to disable at startup.Use cases:
- Multi-tenant deployments
- Security hardening
- Feature flags
Multi-Tenant Configuration
Enable multi-tenant mode for dynamic instance support.When enabled:
- n8n API tools available for all sessions
- Instance configuration from HTTP headers
Session isolation strategy for multi-tenant mode.Options:
instance- Separate sessions per instance ID (recommended)shared- Share sessions but switch contexts (advanced)
Database Adapter Configuration
SQLite Adapter Selection
Force use of better-sqlite3 adapter.Note: Automatically selected based on availability. Manual override rarely needed.
sql.js Configuration
Save interval for sql.js adapter (milliseconds).Range: 100-60000msTradeoffs:
- Lower values = more frequent saves = higher memory churn
- Higher values = less frequent saves = lower memory usage
Cache Configuration
Maximum number of cached instances.Range: 1-10000
Cache TTL in minutes.Range: 1-1440 (24 hours)
OpenAI Integration
OpenAI API key for AI-powered template metadata generation.Get from: https://platform.openai.com/api-keys
OpenAI model for metadata generation.
Batch size for metadata generation.
Enable metadata generation during template fetch.
Privacy Configuration
Disable anonymous telemetry collection.
Testing Configuration
Enable automatic cleanup of test workflows.
Tag applied to all test workflows.
Name prefix for test workflows.
Configuration Examples
Claude Desktop (stdio mode)
Remote HTTP Server
Local Development with n8n
Production Docker Deployment
Next Steps
Claude Desktop
Configure for Claude Desktop
n8n Integration
Connect to n8n instances
Database
Database configuration and optimization
Deployment
Deployment guides