Connect Discord to Claude Code
Read and post in a Discord server's channels, and look up its members, roles and threads. Add Toolspoke to Claude Code once and it can use 12 Discord actions. Your Discord credential stays in Toolspoke, and you choose which actions Claude Code may call.
Set it up in Claude Code
Three steps, the first one once for every toolkit you will ever add.
Add Toolspoke to Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcpThe sign-in opens in your browser, and Toolspoke asks you to approve it.
Install Discord and connect it
Add Discord to a project in your Toolspoke workspace.
Bot token. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- Bot token
- Discord Developer Portal → your application → Bot → Reset Token. Sent as `Authorization: Bot <token>`; a token pasted without its Bot prefix is fine, the prefix is added here.
- Server (guild) ID
- Right-click the server in Discord with Developer Mode on → Copy Server ID. It is the server every guild-level action defaults to, and the one the connection is tested against.
Choose what Claude Code may do
All 12 actions start on. Switch off any of the 5 actions that change something in Discord, and Claude Code gets a refusal if it tries.
What you can ask Claude Code for
A few of the Discord actions that only read, so they are safe to try first.
- List every channel in the server the bot can see, with each one's id, name, type, topic, category and position
- Read recent messages from a channel or thread, newest first
- List the server's members, with each one's user record, nickname, roles and join date, ordered by user id
- List the server's roles with their ids, names, colours, permission bitfields and position
What Claude Code can do in Discord
7 actions read, 2 write and 3 delete or permanently change something.
Reads
List guild channels
List every channel in the server the bot can see, with each one's id, name, type, topic, category and position. This is the first call to make: channel ids are what every message operation takes, and Discord's own UI never shows them without Developer Mode. Threads are not included here. Discord returns them from a separate active-threads endpoint this connector does not expose.
Get channel
Fetch one channel or thread by id: its name, type, topic, slow-mode setting, parent category and, for a thread, its archive state and message count. Use it to confirm what a channel id actually points at before posting into it.
List messages
Read recent messages from a channel or thread, newest first. Pass `before` with a message id to page backwards through history, `after` to read forward from a point, or `around` to read either side of one message; the three are mutually exclusive and Discord ignores all but one. The bot needs both View Channel and Read Message History on the channel, without the second, this returns an empty list rather than an error.
Get message
Fetch one message in full by id: its content, author, timestamps, attachments, embeds, reactions and, if it is a reply, the message it refers to. Use it after list_messages when you need everything about a single message.
List guild members
List the server's members, with each one's user record, nickname, roles and join date, ordered by user id. IMPORTANT: this endpoint requires the SERVER MEMBERS privileged intent to be enabled for the application in the Discord developer portal. Without it Discord answers 403, and the message reads like the bot's role is missing a permission rather than like a switch in a different console. Page with `after`, passing the highest user id from the previous response.
Get user
Fetch one user's public account record by id: username, global display name, discriminator, avatar and whether the account is a bot. This is the global user, not the server member, nickname and roles come from list_guild_members. Pass the bot's own id to confirm which application this token belongs to.
List guild roles
List the server's roles with their ids, names, colours, permission bitfields and position. Use it to find the role ids that send_message takes as mention_role_ids, and to read what a member's role list from list_guild_members actually means.
Writes
Create thread
Start a thread in a text channel. Classified a write rather than destructive: it creates an empty container that carries no message of its own and can be deleted afterwards by anyone with Manage Threads. IMPORTANT: Discord's own default for this endpoint is a PRIVATE thread, kept for backwards compatibility, so a thread created without naming a type is invisible to the channel. This connector defaults `type` to 11, a public thread, which is what almost every caller means. Post into the thread by calling send_message with the id this returns.
Add reaction
React to a message as the bot. A write rather than destructive: a reaction carries no text, changes nothing anyone has read, and is removed as easily as it is added. `emoji` takes a plain Unicode character for a standard emoji, or `name:id` for a custom server emoji, the id half is what makes it resolve, and a custom emoji sent by name alone is rejected. Discord answers 204 with no body.
Deletes or permanently changes
Send message
Post a message into a channel or thread. Classified destructive because every human watching that channel sees it immediately and there is no taking it back, a write grant does not reach this. Mentions are inert by default: an @everyone or @user written in `content` renders as text and notifies nobody unless mention_parse, mention_user_ids or mention_role_ids says otherwise. Set reply_to_message_id to post it as a reply to an existing message.
Edit message
Rewrite a message this bot posted. Discord does not allow a bot to edit anyone else's message, so this only ever works on its own. Classified destructive for the same reason send_message is: the new text replaces what people have already read, the old text is gone, and an edit is visible in the channel. Fields left out are unchanged; pass content to replace the text.
Delete message
Delete a message. There is no undo and no API that returns a deleted message, so this is destructive in the plainest sense. Deleting the bot's own message needs no extra permission; deleting anyone else's needs Manage Messages on the channel. Discord answers 204 with no body.
Discord in Claude Code: questions
Does Claude Code see my Discord credential?
No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.
Can I stop Claude Code from changing things in Discord?
Yes. Each of the 12 actions can be switched off for a project. Turn off the 5 that change something and Claude Code can only read.
Will 12 actions crowd Claude Code's context?
No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the Discord action it needs when it needs it. Adding more toolkits does not add more tools to its list.
Can I add it once for every project?
Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.
What does it cost?
Tool calls are free on every plan, and a Discord call does not run in a sandbox, so it bills nothing.
Discord in your other apps
Try Discord in Claude Code
Free to start, and tool calls cost nothing on any plan.