Discord MCP bot connects then drops: close code 4014 (disallowed intents)
Fixes the Discord MCP gateway connection closing immediately with code 4014. Use when the token is valid but the bot cannot stay connected. Not for bad tokens or MCP transport errors.
Discord MCP bot connects then drops: close code 4014 (disallowed intents)
TL;DR: Enable the Privileged Gateway Intents your bot needs in the Discord developer portal (Presence, Server Members, Message Content). Discord closes the gateway with 4014 when the bot requests intents that are not enabled for the app. Restart the MCP server after toggling the intents.
The error
Discord gateway closed with close code 4014 (disallowed intents); the bot connects then immediately disconnectsFix it
- Open the Discord developer portal, your application, Bot settings.
Expected: You see the Privileged Gateway Intents toggles.
- Enable Presence Intent, Server Members Intent, and Message Content Intent.
Expected: All three show enabled; save.
- Restart the MCP server process.
Expected: The gateway stays connected.
- Call a Discord tool.
Expected: It succeeds.
When this applies
The Discord bot token is valid but the gateway connection drops right after connecting with a 4014 close.
When this does NOT apply
TokenInvalid means the token itself is wrong. MCP -32603 not logged in is the server-side login issue.
Tool compatibility
barryyip0625/mcp-discord, any version
Also seen as
- Discord 4014 disallowed intents MCP
- Discord bot keeps disconnecting MCP
- privileged intents discord MCP
Why it happens
Discord requires privileged intents to be explicitly enabled per application. The MCP server requests them at gateway hello; if the toggles are off, Discord closes the connection with 4014.
Edge cases
- Large bots (100+ servers) need intent verification approval from Discord.
- Message Content intent is required to read message text.
- Toggling intents can take a minute to propagate; wait before retesting.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.