.env.example•4.09 kB
# Server Configuration
NODE_ENV=development
PORT=3000
# ================================
# JobNimbus Multi-Instance Configuration
# ================================
# This server supports multi-instance isolation for Stamford and Guilford
# Each request MUST include the x-jobnimbus-instance header (stamford | guilford)
# API keys are provided per-request via x-jobnimbus-api-key header
# Base API URL (same for both instances)
JOBNIMBUS_API_BASE_URL=https://app.jobnimbus.com/api1
# IMPORTANT: API Keys
# - API keys are provided per-request via x-jobnimbus-api-key header
# - The x-jobnimbus-instance header determines which dataset to query
# - Cache keys are automatically prefixed with instance to ensure isolation
# - Each instance maintains completely separate cache namespaces
# Required Headers for MCP Clients:
# - x-jobnimbus-api-key: <your-api-key>
# - x-jobnimbus-instance: stamford | guilford
# Rate Limiting
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX_REQUESTS=60
# Logging
LOG_LEVEL=info
# ================================
# Redis Cache Configuration
# ================================
# Enable/Disable Cache (set to 'false' to disable entirely)
CACHE_ENABLED=true
# Redis Connection (Render.com free tier example)
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=your_redis_password_here
REDIS_DB=0
# TLS Configuration (Required for Render.com in production)
# Set to 'true' in production, 'false' in local development
REDIS_TLS_REJECT_UNAUTHORIZED=true
# Cache Performance Tuning
# Max size for a single cache item (important for 25MB Render.com limit)
# Default: 512KB per item
CACHE_MAX_ITEM_SIZE_KB=512
# Enable GZIP compression for large values (reduces memory usage)
# Recommended: true for production with 25MB constraint
CACHE_COMPRESSION=true
# Circuit Breaker Settings
# Number of consecutive failures before opening circuit
CACHE_FAILURE_THRESHOLD=5
# Time to wait before attempting to reconnect (milliseconds)
CACHE_RESET_TIMEOUT=60000
# Time window for tracking failures (milliseconds)
CACHE_MONITORING_WINDOW=120000
# Monitoring
# Enable detailed cache metrics collection
CACHE_ENABLE_METRICS=true
# Cache logging level (debug | info | warn | error)
CACHE_LOG_LEVEL=info
# Redis Memory Management
# Eviction policy when max memory reached
# Options: allkeys-lru, volatile-lru, allkeys-lfu, volatile-lfu, allkeys-random, volatile-random, noeviction
# Recommended: allkeys-lru (evict least recently used keys)
REDIS_MAX_MEMORY_POLICY=allkeys-lru
# ================================
# Production Configuration (Render.com)
# ================================
# For Render.com Redis (free tier: 25MB)
# REDIS_HOST=<your-render-redis-hostname>.render.com
# REDIS_PORT=6379
# REDIS_PASSWORD=<your-render-redis-password>
# REDIS_TLS_REJECT_UNAUTHORIZED=true
# CACHE_ENABLED=true
# CACHE_COMPRESSION=true
# CACHE_MAX_ITEM_SIZE_KB=256
# Multi-Instance Setup on Render.com:
# 1. Set up two MCP clients (Stamford and Guilford)
# 2. Each client sends x-jobnimbus-instance header with their identifier
# 3. Each client sends x-jobnimbus-api-key header with their JobNimbus API key
# 4. Server automatically isolates cache by instance using hierarchical keys:
# - jobnimbus:stamford:entity:operation:identifier
# - jobnimbus:guilford:entity:operation:identifier
# 5. Instance isolation ensures:
# - Separate cache namespaces (no cross-contamination)
# - Separate API credentials per request
# - Distinct datasets when querying same date ranges
# - Instance labels in all logs for debugging
# ================================
# Development Configuration (Local Redis)
# ================================
# For local development
# REDIS_HOST=localhost
# REDIS_PORT=6379
# REDIS_PASSWORD=
# REDIS_TLS_REJECT_UNAUTHORIZED=false
# CACHE_ENABLED=true
# CACHE_COMPRESSION=false
# ================================
# Testing Configuration
# ================================
# For testing (disable cache or use mock)
# CACHE_ENABLED=false
# IMPORTANT: API keys are NEVER stored here!
# They come from the client in each request header.