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:
czlonkowski
2025-06-08 08:03:49 +00:00
parent a514c92c6c
commit dde26e2930
2 changed files with 51 additions and 27 deletions

View File

@@ -1,32 +1,50 @@
# n8n Documentation MCP Remote Server Configuration
# n8n Documentation MCP Server Configuration
# Remote Server Configuration
MCP_PORT=3000
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
# ====================
# COMMON 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
NODE_ENV=production
# Logging
# Logging Level (debug, info, warn, error)
MCP_LOG_LEVEL=info
# Legacy n8n Configuration (not used in v2)
# N8N_BASIC_AUTH_USER=admin
# N8N_BASIC_AUTH_PASSWORD=your-secure-password-here
# N8N_HOST=localhost
# N8N_API_KEY=your-api-key-here
# Node Environment (development, production)
NODE_ENV=development
# Rebuild database on startup (true/false)
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

View File

@@ -27,7 +27,7 @@ This MCP server serves as a comprehensive knowledge base for AI assistants to un
- Node.js 18+
- Git (for cloning n8n-docs)
### Setup
### Quick Start
```bash
# Clone the repository
@@ -37,11 +37,17 @@ cd n8n-mcp
# Install dependencies
npm install
# Copy environment configuration
cp .env.example .env
# Build the project
npm run build
# Initialize and rebuild the database with all nodes
npm run db:rebuild:v2
# Start the local MCP server (for Claude Desktop)
npm run start:v2
```
### Deployment Options