Fix .env.example for proper local and remote configuration
- Separate configuration sections for local (stdio) and HTTP modes - Fix variable names: MCP_SERVER_PORT/HOST for local mode - Change default NODE_DB_PATH to ./data/nodes-v2.db for local dev - Add missing REBUILD_ON_START variable - Set NODE_ENV to development by default - Add clear comments explaining which mode uses which variables - Update README with cp .env.example .env step The .env.example now properly supports both deployment modes and will work out of the box when copied to .env. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
70
.env.example
70
.env.example
@@ -1,32 +1,50 @@
|
|||||||
# n8n Documentation MCP Remote Server Configuration
|
# n8n Documentation MCP Server Configuration
|
||||||
|
|
||||||
# Remote Server Configuration
|
# ====================
|
||||||
MCP_PORT=3000
|
# COMMON CONFIGURATION
|
||||||
MCP_HOST=0.0.0.0
|
# ====================
|
||||||
MCP_DOMAIN=n8ndocumentation.aiservices.pl
|
|
||||||
|
|
||||||
# Authentication (REQUIRED for production)
|
|
||||||
# Generate a secure token: openssl rand -hex 32
|
|
||||||
MCP_AUTH_TOKEN=your-secure-auth-token-here
|
|
||||||
|
|
||||||
# CORS - Enable for browser-based access
|
|
||||||
MCP_CORS=true
|
|
||||||
|
|
||||||
# TLS Configuration (optional but recommended for production)
|
|
||||||
# MCP_TLS_CERT=/path/to/cert.pem
|
|
||||||
# MCP_TLS_KEY=/path/to/key.pem
|
|
||||||
|
|
||||||
# Database Configuration
|
# Database Configuration
|
||||||
NODE_DB_PATH=/app/data/nodes-v2.db
|
# For local development: ./data/nodes-v2.db
|
||||||
|
# For Docker: /app/data/nodes-v2.db
|
||||||
|
NODE_DB_PATH=./data/nodes-v2.db
|
||||||
|
|
||||||
# Node.js Environment
|
# Logging Level (debug, info, warn, error)
|
||||||
NODE_ENV=production
|
|
||||||
|
|
||||||
# Logging
|
|
||||||
MCP_LOG_LEVEL=info
|
MCP_LOG_LEVEL=info
|
||||||
|
|
||||||
# Legacy n8n Configuration (not used in v2)
|
# Node Environment (development, production)
|
||||||
# N8N_BASIC_AUTH_USER=admin
|
NODE_ENV=development
|
||||||
# N8N_BASIC_AUTH_PASSWORD=your-secure-password-here
|
|
||||||
# N8N_HOST=localhost
|
# Rebuild database on startup (true/false)
|
||||||
# N8N_API_KEY=your-api-key-here
|
REBUILD_ON_START=false
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# LOCAL MODE CONFIGURATION
|
||||||
|
# =========================
|
||||||
|
# Used when running: npm run start:v2 or npm run dev:v2
|
||||||
|
|
||||||
|
# Local MCP Server Configuration
|
||||||
|
MCP_SERVER_PORT=3000
|
||||||
|
MCP_SERVER_HOST=localhost
|
||||||
|
# MCP_AUTH_TOKEN=optional-for-local-development
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# HTTP MODE CONFIGURATION
|
||||||
|
# =========================
|
||||||
|
# Used when running: npm run start:http or npm run dev:http
|
||||||
|
|
||||||
|
# HTTP Server Configuration
|
||||||
|
MCP_PORT=3000
|
||||||
|
MCP_HOST=0.0.0.0
|
||||||
|
MCP_DOMAIN=localhost
|
||||||
|
|
||||||
|
# Authentication (REQUIRED for production HTTP mode)
|
||||||
|
# Generate a secure token: openssl rand -hex 32
|
||||||
|
# MCP_AUTH_TOKEN=your-secure-auth-token-here
|
||||||
|
|
||||||
|
# CORS - Enable for browser-based access
|
||||||
|
MCP_CORS=false
|
||||||
|
|
||||||
|
# TLS Configuration (optional for HTTPS)
|
||||||
|
# MCP_TLS_CERT=/path/to/cert.pem
|
||||||
|
# MCP_TLS_KEY=/path/to/key.pem
|
||||||
@@ -27,7 +27,7 @@ This MCP server serves as a comprehensive knowledge base for AI assistants to un
|
|||||||
- Node.js 18+
|
- Node.js 18+
|
||||||
- Git (for cloning n8n-docs)
|
- Git (for cloning n8n-docs)
|
||||||
|
|
||||||
### Setup
|
### Quick Start
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone the repository
|
# Clone the repository
|
||||||
@@ -37,11 +37,17 @@ cd n8n-mcp
|
|||||||
# Install dependencies
|
# Install dependencies
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
|
# Copy environment configuration
|
||||||
|
cp .env.example .env
|
||||||
|
|
||||||
# Build the project
|
# Build the project
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
# Initialize and rebuild the database with all nodes
|
# Initialize and rebuild the database with all nodes
|
||||||
npm run db:rebuild:v2
|
npm run db:rebuild:v2
|
||||||
|
|
||||||
|
# Start the local MCP server (for Claude Desktop)
|
||||||
|
npm run start:v2
|
||||||
```
|
```
|
||||||
|
|
||||||
### Deployment Options
|
### Deployment Options
|
||||||
|
|||||||
Reference in New Issue
Block a user