Authentication

Account Isolation

Strict tenant boundaries enforcing server-derived user identity, per-grant guild allowlists, physically isolated MCP auth storage, and field-level RBAC projections.

Immutable Server-Derived Caller Identity

Taicket MCP resolves the acting Discord user ID exclusively from the SHA-256-verified McpAccessToken document in taicket_mcp. No tool schema accepts a caller userId, actorId, or session token override parameter.

If a prompt-injected model attempts to pass another user ID or inspect another server, the execution guard ignores unrecognized input properties (strict Zod schemas) and authorizes strictly against ctx.userId.

Per-Grant Guild Allowlists

During /oauth/consent or PAT creation in /account, the user explicitly binds the credential to either a curated list of Discord server IDs (allowedGuildIds: ["111...", "222..."]) or all servers they can manage (allowedGuildIds: null).

  • Pre-query rejection:: Every guild-scoped tool checks ctx.allowedGuildIds before touching any Taicket application database or Discord bot endpoint. Out-of-scope guilds fail closed with FORBIDDEN.
  • Live permission re-verification:: When allowedGuildIds is null or includes a guild where the user later lost Discord Administrator or Manage Server permissions, live RBAC revokes access immediately without waiting for token expiry.
  • Linked Main Server dual check:: Configuring Enterprise Linked Main Server via configure_server_settings requires both guilds to pass allowedGuildIds AND Real Discord Admin verification independently.

Physically Isolated Auth Database & Zero-Leakage Projections

All MCP authentication records, encrypted Discord tokens, setup previews, and HMAC hash-chained audit logs live in a dedicated MongoDB database (MCP_MONGODB_URI / taicket_mcp) completely separate from Taicket main and module databases.

Tool responses pass through explicit Data Transfer Object (DTO) projections and field-level RBAC filters before serialization. Internal operational collections (AdminStaff, GlobalCoreBrain, CandidateProposal, DashboardLoginLog, UserSupportTicket, PrivateEvidence, and PromoCode write paths) are not even registered on MCP database connections.

Caller RoleExplicitly Stripped Fields / Data
Delegated Interviewer (non-admin)InterviewConfig admin settings, Module Hub summaries, all non-interview modules
Temporary AdmintempAdminUserIds, botBranding, linkedMainServer, Anti-Nuke configurations
Regular Discord Admin (non-Anti-Nuke)All Anti-Nuke config, alert channels, trusted lists, and incident logs
Server Dashboard Staff (non-admin)Leadership role configuration arrays (ownerRoleIds, adminRoleIds) and settings mutations
All MCP callersInternal bot tokens, encrypted Discord OAuth tokens, DB URIs, anonymous report submitters, private evidence

Related documentation