From dde26e29305a1375f15b2e8f5b0b1397ad3c3c92 Mon Sep 17 00:00:00 2001 From: czlonkowski Date: Sun, 8 Jun 2025 08:03:49 +0000 Subject: [PATCH] Fix .env.example for proper local and remote configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .env.example | 70 +++++++++++++++++++++++++++++++++------------------- README.md | 8 +++++- 2 files changed, 51 insertions(+), 27 deletions(-) diff --git a/.env.example b/.env.example index 37f4b05..9436bb9 100644 --- a/.env.example +++ b/.env.example @@ -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 \ No newline at end of file +# 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 \ No newline at end of file diff --git a/README.md b/README.md index 03baf72..97e3bc2 100644 --- a/README.md +++ b/README.md @@ -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