Connect Discord to Cogny — bot setup, intents, and invite URL
End-to-end Discord MCP setup: create the application, copy the token, install the bot with the right scope and permissions, and enable the two privileged intents the read tools need.
What you get
The Discord MCP server gives Cogny read access to your Discord server plus the ability to post messages. Tools available:
get_current_user— sanity-check the botlist_guilds/get_guild(with member counts) /list_guild_channels/get_channellist_guild_members— paginate the member listget_channel_messages— paginate message history (up to 100 per call)send_message— post a message to a channel, optionally as a reply
All tools talk to discord.com/api/v10 from the Cogny MCP proxy, authenticating as the bot you configure here.
What you need
- Manage Server permission on the Discord server you want to connect.
- A free Discord account. That's it — there's no paid tier for the bot APIs we use.
The whole flow takes about three minutes.
Step 1 — Create the application
Open the Discord Developer Portal and click New Application. Name it whatever your team will recognize ("Cogny" works fine). Accept the developer ToS.
You'll land on the General Information tab. The Application ID at the top is the same value Cogny will derive automatically from your bot token in the next step — you don't need to copy it manually.
Step 2 — Get the bot token
Click the Bot tab in the left sidebar. The bot user is created automatically when the application is created.
Click Reset Token → confirm → Copy. This is the only time Discord shows you the full token, so paste it directly into the Bot Token field in Cogny's connect dialog (Settings → API → Discord → Connect). Cogny stores it encrypted and sends it as Authorization: Bot <token> to the Discord REST API.
Token hygiene: if you ever paste a Discord bot token into a public channel or commit it to a repo, treat it as compromised — come back here and click Reset Token again. Old tokens are immediately invalidated.
Step 3 — Enable the privileged intents
Still on the Bot tab, scroll to Privileged Gateway Intents. Two of these toggles materially change what the MCP tools can return — turn both on:
- Server Members Intent — required for
list_guild_membersto return more than just the bot itself. Without it, the call succeeds but returns a one-element list. - Message Content Intent — required for
get_channel_messagesto include the actual message text. Without it, you get author + timestamp + reactions but everycontentfield comes back empty. This is the most common "huh, why is this empty?" gotcha.
The third toggle (Presence Intent) is irrelevant for the MCP tools — leave it off.
Why "privileged": Discord requires verified status for these intents once your bot is in 100+ servers. Below that threshold (which is most teams) you just toggle them on and they take effect immediately.
Step 4 — Install the bot in your server
When you paste the bot token into Cogny's connect dialog, we autodetect your Application ID from the token and render a one-click install URL right under the input. It looks like this:
https://discord.com/oauth2/authorize
?client_id=<your-app-id>
&scope=bot
&permissions=68608
68608 is the bitwise OR of:
VIEW_CHANNEL(1024) — see channelsSEND_MESSAGES(2048) — post replies / new messagesREAD_MESSAGE_HISTORY(65536) — read past messages in a channel
Click that URL → pick your server in the dropdown → Authorize. You need Manage Server on the destination server.
If you'd rather build the URL by hand, the OAuth2 → URL Generator tab in the dev portal gives you the same thing: tick the bot scope, tick those three permissions, copy the generated URL.
Step 5 — Verify
Back in Cogny, open a chat thread with the Discord MCP enabled and try:
get_current_user()
You should see the bot's user object — username, ID, and a couple of flags. If you see Authentication error (bad bot token), the token wasn't saved correctly — reconnect.
Then:
get_guild(guild_id="<your-guild-id>", with_counts=True)
The response includes approximate_member_count — that's the "members" stat from the Discord UI.
get_channel_messages(channel_id="<some-channel-id>", limit=20)
If the content field on each message is empty, you missed Step 3's Message Content Intent. Go back, toggle it on, and re-run — no need to reconnect.
Per-channel permissions
Server-level permissions in the install URL only get the bot into channels where its role has access. For private or restricted channels, you also need to grant the bot's role explicit access on the channel itself:
- Server Settings → channel → Permissions → add the bot's role → toggle View Channel + Read Message History (+ Send Messages if you want it to post there).
If get_channel_messages returns "Forbidden" for a specific channel, this is almost always why.
Privacy and what gets read
The bot only sees what the user installing it has access to — same constraint as any other Discord bot. It cannot:
- Read DMs the bot isn't part of
- See messages in channels its role can't view
- Read messages older than the channel's existing history limit
Everything Cogny reads goes to the LLM call you triggered (e.g. a scheduled prompt or a chat message) and the response is stored in your warehouse. There is no separate Discord-message archive.
Common errors
| What you see | Why | Fix |
|---|---|---|
Authentication error (bad bot token) | Token wasn't saved or was reset in the dev portal | Reconnect in Settings → API |
Forbidden. Check the bot has the required intents/permissions. | Channel-level permission missing, or the intent toggle is off | Add bot role to channel, or enable Server Members / Message Content Intent |
list_guild_members returns only the bot | Server Members Intent is off | Toggle on in dev portal → Bot |
All content fields empty | Message Content Intent is off | Toggle on in dev portal → Bot |
Resource not found on get_guild | Bot was never invited to that guild, or guild ID is wrong | Check list_guilds first |
Rate limit exceeded | Too many calls in a short window | Tools wait the retry_after interval — usually fine to re-run |
Where to go next
- Try the Discord Community Analysis scheduled prompt to get a weekly digest of new joins, active members, and channel activity — it's a built-in template that uses the read tools above.
- Mix Discord with other channels. Pair it with the Reddit Ads or LinkedIn Ads MCPs to spot which paid campaigns are driving community growth — Cogny's chat agent can join the dots across MCPs in a single thread.