mcp-discord
Provides tools for interacting with Discord's API, enabling AI agents to send messages, moderate content, manage channels, inspect servers, handle reactions, and perform server management operations through Discord's REST API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-discord send a welcome message to #general with the embed about our new project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@devli13/mcp-discord
An MCP server for Discord. Send messages, moderate, manage channels, inspect servers — from Claude Code, Paperclip agents, Gemini CLI, or any MCP-compatible client.
Pure REST wrapper. No Gateway. No database. Just Discord's v10 API as 26 well-documented tools, with per-route rate limiting and structured error results.
Why
Discord's API is sprawling and agent-unfriendly when called via raw curl. Agents hit rate limits, mishandle 429s, fumble audit-log reasons, forget pagination cursors. This MCP fixes that once, so agents can focus on intent: "delete that spam message," "post the daily digest to #mod-log," "timeout @user for an hour."
Also great for humans. Connected to Claude Code, you can say "summarize the last 50 messages in my Discord #dev channel" and Claude just does it.
Related MCP server: Discord Bridge MCP Server
Install
npm install -g @devli13/mcp-discordOr via npx (no install):
DISCORD_BOT_TOKEN=<your-token> npx -y @devli13/mcp-discordSetup
1. Create a Discord bot
Go to https://discord.com/developers/applications → New Application
Add a Bot to the application
Copy the bot token — this is your
DISCORD_BOT_TOKENInvite the bot to your server using the OAuth2 URL generator (scope:
bot). Pick permissions based on what you need the MCP to do (e.g. Manage Messages for deletes, Moderate Members for timeouts)
2. Wire it to your MCP client
Claude Code:
claude mcp add discord \
--env DISCORD_BOT_TOKEN=<your-token> \
-- npx -y @devli13/mcp-discordPaperclip mcp-gateway (.mcp.json):
{
"mcpServers": {
"discord": {
"command": "npx",
"args": ["-y", "@devli13/mcp-discord"],
"env": {
"DISCORD_BOT_TOKEN": "<your-token>"
}
}
}
}Gemini CLI (~/.gemini/config.json):
{
"mcpServers": {
"discord": {
"command": "npx",
"args": ["-y", "@devli13/mcp-discord"]
}
}
}3. (Optional) Enable privileged intents
If you want to list server members (discord_list_members) or use this MCP alongside the companion plugin for inbound events, enable Server Members Intent and Message Content Intent in your bot's Developer Portal settings. These are not required for most MCP operations — only for specific endpoints.
Tool reference
All tools are prefixed discord_* and return either a JSON blob (on success) or a formatted error message (on failure). None throw — every tool returns a usable string result.
Messages (8)
Tool | Purpose |
| Send to a channel. Supports embeds, replies, mention control |
| Edit the bot's own message |
| Delete one message (by bot or others, with Manage Messages) |
| Delete 2-100 messages (<14 days old) in one call |
| Fetch one message by ID |
| Paginated channel history (before/after/around cursors) |
| Manage pins |
Reactions (3)
Tool | Purpose |
| Bot adds a reaction |
| Remove bot's or user's reaction |
| List users who reacted with an emoji |
Channels & Threads (5)
Tool | Purpose |
| All channels in a guild |
| Single channel details |
| Spawn a new thread (public or private, anchored or standalone) |
| All active threads in a guild |
| Trigger "bot is typing…" indicator |
Moderation (6)
Tool | Purpose |
| Member profile (roles, join date, timeout state) |
| Paginated member list (requires Server Members intent) |
| Mute via |
| Remove from guild |
| Role management |
Server info (4)
Tool | Purpose |
| All guilds the bot is in |
| Single guild details |
| All roles, sorted by position |
| Recent audit log entries (filter by user, action, etc.) |
Not included (by design):
ban/unban— deliberate. Use Discord's UI; irreversible actions shouldn't be one agent-call awayChannel create/delete/edit — high blast radius, use the UI
Webhook CRUD — not needed for most agent flows; can add in a future release
Voice operations, sticker/emoji management — out of scope for v0.1
Example: summarize a channel via Claude Code
User: Summarize the last 30 messages in the #dev channel of my Discord server, guild ID 1234...
Claude (calls discord_list_channels → finds #dev → calls discord_list_messages → writes summary)Example: Paperclip agent daily digest
// From an agent's prompt:
"Post the daily digest to channel 1234. Summarize the last 24h of activity
using discord_list_messages with limit=100, then format as an embed via
discord_send_message."Error handling
Every tool returns a usable text result. On error:
Error (DISCORD_50001, HTTP 403): Missing Access
Details: [...]
(This error is transient and may succeed on retry.)The MCP already handles retries internally for 429 (rate limits) and 5xx (server errors), with exponential backoff.
Rate limits
Discord has two rate-limit layers:
Per-route — each API endpoint has independent buckets. This MCP serializes requests per (method + route template) to prevent bursting past a 429.
Global — per-bot, across all endpoints. The MCP honors
Retry-Afterheaders globally.
You shouldn't need to think about this. If you do hit the global limit repeatedly, you're probably doing something that deserves a human in the loop.
Security
Never commit your bot token. This MCP reads it from
DISCORD_BOT_TOKENenvironment variable at startup.Use least-privilege invite URLs. Don't give bots Administrator if you only need Manage Messages.
Audit log reasons — all moderation tools accept a
reasonargument that appears in Discord's audit log. Use it.
Development
git clone https://github.com/devli13/mcp-discord.git
cd mcp-discord
npm install
npm test # smoke tests (no live Discord calls)
npm run lint # syntax check all files
npm start # boot server over stdio (needs DISCORD_BOT_TOKEN)Companion project — inbound events
This MCP handles outbound REST calls (send, delete, moderate). It does not hold a Discord Gateway WebSocket, so it can't react to inbound events (a user @mentioning the bot, DMs, new members joining).
For inbound Discord events in a Paperclip setup, use @devli13/paperclip-plugin-discord — a fork of @mvanhorn/paperclip-plugin-discord with free-form @mention routing, DM support, a serialized per-context message queue, and downtime mention backfill.
The two projects are designed to work together: the plugin receives events, invokes your agent; the agent uses this MCP to respond and moderate. Use either or both depending on your setup.
Attribution
See ATTRIBUTION.md. Short version: built alongside the fork of paperclip-plugin-discord by @mvanhorn, whose Gateway handling inspired design patterns here.
License
MIT — see LICENSE.
Available Tools
26 toolsdiscord_add_reactionA
Add a reaction from the bot to a message. Emoji can be a unicode glyph (e.g. "👍") or custom-emoji string ("name:id"). Requires Add Reactions + Read Message History.
Inputs: channel_id (required), message_id (required), emoji (required).
discord_add_roleA
Add a role to a guild member. Requires Manage Roles and the target role must be below the bot's highest role.
Inputs: guild_id (required), user_id (required), role_id (required), reason.
discord_bulk_delete_messagesA
Bulk delete 2-100 messages from a channel. All messages must be less than 14 days old. Useful for raid cleanup. Requires Manage Messages permission.
Inputs: channel_id (required), message_ids (required), reason.
discord_create_threadA
Create a thread. If message_id is provided, creates a thread from that message; otherwise creates a standalone thread in the channel. auto_archive_duration is in minutes: 60, 1440, 4320, or 10080.
Inputs: channel_id (required), name (required), message_id, auto_archive_duration, +2 more.
discord_delete_messageA
Delete a single message. Requires Manage Messages for other users' messages; bot can always delete its own.
Inputs: channel_id (required), message_id (required), reason.
discord_edit_messageA
Edit a message the bot previously sent. Can edit content and embeds. Cannot edit other users' messages.
Inputs: channel_id (required), message_id (required), content, embeds.
discord_get_audit_logA
Fetch recent audit log entries. Filter by action_type (Discord AuditLogEvent enum integer) and/or user_id. Requires View Audit Log permission.
Inputs: guild_id (required), user_id, action_type, before, +1 more.
discord_get_channelB
Fetch details about a single channel — name, type, permission overwrites, parent category, rate limit, etc.
Inputs: channel_id (required).
discord_get_guildC
Fetch details for a single guild — name, icon, owner, member count, features, etc.
Inputs: guild_id (required), with_counts.
discord_get_memberC
Fetch a guild member — nickname, joined_at, roles, communication_disabled_until (timeout), etc.
Inputs: guild_id (required), user_id (required).
discord_get_messageB
Fetch a single message by ID. Useful for reading context before acting.
Inputs: channel_id (required), message_id (required).
discord_get_reactionsA
List users who reacted with a specific emoji on a message. Paginated (default 25, max 100).
Inputs: channel_id (required), message_id (required), emoji (required), limit, +1 more.
discord_kick_userA
Remove a user from the guild. They can rejoin via invite. Requires Kick Members permission.
Inputs: guild_id (required), user_id (required), reason.
discord_list_active_threadsA
List all active (non-archived) threads in a guild.
Inputs: guild_id (required).
discord_list_channelsB
List all channels in a guild (server). Includes text, voice, category, thread channels.
Inputs: guild_id (required).
discord_list_guildsA
List all guilds (servers) the bot is a member of. Useful for multi-server setups.
Inputs: limit.
discord_list_membersA
List members of a guild. Paginate with after cursor (last user ID). Requires the Server Members privileged intent on the bot.
Inputs: guild_id (required), limit, after.
discord_list_messagesA
Fetch recent messages from a channel. Paginate with before/after/around cursors. Default limit is 50, max 100.
Inputs: channel_id (required), limit, before, after, +1 more.
discord_list_rolesA
List all roles in a guild. Returns role objects sorted by position (highest first).
Inputs: guild_id (required).
discord_pin_messageA
Pin a message in a channel. Requires Manage Messages. Channels max 50 pinned messages.
Inputs: channel_id (required), message_id (required), reason.
discord_remove_reactionA
Remove a reaction. Without user_id, removes the bot's own reaction. With user_id, removes a specific user's reaction (requires Manage Messages).
Inputs: channel_id (required), message_id (required), emoji (required), user_id.
discord_remove_roleC
Remove a role from a guild member.
Inputs: guild_id (required), user_id (required), role_id (required), reason.
discord_send_messageA
Send a new message to a Discord channel. Supports plain text, embeds, replies, and allowed_mentions control. Returns the created message object including its ID.
Inputs: channel_id (required), content, embeds, reply_to_message_id, +2 more.
discord_send_typingA
Trigger the "bot is typing…" indicator in a channel for about 10 seconds. Useful before sending a long-form response so users know the bot is working.
Inputs: channel_id (required).
discord_timeout_userA
Timeout a user — they cannot send messages, react, or join voice. Up to 28 days. Pass duration_seconds=0 to remove an existing timeout. Requires Moderate Members permission.
Inputs: guild_id (required), user_id (required), duration_seconds (required), reason.
discord_unpin_messageC
Unpin a previously pinned message.
Inputs: channel_id (required), message_id (required), reason.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 26 tools
Most tools have distinct purposes targeting specific Discord resources and actions, such as send_message vs. edit_message or kick_user vs. timeout_user. However, some overlap exists: add_reaction and remove_reaction are clear, but get_reactions could be confused with list_messages for reading message content, and list_active_threads vs. create_thread might cause minor ambiguity in thread management scenarios.
All tools follow a consistent snake_case naming pattern with a clear verb_noun structure, such as discord_send_message, discord_get_channel, and discord_list_members. The naming is predictable and uniform across all 26 tools, making it easy for agents to understand and select the appropriate tool.
With 26 tools, the count is on the higher side for a Discord bot server, which may feel heavy and potentially overwhelming for agents. While Discord's API is feature-rich, this many tools could lead to decision paralysis or misselection, though it does cover a broad range of functionalities from messaging to moderation.
The tool set provides comprehensive coverage for core Discord bot operations, including CRUD for messages, roles, and members, as well as moderation actions like kick and timeout. Minor gaps exist, such as no tools for editing roles or managing invites, but agents can still handle most common workflows effectively without significant dead ends.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that allows Claude to interact with Discord by providing tools for sending/reading messages and managing server resources through Discord's API.19203 npmMIT
- AlicenseAqualityCmaintenanceAn MCP server that provides native Discord tools for Claude Code, enabling bidirectional communication with remote agents or humans via the Discord REST API. It allows users to send messages, read channel history, and manage reactions directly from their local environment.638 npm3MIT
- AlicenseNot gradedqualityDmaintenanceComprehensive Discord MCP server with 66 tools that provides rich message context including emoji reactions, thread indicators, and attachment metadata inline. Enables AI assistants to interact with Discord servers for messaging, moderation, roles, channels, and more.203 npm1MIT
- AlicenseNot gradedqualityDmaintenanceA comprehensive Discord MCP server enabling AI assistants to run a Discord community through 111 tools for messaging, moderation, roles, channels, forums, webhooks, and more, plus a raw REST API passthrough for full Discord API access.MIT