Configuration Guide¶
Learn how to configure RapidTriageME for your specific needs, from basic setup to advanced customization.
Overview¶
RapidTriageME offers flexible configuration through multiple methods:
- Environment Variables - For system-wide settings
- Configuration Files - For persistent project-specific settings
- Runtime Parameters - For temporary overrides
- IDE Integration - For AI assistant configuration
Configuration Methods¶
Environment Variables¶
The most common way to configure RapidTriageME is through environment variables.
Core Settings¶
# Server Configuration
export RAPIDTRIAGE_PORT=3025 # Port for browser connector server
export RAPIDTRIAGE_HOST=localhost # Host address to bind to
export RAPIDTRIAGE_CORS_ORIGIN=* # CORS origin (use specific domains in production)
# Logging Configuration
export NODE_ENV=development # Environment mode (development/production)
export LOG_LEVEL=info # Logging level (error/warn/info/debug/trace)
export DEBUG=rapidtriage:* # Debug namespaces
# Feature Toggles
export RAPIDTRIAGE_ENABLE_SCREENSHOTS=true # Enable screenshot capture
export RAPIDTRIAGE_ENABLE_LIGHTHOUSE=true # Enable Lighthouse audits
export RAPIDTRIAGE_ENABLE_AUTH=false # Enable authentication (for production)
Performance Settings¶
# Screenshot Configuration
export RAPIDTRIAGE_SCREENSHOT_MAX_WIDTH=1920
export RAPIDTRIAGE_SCREENSHOT_MAX_HEIGHT=1080
export RAPIDTRIAGE_SCREENSHOT_QUALITY=80
# Memory and Performance
export RAPIDTRIAGE_MAX_LOG_ENTRIES=1000 # Maximum console log entries to store
export RAPIDTRIAGE_MAX_NETWORK_ENTRIES=500 # Maximum network requests to store
export RAPIDTRIAGE_CLEANUP_INTERVAL=300000 # Cleanup interval in ms (5 minutes)
# Timeouts
export RAPIDTRIAGE_CONNECTION_TIMEOUT=30000 # WebSocket connection timeout
export RAPIDTRIAGE_REQUEST_TIMEOUT=10000 # HTTP request timeout
export RAPIDTRIAGE_LIGHTHOUSE_TIMEOUT=60000 # Lighthouse audit timeout
Platform-Specific Setup¶
# Add to ~/.bashrc or ~/.zshrc
cat >> ~/.bashrc << 'EOF'
# RapidTriageME Configuration
export RAPIDTRIAGE_PORT=3025
export RAPIDTRIAGE_HOST=localhost
export NODE_ENV=development
export LOG_LEVEL=info
export RAPIDTRIAGE_ENABLE_SCREENSHOTS=true
export RAPIDTRIAGE_ENABLE_LIGHTHOUSE=true
EOF
# Reload configuration
source ~/.bashrc
# Set persistent environment variables
[Environment]::SetEnvironmentVariable("RAPIDTRIAGE_PORT", "3025", "User")
[Environment]::SetEnvironmentVariable("RAPIDTRIAGE_HOST", "localhost", "User")
[Environment]::SetEnvironmentVariable("NODE_ENV", "development", "User")
[Environment]::SetEnvironmentVariable("LOG_LEVEL", "info", "User")
# Restart PowerShell to apply changes
Configuration Files¶
For more complex setups, use configuration files.
Global Configuration¶
Create a global configuration file:
# Create config directory
mkdir -p ~/.rapidtriage
# Create configuration file
cat > ~/.rapidtriage/config.json << 'EOF'
{
"server": {
"port": 3025,
"host": "localhost",
"cors": {
"origin": "*",
"credentials": true
}
},
"logging": {
"level": "info",
"format": "combined",
"enableColors": true
},
"features": {
"screenshots": {
"enabled": true,
"maxWidth": 1920,
"maxHeight": 1080,
"quality": 80,
"format": "png"
},
"lighthouse": {
"enabled": true,
"timeout": 60000,
"categories": ["performance", "accessibility", "best-practices", "seo"]
},
"networking": {
"maxLogEntries": 1000,
"maxNetworkEntries": 500,
"enableRequestInterception": true
}
},
"security": {
"enableAuth": false,
"rateLimiting": {
"enabled": true,
"windowMs": 60000,
"max": 100
}
}
}
EOF
Project-Specific Configuration¶
Create a project-specific configuration:
// rapidtriage.config.json (in your project root)
{
"extends": "~/.rapidtriage/config.json",
"server": {
"port": 3030 // Override global port
},
"features": {
"lighthouse": {
"categories": ["performance"] // Only run performance audits
}
},
"project": {
"name": "My Web App",
"baseUrl": "http://localhost:3000",
"testPages": [
"/",
"/about",
"/contact"
]
}
}
IDE Configuration¶
Configure your AI assistant to work with RapidTriageME.
Cursor IDE¶
// ~/.cursor/mcp_settings.json
{
"mcpServers": {
"rapidtriage": {
"command": "npx",
"args": ["@yarlisai/rapidtriage-mcp"],
"env": {
"BROWSER_TOOLS_PORT": "3025",
"BROWSER_TOOLS_HOST": "localhost",
"NODE_ENV": "development",
"LOG_LEVEL": "info",
"DEBUG": "rapidtriage:*"
}
}
}
}
VS Code with Continue¶
// ~/.continue/config.json
{
"models": [
{
"title": "Claude 3.5 Sonnet",
"provider": "anthropic",
"model": "claude-3-5-sonnet-20241022",
"apiKey": "your-anthropic-api-key"
}
],
"mcpServers": {
"rapidtriage": {
"command": "npx",
"args": ["@yarlisai/rapidtriage-mcp"],
"env": {
"BROWSER_TOOLS_PORT": "3025",
"BROWSER_TOOLS_HOST": "localhost",
"RAPIDTRIAGE_CONFIG_PATH": "./rapidtriage.config.json"
}
}
},
"customCommands": [
{
"name": "debug-page",
"prompt": "Use RapidTriageME to take a screenshot, check console logs, and run a performance audit on the current page. Provide a comprehensive analysis."
}
]
}
Claude Desktop¶
// ~/Library/Application Support/Claude/config.json (macOS)
// %APPDATA%\Claude\config.json (Windows)
{
"mcpServers": {
"rapidtriage": {
"command": "npx",
"args": ["@yarlisai/rapidtriage-mcp"],
"env": {
"BROWSER_TOOLS_PORT": "3025",
"DEBUG": "true",
"LOG_LEVEL": "debug"
}
}
}
}
Zed Editor¶
// ~/.config/zed/settings.json
{
"language_servers": {
"rapidtriage-mcp": {
"command": "npx",
"args": ["@yarlisai/rapidtriage-mcp"],
"env": {
"BROWSER_TOOLS_PORT": "3025",
"NODE_ENV": "development"
}
}
}
}
Advanced Configuration¶
Custom Tool Configuration¶
Configure specific tools and their behavior:
{
"tools": {
"screenshot": {
"defaultOptions": {
"fullPage": true,
"captureBeyondViewport": true,
"optimizeForSpeed": false
}
},
"lighthouse": {
"defaultConfig": {
"extends": "lighthouse:default",
"settings": {
"onlyCategories": ["performance", "accessibility"],
"skipAudits": ["screenshot-thumbnails"],
"throttling": {
"cpuSlowdownMultiplier": 4,
"throughputKbps": 1638.4,
"requestLatencyMs": 150
}
}
}
},
"console": {
"filters": {
"includeTypes": ["error", "warn", "info"],
"excludePatterns": [
"Download the React DevTools",
"Warning: React.createFactory"
]
}
}
}
}
Multi-Environment Setup¶
Configure different environments:
{
"environments": {
"development": {
"server": {
"port": 3025,
"host": "localhost"
},
"logging": {
"level": "debug"
},
"features": {
"lighthouse": {
"enabled": true,
"categories": ["performance"]
}
}
},
"staging": {
"server": {
"port": 1422,
"host": "0.0.0.0"
},
"logging": {
"level": "info"
},
"features": {
"lighthouse": {
"categories": ["performance", "accessibility", "seo"]
}
}
},
"production": {
"server": {
"port": 3025,
"host": "127.0.0.1"
},
"logging": {
"level": "warn"
},
"security": {
"enableAuth": true,
"allowedOrigins": ["https://yourdomain.com"]
}
}
}
}
Use environment-specific configuration:
# Set active environment
export RAPIDTRIAGE_ENV=staging
# Start server with environment config
npx @yarlisai/rapidtriage-server --env=staging
Cloud Deployment Configuration¶
Configure for Cloudflare Workers deployment:
# wrangler.toml
name = "rapidtriage-mcp"
main = "src/worker.ts"
compatibility_date = "2024-01-01"
[env.production]
route = { pattern = "rapidtriage.me/mcp/*", zone_name = "rapidtriage.me" }
[env.production.vars]
ENVIRONMENT = "production"
LOG_LEVEL = "warn"
ENABLE_AUTH = "true"
CORS_ORIGIN = "https://rapidtriage.me"
# KV namespace for session storage
[[env.production.kv_namespaces]]
binding = "SESSIONS"
id = "your-production-kv-namespace-id"
[[env.production.kv_namespaces]]
binding = "CACHE"
id = "your-cache-kv-namespace-id"
# Durable Objects
[[env.production.durable_objects.bindings]]
name = "SESSION_MANAGER"
class_name = "SessionManager"
[env.staging]
route = { pattern = "staging.rapidtriage.me/mcp/*", zone_name = "rapidtriage.me" }
[env.staging.vars]
ENVIRONMENT = "staging"
LOG_LEVEL = "info"
ENABLE_AUTH = "false"
Authentication Configuration¶
Configure authentication for production deployments:
{
"security": {
"enableAuth": true,
"authMethods": ["jwt", "apiKey"],
"jwt": {
"secret": "${JWT_SECRET}",
"expiresIn": "24h",
"issuer": "rapidtriage.me",
"audience": "rapidtriage-clients"
},
"apiKeys": {
"enabled": true,
"prefix": "rt_",
"length": 32
},
"rateLimiting": {
"enabled": true,
"windowMs": 60000,
"max": 100,
"skipSuccessfulRequests": false
},
"cors": {
"origin": ["https://rapidtriage.me"],
"credentials": true,
"allowedHeaders": ["Authorization", "Content-Type"]
}
}
}
Configuration Loading Priority¶
RapidTriageME loads configuration in this order (later sources override earlier ones):
- Built-in defaults - Sensible defaults for all settings
- Global config file -
~/.rapidtriage/config.json
- Project config file -
./rapidtriage.config.json
- Environment variables -
RAPIDTRIAGE_*
variables - Command line arguments -
--port
,--host
, etc.
Environment-Specific Examples¶
Local Development¶
# .env.local
RAPIDTRIAGE_PORT=3025
RAPIDTRIAGE_HOST=localhost
NODE_ENV=development
LOG_LEVEL=debug
RAPIDTRIAGE_ENABLE_SCREENSHOTS=true
RAPIDTRIAGE_ENABLE_LIGHTHOUSE=true
RAPIDTRIAGE_SCREENSHOT_QUALITY=90
CI/CD Pipeline¶
# .env.ci
RAPIDTRIAGE_PORT=3025
RAPIDTRIAGE_HOST=127.0.0.1
NODE_ENV=test
LOG_LEVEL=warn
RAPIDTRIAGE_ENABLE_SCREENSHOTS=false # Disable in headless CI
RAPIDTRIAGE_ENABLE_LIGHTHOUSE=true
RAPIDTRIAGE_LIGHTHOUSE_TIMEOUT=30000 # Shorter timeout for CI
Production¶
# .env.production
RAPIDTRIAGE_PORT=3025
RAPIDTRIAGE_HOST=127.0.0.1
NODE_ENV=production
LOG_LEVEL=error
RAPIDTRIAGE_ENABLE_AUTH=true
RAPIDTRIAGE_CORS_ORIGIN=https://yourdomain.com
RAPIDTRIAGE_RATE_LIMIT_MAX=1000
Validation and Testing¶
Validate Configuration¶
# Test configuration loading
npx @yarlisai/rapidtriage-server --validate-config
# Check environment variables
npx @yarlisai/rapidtriage-server --show-config
# Test specific configuration file
npx @yarlisai/rapidtriage-server --config ./custom-config.json --validate-config
Configuration Schema¶
RapidTriageME validates configuration against a JSON schema:
{
"$schema": "https://rapidtriage.me/schema/config.json",
"type": "object",
"properties": {
"server": {
"type": "object",
"properties": {
"port": {
"type": "integer",
"minimum": 1000,
"maximum": 65535
},
"host": {
"type": "string",
"format": "hostname"
}
}
}
}
}
Troubleshooting Configuration¶
Common Configuration Issues¶
Port Already in Use¶
# Check what's using the port
lsof -i :3025
# Use a different port
export RAPIDTRIAGE_PORT=3030
npx @yarlisai/rapidtriage-server
Permission Denied¶
# Use unprivileged port (>1024)
export RAPIDTRIAGE_PORT=8080
# Or run with sudo (not recommended)
sudo RAPIDTRIAGE_PORT=80 npx @yarlisai/rapidtriage-server
Configuration Not Loading¶
# Check configuration file exists and is readable
ls -la ~/.rapidtriage/config.json
# Check JSON syntax
npx @yarlisai/rapidtriage-server --validate-config --verbose
# Enable debug logging
DEBUG=rapidtriage:config npx @yarlisai/rapidtriage-server
Debug Configuration¶
# Enable verbose logging for configuration
export DEBUG=rapidtriage:config,rapidtriage:server
export LOG_LEVEL=debug
# Start server with debugging
npx @yarlisai/rapidtriage-server --verbose
Best Practices¶
Development Environment¶
- Use environment files - Keep sensitive data out of code
- Enable debug logging - Set
LOG_LEVEL=debug
during development - Use project-specific config - Create
rapidtriage.config.json
in your project - Test configuration changes - Use
--validate-config
flag
Production Environment¶
- Use environment variables - Never commit secrets to version control
- Enable authentication - Set
RAPIDTRIAGE_ENABLE_AUTH=true
- Restrict CORS - Set specific origins instead of
*
- Enable rate limiting - Protect against abuse
- Use HTTPS - Always use secure connections in production
Performance Optimization¶
- Limit log entries - Set reasonable
MAX_LOG_ENTRIES
- Configure timeouts - Set appropriate timeout values
- Optimize screenshots - Balance quality and performance
- Enable cleanup - Set regular cleanup intervals
Next Steps¶
Now that you've configured RapidTriageME:
- Test your setup - Verify everything works correctly
- Learn debugging techniques - Master browser debugging
- Explore the API - Understand available tools and methods
- Deploy to production - Take it live
Configuration complete! RapidTriageME is now tailored to your specific needs and environment.