Skip to content

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.

Set the bot token and restrict the deployment to the Discord server IDs it is supposed to control:

Terminal window
DISCORD_TOKEN=your-discord-bot-token
ALLOWED_GUILDS=111122223333444455
MCP_WRITE_MODE=preview
MCP_ACCESS_MODE=advisory
MCP_DM_CONSENT_MODE=require
MCP_ALLOW_USER_SCOPED=false

This 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.

Run the online doctor after the client has started the server:

Terminal window
discord-mcp doctor --online

It 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.