A two-way MCP channel server that bridges Discord messages to Claude Code. Claude receives Discord messages as channel notifications and replies back via a tool call.
- Bun v1.0+
- Claude Code v2.1.80+
- A Discord bot application (setup below)
- Go to the Discord Developer Portal
- Click New Application, name it (e.g., "Claude Channel"), and create it
- Go to the Bot tab in the left sidebar
- Click Reset Token, copy the token — you'll need it for
config.json - Under Privileged Gateway Intents, enable:
- Message Content Intent (required to read message text)
- Server Members Intent (optional, helps with username resolution)
- Go to OAuth2 → URL Generator
- Under Scopes, check
bot - Under Bot Permissions, check:
Send MessagesRead Message HistoryView Channels
- Copy the generated URL, open it in your browser, and invite the bot to your server
- Open Discord Settings → Advanced → enable Developer Mode
- Right-click your username → Copy User ID
- With Developer Mode enabled, right-click any channel → Copy Channel ID
Edit config.json:
{
"token": "your-bot-token-here",
"allowedUsers": ["123456789012345678"],
"watchedChannels": ["111111111111111111"]
}| Field | Description |
|---|---|
token |
Your Discord bot token |
allowedUsers |
Array of Discord user IDs that can talk to Claude |
watchedChannels |
Array of channel IDs to monitor (optional — DMs and @mentions always work) |
| Source | Condition | Forwarded? |
|---|---|---|
| DM from allowed user | Always | Yes |
| Message in watched channel | From allowed user | Yes |
| @mention in any channel | From allowed user | Yes |
| Any other message | — | No |
Install dependencies:
bun installRun with Claude Code (research preview):
claude --dangerously-load-development-channels server:discord- Only messages from users in
allowedUsersare forwarded to Claude - Gates on immutable Discord user ID (snowflake), not display name
- Bot token is stored in
config.jsonwhich is gitignored - Messages from other bots are always ignored (prevents loops)