Configure discord-mcp
discord-mcp receives its runtime settings through environment variables in your MCP client configuration. Start with the smallest safe configuration, verify it, then add controls for the behavior you need.
Start with a safe baseline
Section titled “Start with a safe baseline”Set the bot token and restrict the deployment to the Discord server IDs it is supposed to control:
DISCORD_TOKEN=your-discord-bot-tokenALLOWED_GUILDS=111122223333444455MCP_WRITE_MODE=previewMCP_ACCESS_MODE=advisoryMCP_DM_CONSENT_MODE=requireMCP_ALLOW_USER_SCOPED=falseThis starts the server with REST-only transport, info logging, retry, circuit
breaking, and audit logging enabled. Destructive tools stay in dry-run mode until
you explicitly opt in. ALLOWED_GUILDS is optional for backward compatibility,
but strongly recommended whenever the bot can see more than one server.
MCP_ACCESS_MODE=advisory is the compatibility default. The built-in stdio and
HTTP transports provide a conservative read-only evidence resolver for warn
and enforce; custom embedders should inject an equivalent provider before
turning on enforce.
MCP_DM_CONSENT_MODE=require adds an explicit, one-time caller-approval step
before users_create_dm contacts a user. The host/operator must obtain any
human consent separately; the returned MCP preview is not proof of a human
click. Keep the default advisory mode only when the deployment has a separate
consent workflow.
Add controls by intent
Section titled “Add controls by intent”Verify before using an agent
Section titled “Verify before using an agent”Run the online doctor after the client has started the server:
discord-mcp doctor --onlineIt reports missing or invalid schema-backed environment variables. Use the
environment variable reference for the exact
accepted values and defaults. MCP_DRY_RUN is intentionally not part of that
schema validation, so verify that value byte-for-byte before enabling writes.

