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)

VariableRequiredDefaultValidation / Purpose
NODE_ENVNodevelopmentEnum: development | production | test. Controls production secure cookies and logging behavior.
LOG_LEVELNoinfoEnum: fatal | error | warn | info | debug | trace | silent. Pino logger threshold.
MCP_PORTNo4130Integer 1 to 65535. HTTP listen port for taicket-mcp.
MCP_HOSTNo127.0.0.1Bind host address. Keep loopback in production behind Nginx.
MCP_ISSUER_URLNohttps://mcp.taicket.xyzValid http/https URL (trailing slash stripped). OAuth 2.1 issuer identifier.
MCP_RESOURCE_URLNo${MCP_ISSUER_URL}/mcpValid http/https URL (trailing slash stripped). RFC 8707 canonical MCP resource URI.
MCP_DISCORD_REDIRECT_URINo${MCP_ISSUER_URL}/oauth/discord/callbackValid http/https URL registered in Discord Developer Portal OAuth2 Redirects.
DASHBOARD_URLNohttps://taicket.xyzValid http/https URL used for upgrade and dashboard-only guidance links.
MCP_MONGODB_URIYesNoneValid mongodb:// or mongodb+srv:// URI for isolated MCP database.
MCP_DB_NAMENotaicket_mcpNon-empty database name on MCP_MONGODB_URI.
MCP_TOKEN_ENCRYPTION_KEYYesNoneMinimum 32 characters (256-bit hex recommended). AES-256-GCM key for stored Discord OAuth tokens.
MCP_SESSION_SECRETYesNoneMinimum 32 characters. HMAC key signing browser cookies (mcp_account_session, OAuth state).
MCP_AUDIT_SIGNING_KEYYesNoneMinimum 32 characters. HMAC-SHA256 signing key for tamper-evident mcp_audit_logs chain.
MONGODB_URIYesNoneValid MongoDB URI for main Taicket core database.
DISCORD_BOT_TOKENYesFallback: DISCORD_TOKENDiscord Bot token used for live REST API v10 guild/channel/role checks and panel deploys.
DISCORD_CLIENT_IDYesFallback: NEXT_PUBLIC_DISCORD_CLIENT_IDDiscord application snowflake (/^\d{17,22}$/).
DISCORD_CLIENT_SECRETYesNoneDiscord OAuth2 client secret for exchanging authorization codes.
ANTINUKE_MONGODB_URI / ANTINUKE_DB_NAMEOptional URItaicket_antinukeDedicated Anti-Nuke MongoDB endpoint and database name.
BOOSTER_MONGODB_URI / BOOSTER_DB_NAMEOptional URItaicket_boosterDedicated Booster Perks MongoDB endpoint and database name.
ECONOMY_MONGODB_URI / ECONOMY_DB_NAMEOptional URItaicket_economyDedicated Economy MongoDB endpoint and database name.
GIVEAWAYS_MONGODB_URI / GIVEAWAYS_DB_NAMEOptional URItaicket_giveawaysDedicated Giveaways MongoDB endpoint and database name.
JARVIS_MONGODB_URI / JARVIS_DB_NAMEOptional URItaicket_jarvisDedicated JARVIS Auditor MongoDB endpoint and database name.
MATCH_TOGETHER_MONGODB_URI / MATCH_TOGETHER_DB_NAMEOptional URItaicket_match_togetherDedicated Match Together MongoDB endpoint and database name.
REACTION_ROLES_MONGODB_URI / REACTION_ROLES_DB_NAMEOptional URItaicket_reaction_rolesDedicated Reaction Roles MongoDB endpoint and database name.
REACTION_TRIGGER_MONGODB_URI / REACTION_TRIGGER_DB_NAMEOptional URItaicket_reaction_triggerDedicated Reaction Triggers MongoDB endpoint and database name.
STARBOARD_MONGODB_URI / STARBOARD_DB_NAMEOptional URItaicket_starboardDedicated Starboard MongoDB endpoint and database name.

PM2 and Nginx runtime configuration knobs

LayerSettingConfigured ValueEffect
PM2 (ecosystem.config.cjs)name / cwd / scripttaicket-mcp / ./mcp / dist/index.jsIsolated process entry targeted via --only taicket-mcp.
PM2 (ecosystem.config.cjs)instances / max_memory_restart1 / 1GSingle 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.logDedicated log files separated from bot and dashboard logs.
Nginx (mcp.taicket.xyz.conf)upstream keepalive127.0.0.1:4130, keepalive 64Reuses HTTP/1.1 persistent upstream connections (Connection "").
Nginx (mcp.taicket.xyz.conf)taicket_mcp_limit10m zone, 25r/s (burst 50 / 30)Edge DDoS protection on /mcp, /.well-known/*, and docs.
Nginx (mcp.taicket.xyz.conf)taicket_mcp_oauth_limit10m zone, 10r/s (burst 20)Tighter auth rate limit on /oauth/* and /account.
Nginx (mcp.taicket.xyz.conf)location = /mcp buffering & timeoutsproxy_buffering off, proxy_cache off, 300s read/send, 2M bodyRequired for Streamable HTTP SSE streams and large JSON-RPC responses.
Nginx (mcp.taicket.xyz.conf)location ^~ /oauth/ & /accountproxy_cache off, 60s timeout, 1M body, X-Frame-Options DENYPrevents clickjacking and proxy caching of consent/PAT pages.

Related documentation