PluginLow riskUnclaimed

discord

Discord channel for Claude Code — messaging bridge with built-in access control. Manage pairing, allowlists, and policy via /discord:access.

anthropicsanthropics/discord★ 48kVersion 0.0.6Updated Nov 19, 2026

Description

Connect a Discord bot to your Claude Code with an MCP server.

When the bot receives a message, the MCP server forwards it to Claude and provides tools to reply, react, and edit messages.

Prerequisites

  • Bun — the MCP server runs on Bun. Install with curl -fsSL https://bun.sh/install | bash.

Quick Setup

Default pairing flow for a single-user DM bot. See ACCESS.md for groups and multi-user setups.

1. Create a Discord application and bot.

Go to the Discord Developer Portal and click New Application. Give it a name.

Navigate to Bot in the sidebar. Give your bot a username.

Scroll down to Privileged Gateway Intents and enable Message Content Intent — without this the bot receives messages with empty content.

2. Generate a bot token.

Still on the Bot page, scroll up to Token and press Reset Token. Copy the token — it's only shown once. Hold onto it for step 5.

3. Invite the bot to a server.

Discord won't let you DM a bot unless you share a server with it.

Navigate to OAuth2 → URL Generator. Select the bot scope. Under Bot Permissions, enable:

  • View Channels
  • Send Messages
  • Send Messages in Threads
  • Create Public Threads
  • Read Message History
  • Attach Files
  • Add Reactions

Integration type: Guild Install. Copy the Generated URL, open it, and add the bot to any server you're in.

For DM-only use you technically need zero permissions — but enabling them now saves a trip back when you want guild channels later.

4. Install the plugin.

These are Claude Code commands — run claude to start a session first.

Install the plugin:

/plugin install discord@claude-plugins-official

5. Give the server the token.

/discord:configure MTIz...

Writes DISCORD_BOT_TOKEN=... to ~/.claude/channels/discord/.env. You can also write that file by hand, or set the variable in your shell environment — shell takes precedence.

To run multiple bots on one machine (different tokens, separate allowlists), point DISCORD_STATE_DIR at a different directory per instance.

6. Relaunch with the channel flag.

The server won't connect without this — exit your session and start a new one:

claude --channels plugin:discord@claude-plugins-official

7. Pair.

With Claude Code running from the previous step, DM your bot on Discord — it replies with a pairing code. If the bot doesn't respond, make sure your session is running with --channels. In your Claude Code session:

/discord:access pair <code>

Your next DM reaches the assistant.

8. Lock it down.

Pairing is for capturing IDs. Once you're in, switch to allowlist so strangers don't get pairing-code replies. Ask Claude to do it, or /discord:access policy allowlist directly.

Access control

See ACCESS.md for DM policies, guild channels, mention detection, delivery config, skill commands, and the access.json schema.

Quick reference: IDs are Discord snowflakes (numeric — enable Developer Mode, right-click → Copy ID). Default policy is pairing. Guild channels are opt-in per channel ID.

Tools exposed to the assistant

Tool Purpose
reply Send to a channel. Takes chat_id + text, optionally reply_to (message ID) for native threading and files (absolute paths) for attachments — max 10 files, 25MB each. Auto-chunks; files attach to the first chunk. Returns the sent message ID(s).
react Add an emoji reaction to any message by ID. Unicode emoji work directly; custom emoji need <:name:id> form.
list_emojis List the custom emoji the bot can use in a chat, in the <:name:id> form react and reply need. A server channel lists that server's emoji; a DM lists those of servers with an opted-in channel. The application's own emoji (Developer Portal → Emojis) are always included. Optional query filters by name; capped at 200 per call.
edit_message Edit a message the bot previously sent. Useful for "working…" → result progress updates. Only works on the bot's own messages.
fetch_messages Pull recent history from a channel (oldest-first). Capped at 100 per call. Each line includes the message ID so the model can reply_to it; messages with attachments are marked +Natt. Discord's search API isn't exposed to bots, so this is the only lookback.
download_attachment Download all attachments from a specific message by ID to ~/.claude/channels/discord/inbox/. Returns file paths + metadata. Use when fetch_messages shows a message has attachments.
create_thread Start a public thread in an opted-in text or announcement channel. Takes chat_id + name, optionally message_id to start from a message. Returns the thread ID, which works as chat_id in the other tools. The thread follows its parent channel's access rules. Needs the Create Public Threads permission — if you invited the bot without it, add it to the bot's role.

Inbound messages trigger a typing indicator automatically — Discord shows "botname is typing…" while the assistant works on a response.

Attachments

Attachments are not auto-downloaded. The <channel> notification lists each attachment's name, type, and size — the assistant calls download_attachment(chat_id, message_id) when it actually wants the file. Downloads land in ~/.claude/channels/discord/inbox/.

Same path for attachments on historical messages found via fetch_messages (messages with attachments are marked +Natt).

Hosts

HostInstalls
Claude Code2 skills1 MCP server
CodexSkills only
OpenCodeSkills only

Members2 skills

  • accessManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.
  • configureSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how do I set this up" or "who can reach me," or wants to check channel status.

Permissions

Full install
0.0.6

Runs on its own

  • MCP serverClaude Codediscordbun run --cwd ${CLAUDE_PLUGIN_ROOT} --shell=bun --silent start
DeclaredDetected
Runs code—mcp:discordnode
Installs—bun
Runs install scripts—None
Network—bun.shdiscord.com
Needs credentials—DISCORD_BOT_TOKEN
Outside the workspace—~/.claude
Agent tools—None

Checks

Low risk · Nothing worth a warning was found.

Not reviewed by a person · Checked by rules; the model review is not switched on yet.

6 minor marks: common commands and the like, noted but not a concern
  • Rule · command_injectionACCESS.md:58
  • Rule · command_injectionACCESS.md:94
  • Rule · code_executionREADME.md:9
  • Rule · resource_abuseserver.ts:834
  • Rule · resource_abuseserver.ts:841
  • Rule · resource_abuseserver.ts:842

Files10 files · 94.4 KB

  • .mcp.json165 B
  • ACCESS.md6.4 KB
  • LICENSE11.1 KB
  • README.md5.5 KB
  • bun.lock23.4 KB
  • package.json306 B
  • server.ts38.7 KB
.claude-plugin/1
  • plugin.json290 B
skills/access/1
  • SKILL.md4.3 KB
skills/configure/1
  • SKILL.md4.2 KB

Versions

  1. #10.0.6latestNov 19, 2026

Open in Codeg

Or copy its address to search for in Codeg’s Discover.

anthropics/discord

No Codeg yet?Download