mcp-discord
@devli13/mcp-discord
MCP-сервер для Discord. Отправляйте сообщения, модерируйте, управляйте каналами, проверяйте серверы — из Claude Code, агентов Paperclip, Gemini CLI или любого другого MCP-совместимого клиента.
Чистая обертка REST. Без Gateway. Без базы данных. Только API Discord v10 в виде 26 хорошо задокументированных инструментов с ограничением частоты запросов (rate limiting) для каждого маршрута и структурированными результатами ошибок.
Зачем
API Discord обширен и неудобен для агентов при вызове через обычный curl. Агенты сталкиваются с ограничениями частоты запросов, неправильно обрабатывают 429 ошибки, путаются в причинах аудита, забывают курсоры пагинации. Этот MCP решает это раз и навсегда, чтобы агенты могли сосредоточиться на намерениях: «удалить то спам-сообщение», «опубликовать ежедневную сводку в #mod-log», «заблокировать @user на час».
Также отлично подходит для людей. Подключившись к Claude Code, вы можете сказать: «сделай краткую сводку последних 50 сообщений в моем Discord-канале #dev», и Claude просто сделает это.
Related MCP server: Discord Bridge MCP Server
Установка
npm install -g @devli13/mcp-discordИли через npx (без установки):
DISCORD_BOT_TOKEN=<your-token> npx -y @devli13/mcp-discordНастройка
1. Создайте бота Discord
Перейдите на https://discord.com/developers/applications → New Application
Добавьте Bot в приложение
Скопируйте токен бота — это ваш
DISCORD_BOT_TOKENПригласите бота на свой сервер, используя генератор URL OAuth2 (область действия:
bot). Выберите разрешения в зависимости от того, что должен делать MCP (например, «Управление сообщениями» для удаления, «Модерация участников» для тайм-аутов)
2. Подключите его к вашему MCP-клиенту
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. (Опционально) Включите привилегированные интенты
Если вы хотите получать список участников сервера (discord_list_members) или использовать этот MCP вместе с сопутствующим плагином для входящих событий, включите Server Members Intent и Message Content Intent в настройках вашего бота на портале разработчика. Они не требуются для большинства операций MCP — только для определенных конечных точек.
Справочник инструментов
Все инструменты имеют префикс discord_* и возвращают либо JSON-блок (в случае успеха), либо отформатированное сообщение об ошибке (в случае неудачи). Ни один из них не вызывает исключений — каждый инструмент возвращает пригодный для использования строковый результат.
Сообщения (8)
Инструмент | Назначение |
| Отправка в канал. Поддерживает эмбеды, ответы, управление упоминаниями |
| Редактирование собственного сообщения бота |
| Удаление одного сообщения (ботом или другими, при наличии прав «Управление сообщениями») |
| Удаление 2-100 сообщений (младше 14 дней) за один вызов |
| Получение одного сообщения по ID |
| История канала с пагинацией (курсоры before/after/around) |
| Управление закрепленными сообщениями |
Реакции (3)
Инструмент | Назначение |
| Бот добавляет реакцию |
| Удаление реакции бота или пользователя |
| Список пользователей, отреагировавших эмодзи |
Каналы и ветки (5)
Инструмент | Назначение |
| Все каналы на сервере |
| Детали одного канала |
| Создание новой ветки (публичной или приватной, привязанной или отдельной) |
| Все активные ветки на сервере |
| Запуск индикатора «бот печатает…» |
Модерация (6)
Инструмент | Назначение |
| Профиль участника (роли, дата вступления, состояние тайм-аута) |
| Список участников с пагинацией (требуется интент Server Members) |
| Заглушение через |
| Удаление с сервера |
| Управление ролями |
Информация о сервере (4)
Инструмент | Назначение |
| Все серверы, на которых есть бот |
| Детали одного сервера |
| Все роли, отсортированные по позиции |
| Недавние записи журнала аудита (фильтрация по пользователю, действию и т.д.) |
Не включено (намеренно):
ban/unban— намеренно. Используйте интерфейс Discord; необратимые действия не должны выполняться одним вызовом агентаСоздание/удаление/редактирование каналов — высокий риск, используйте интерфейс
CRUD вебхуков — не требуется для большинства сценариев агентов; можно добавить в будущем релизе
Голосовые операции, управление стикерами/эмодзи — вне области действия v0.1
Пример: краткая сводка канала через 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)Пример: ежедневная сводка агента Paperclip
// 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 (DISCORD_50001, HTTP 403): Missing Access
Details: [...]
(This error is transient and may succeed on retry.)MCP уже обрабатывает повторные попытки внутри для 429 (ограничения частоты) и 5xx (ошибки сервера) с экспоненциальной задержкой.
Ограничения частоты запросов (Rate limits)
В Discord есть два уровня ограничений:
По маршруту — каждая конечная точка API имеет независимые корзины. Этот MCP сериализует запросы по (метод + шаблон маршрута), чтобы предотвратить превышение лимита 429.
Глобальный — на бота, по всем конечным точкам. MCP глобально учитывает заголовки
Retry-After.
Вам не нужно об этом думать. Если вы постоянно достигаете глобального лимита, вероятно, вы делаете что-то, что требует участия человека.
Безопасность
Никогда не коммитьте токен вашего бота. Этот MCP считывает его из переменной окружения
DISCORD_BOT_TOKENпри запуске.Используйте URL-адреса приглашений с минимальными привилегиями. Не давайте ботам права администратора, если вам нужно только «Управление сообщениями».
Причины в журнале аудита — все инструменты модерации принимают аргумент
reason, который отображается в журнале аудита Discord. Используйте его.
Разработка
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)Сопутствующий проект — входящие события
Этот MCP обрабатывает исходящие REST-вызовы (отправка, удаление, модерация). Он не поддерживает WebSocket Discord Gateway, поэтому не может реагировать на входящие события (упоминание бота через @, личные сообщения, вступление новых участников).
Для входящих событий Discord в настройке Paperclip используйте @devli13/paperclip-plugin-discord — форк @mvanhorn/paperclip-plugin-discord с произвольной маршрутизацией @упоминаний, поддержкой личных сообщений, сериализованной очередью сообщений для каждого контекста и заполнением пропущенных упоминаний.
Эти два проекта разработаны для совместной работы: плагин получает события и вызывает вашего агента; агент использует этот MCP для ответа и модерации. Используйте один или оба в зависимости от вашей настройки.
Атрибуция
См. ATTRIBUTION.md. Кратко: создано вместе с форком paperclip-plugin-discord от @mvanhorn, чья обработка Gateway вдохновила использованные здесь паттерны проектирования.
Лицензия
MIT — см. 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.
Loading tool schema changelog…
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
Manage a Discord server from Claude, ChatGPT or any MCP client. Sign in with Discord, no bot token.
Discord MCP server for ChatGPT, Claude and any AI agent: list servers and channels, read channel messages, search messages, send message, reply to message, send DM, read mentions and assign role in your own Discord account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Discord yourself; Cotlet does not store your password and you need no Discord API key. About the official Discord API: Yes, Discord has an official API for bots and OAuth2 apps, but it acts as a bot that a server manager adds, not as you, and Discord has no official MCP server for it (checked 5 Nov 2026). The MCP server on Discord's docs site only searches documentation. Setup and FAQ: https://cotlet.dev/integrations/discord-api-mcp-server
- Discortics - Discord BotDeprecatedcom.discortics
Set up and manage your Discord server from MCP: channels, roles, verification, tickets and security.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
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.19MIT
- 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.63MIT
- 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.1MIT
- 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