# Descope Authentication Configuration Template
# Copy this file to .env and fill in your actual values
# ============================================================================
# DESCOPE PROJECT CONFIGURATION
# ============================================================================
# Your Descope Project ID (required)
# Get this from your Descope console: https://app.descope.com/
DESCOPE_PROJECT_ID=YOUR_DESCOPE_PROJECT_ID
# Descope Management Key (required for admin operations)
# Get this from Descope Console > Settings > Company > Management Key
DESCOPE_MANAGEMENT_KEY=your_management_key_here
# ============================================================================
# MCP AUTHENTICATION
# ============================================================================
# Descope Access Key for MCP authentication (required)
# This is the key that gets exchanged for JWT tokens
# Generate this in Descope Console > Access Keys
DESCOPE_ACCESS_KEY=your_access_key_here
# ============================================================================
# SERVER CONFIGURATION
# ============================================================================
# MCP Server Port (default: 8080)
PORT=8080
# Enable demo mode for local development (default: false)
# Set to true for local testing without full Descope integration
DESCOPE_DEMO_MODE=false
# Authentication Proxy Port (default: 8090)
# Used by mcp_client_with_auth.py
MCP_AUTH_PORT=8090
# ============================================================================
# SECURITY SETTINGS
# ============================================================================
# JWT Secret Key (generate a secure random string)
# Used for JWT token validation
JWT_SECRET_KEY=your_jwt_secret_key_here
# CORS Origins (comma-separated, default: *)
# Restrict which origins can access your MCP server
CORS_ORIGINS=*
# Rate Limiting (requests per minute, default: 100)
RATE_LIMIT_REQUESTS=100
# ============================================================================
# LOGGING AND MONITORING
# ============================================================================
# Log Level (DEBUG, INFO, WARNING, ERROR)
LOG_LEVEL=INFO
# Enable detailed logging for debugging
ENABLE_DETAILED_LOGGING=false
# Enable metrics collection
ENABLE_METRICS=true
# Enable health checks
ENABLE_HEALTH_CHECKS=true
# ============================================================================
# OPTIONAL: AI MODEL CONFIGURATION
# ============================================================================
# OpenAI API Key (for advanced AI features)
# OPENAI_API_KEY=sk-your-openai-key-here
# Anthropic API Key (for Claude models)
# ANTHROPIC_API_KEY=sk-ant-your-anthropic-key-here
# ============================================================================
# OPTIONAL: CEQUENCE AI GATEWAY INTEGRATION
# ============================================================================
# Cequence Gateway ID (for enterprise analytics)
# CEQUENCE_GATEWAY_ID=your_gateway_id
# Cequence API Key
# CEQUENCE_API_KEY=your_cequence_api_key
# Cequence Gateway URL
# CEQUENCE_GATEWAY_URL=https://api.cequence.ai/gateway
# ============================================================================
# SETUP INSTRUCTIONS
# ============================================================================
# 1. Copy this file to .env in your project root
# 2. Replace all 'your_*_here' placeholders with actual values
# 3. Get your Descope credentials from: https://app.descope.com/
# 4. Generate a secure JWT_SECRET_KEY (32+ characters)
# 5. Adjust PORT and other settings as needed
# 6. For production, ensure .env is in your .gitignore
# ============================================================================
# SECURITY NOTES
# ============================================================================
# - NEVER commit .env files to version control
# - Use strong, unique values for all secrets
# - Rotate access keys regularly
# - Limit CORS_ORIGINS in production
# - Monitor logs for authentication failures
# - Use HTTPS in production deployments
# ============================================================================
# TROUBLESHOOTING
# ============================================================================
# If authentication fails:
# 1. Verify DESCOPE_PROJECT_ID matches your Descope project
# 2. Check that DESCOPE_ACCESS_KEY is valid and not expired
# 3. Ensure the access key has the required scopes
# 4. Test with DESCOPE_DEMO_MODE=true for local development
# 5. Check logs for detailed error messages
# For connection issues:
# 1. Verify PORT is available and not blocked by firewall
# 2. Check that MCP_AUTH_PORT doesn't conflict with other services
# 3. Ensure network connectivity to Descope (app.descope.com)
# 4. Test with curl or similar tools