# IBM DB2i MCP Server Configuration
# Copy this file to .env and fill in your values
# ===================
# Required Settings
# ===================
# IBM i hostname or IP address
DB2I_HOSTNAME=your-ibm-i-host.com
# IBM i username
DB2I_USERNAME=your-username
# IBM i password
DB2I_PASSWORD=your-password
# ===================
# Database Settings
# ===================
# Port number (default: 446)
DB2I_PORT=446
# Database name (default: *LOCAL)
DB2I_DATABASE=*LOCAL
# Default schema/library for tools (optional)
DB2I_SCHEMA=
# Additional JDBC options (semicolon-separated)
# Example: naming=sql;date format=iso;time format=iso
DB2I_JDBC_OPTIONS=naming=sql;date format=iso
# ===================
# Transport Settings
# ===================
# Transport mode: stdio, http, or both (default: stdio)
# - stdio: For CLI/IDE integration (default, backwards compatible)
# - http: For web/agent integration with token auth
# - both: Run both transports simultaneously
MCP_TRANSPORT=stdio
# ===================
# HTTP Transport Settings (only used when MCP_TRANSPORT=http or both)
# ===================
# HTTP server port (default: 3000)
MCP_HTTP_PORT=3000
# HTTP server bind address (default: 127.0.0.1)
# Use 0.0.0.0 only with TLS enabled or behind a reverse proxy
MCP_HTTP_HOST=127.0.0.1
# Session mode: stateful or stateless (default: stateful)
# - stateful: Maintains MCP session context across requests
# - stateless: Each request is independent
MCP_SESSION_MODE=stateful
# Token lifetime in seconds (default: 3600 = 1 hour)
MCP_TOKEN_EXPIRY=3600
# Maximum concurrent sessions (default: 100)
MCP_MAX_SESSIONS=100
# CORS allowed origins (comma-separated, * for all, empty for same-origin only)
# Example: https://example.com,https://app.example.com
# MCP_CORS_ORIGINS=
# ===================
# HTTP Authentication Mode
# ===================
# Auth mode: required, token, or none (default: required)
# - required: Full /auth flow with per-user DB credentials (most secure)
# - token: Pre-shared static token, uses env DB credentials
# - none: No auth required, uses env DB credentials (for trusted networks only)
MCP_AUTH_MODE=required
# Static token for 'token' mode (generate with: openssl rand -hex 32)
# Required when MCP_AUTH_MODE=token
# MCP_AUTH_TOKEN=
# ===================
# TLS Settings (for HTTPS)
# ===================
# Enable built-in TLS (default: false)
# For production, either enable this or run behind a reverse proxy with TLS
MCP_TLS_ENABLED=false
# Path to TLS certificate (required if MCP_TLS_ENABLED=true)
MCP_TLS_CERT_PATH=
# Path to TLS private key (required if MCP_TLS_ENABLED=true)
MCP_TLS_KEY_PATH=
# ===================
# Logging Settings
# ===================
# Log level: debug, info, warn, error, fatal (default: info)
LOG_LEVEL=info
# Set to 'production' for JSON logs, otherwise pretty-printed
# NODE_ENV=production
# ===================
# Rate Limiting
# ===================
# Time window in milliseconds (default: 900000 = 15 minutes)
RATE_LIMIT_WINDOW_MS=900000
# Maximum requests allowed per window (default: 100)
RATE_LIMIT_MAX_REQUESTS=100
# Set to 'false' to disable rate limiting (default: true)
RATE_LIMIT_ENABLED=true
# ===================
# Query Limits
# ===================
# Default number of rows returned (default: 1000)
QUERY_DEFAULT_LIMIT=1000
# Maximum rows allowed (default: 10000)
QUERY_MAX_LIMIT=10000