ReferenceConfig Spec
Configuration Reference
Complete parameter reference for all environment variables validated by mcp/src/config/env.ts, PM2 process settings in ecosystem.config.cjs, and Nginx runtime limits.
Environment variables (root .env)
| Variable | Required | Default | Validation / Purpose |
|---|---|---|---|
| NODE_ENV | No | development | Enum: development | production | test. Controls production secure cookies and logging behavior. |
| LOG_LEVEL | No | info | Enum: fatal | error | warn | info | debug | trace | silent. Pino logger threshold. |
| MCP_PORT | No | 4130 | Integer 1 to 65535. HTTP listen port for taicket-mcp. |
| MCP_HOST | No | 127.0.0.1 | Bind host address. Keep loopback in production behind Nginx. |
| MCP_ISSUER_URL | No | https://mcp.taicket.xyz | Valid http/https URL (trailing slash stripped). OAuth 2.1 issuer identifier. |
| MCP_RESOURCE_URL | No | ${MCP_ISSUER_URL}/mcp | Valid http/https URL (trailing slash stripped). RFC 8707 canonical MCP resource URI. |
| MCP_DISCORD_REDIRECT_URI | No | ${MCP_ISSUER_URL}/oauth/discord/callback | Valid http/https URL registered in Discord Developer Portal OAuth2 Redirects. |
| DASHBOARD_URL | No | https://taicket.xyz | Valid http/https URL used for upgrade and dashboard-only guidance links. |
| MCP_MONGODB_URI | Yes | None | Valid mongodb:// or mongodb+srv:// URI for isolated MCP database. |
| MCP_DB_NAME | No | taicket_mcp | Non-empty database name on MCP_MONGODB_URI. |
| MCP_TOKEN_ENCRYPTION_KEY | Yes | None | Minimum 32 characters (256-bit hex recommended). AES-256-GCM key for stored Discord OAuth tokens. |
| MCP_SESSION_SECRET | Yes | None | Minimum 32 characters. HMAC key signing browser cookies (mcp_account_session, OAuth state). |
| MCP_AUDIT_SIGNING_KEY | Yes | None | Minimum 32 characters. HMAC-SHA256 signing key for tamper-evident mcp_audit_logs chain. |
| MONGODB_URI | Yes | None | Valid MongoDB URI for main Taicket core database. |
| DISCORD_BOT_TOKEN | Yes | Fallback: DISCORD_TOKEN | Discord Bot token used for live REST API v10 guild/channel/role checks and panel deploys. |
| DISCORD_CLIENT_ID | Yes | Fallback: NEXT_PUBLIC_DISCORD_CLIENT_ID | Discord application snowflake (/^\d{17,22}$/). |
| DISCORD_CLIENT_SECRET | Yes | None | Discord OAuth2 client secret for exchanging authorization codes. |
| ANTINUKE_MONGODB_URI / ANTINUKE_DB_NAME | Optional URI | taicket_antinuke | Dedicated Anti-Nuke MongoDB endpoint and database name. |
| BOOSTER_MONGODB_URI / BOOSTER_DB_NAME | Optional URI | taicket_booster | Dedicated Booster Perks MongoDB endpoint and database name. |
| ECONOMY_MONGODB_URI / ECONOMY_DB_NAME | Optional URI | taicket_economy | Dedicated Economy MongoDB endpoint and database name. |
| GIVEAWAYS_MONGODB_URI / GIVEAWAYS_DB_NAME | Optional URI | taicket_giveaways | Dedicated Giveaways MongoDB endpoint and database name. |
| JARVIS_MONGODB_URI / JARVIS_DB_NAME | Optional URI | taicket_jarvis | Dedicated JARVIS Auditor MongoDB endpoint and database name. |
| MATCH_TOGETHER_MONGODB_URI / MATCH_TOGETHER_DB_NAME | Optional URI | taicket_match_together | Dedicated Match Together MongoDB endpoint and database name. |
| REACTION_ROLES_MONGODB_URI / REACTION_ROLES_DB_NAME | Optional URI | taicket_reaction_roles | Dedicated Reaction Roles MongoDB endpoint and database name. |
| REACTION_TRIGGER_MONGODB_URI / REACTION_TRIGGER_DB_NAME | Optional URI | taicket_reaction_trigger | Dedicated Reaction Triggers MongoDB endpoint and database name. |
| STARBOARD_MONGODB_URI / STARBOARD_DB_NAME | Optional URI | taicket_starboard | Dedicated Starboard MongoDB endpoint and database name. |
PM2 and Nginx runtime configuration knobs
| Layer | Setting | Configured Value | Effect |
|---|---|---|---|
| PM2 (ecosystem.config.cjs) | name / cwd / script | taicket-mcp / ./mcp / dist/index.js | Isolated process entry targeted via --only taicket-mcp. |
| PM2 (ecosystem.config.cjs) | instances / max_memory_restart | 1 / 1G | Single stateful sliding-window & connection pool process with 1 GB ceiling. |
| PM2 (ecosystem.config.cjs) | out_file / error_file | ./logs/mcp-out.log / ./logs/mcp-error.log | Dedicated log files separated from bot and dashboard logs. |
| Nginx (mcp.taicket.xyz.conf) | upstream keepalive | 127.0.0.1:4130, keepalive 64 | Reuses HTTP/1.1 persistent upstream connections (Connection ""). |
| Nginx (mcp.taicket.xyz.conf) | taicket_mcp_limit | 10m zone, 25r/s (burst 50 / 30) | Edge DDoS protection on /mcp, /.well-known/*, and docs. |
| Nginx (mcp.taicket.xyz.conf) | taicket_mcp_oauth_limit | 10m zone, 10r/s (burst 20) | Tighter auth rate limit on /oauth/* and /account. |
| Nginx (mcp.taicket.xyz.conf) | location = /mcp buffering & timeouts | proxy_buffering off, proxy_cache off, 300s read/send, 2M body | Required for Streamable HTTP SSE streams and large JSON-RPC responses. |
| Nginx (mcp.taicket.xyz.conf) | location ^~ /oauth/ & /account | proxy_cache off, 60s timeout, 1M body, X-Frame-Options DENY | Prevents clickjacking and proxy caching of consent/PAT pages. |