Skip to main content
Glama
>DiscordMCP

>DiscordMCP

by JeamDev

DiscordMCP

Ваш сервер. Ваш бот. Управление обычными словами.

Русский · English

Node.js MCP License: MIT Discord

Подключите созданного вами Discord-бота к ChatGPT Desktop, Codex или другому MCP-клиенту — и управляйте сервером через ассистента.

Как это работает

DiscordMCP — мост между ИИ-ассистентом и официальным Discord API. Вы создаёте своего бота, приглашаете его на сервер и сохраняете токен локально. Мост предоставляет ассистенту инструменты для действий от имени этого бота.

flowchart LR
    A[Вы] -->|Обычная речь| B[ChatGPT Desktop / MCP-клиент]
    B <-->|MCP · stdio| C[DiscordMCP]
    C <-->|Bot API| D[Ваш Discord-бот]
    D <-->|Выданные права| E[Ваш сервер]

У бота не должно быть заранее написанных команд или собственной логики: достаточно Discord application и Bot Token. Для REST-действий Gateway не нужен; для голоса и событий соединение открывается по необходимости. ИИ работает в вашем MCP-клиенте. Отдельный ключ OpenAI для DiscordMCP не требуется.

Related MCP server: discord-bot-mcp

Что можно попросить

«Оформи сервер в космическом стиле: предложи категории, названия каналов, цвета ролей, приветствие и правила. Сначала покажи план.»

«Посмотри текущие каналы и роли. Предложи аккуратное оформление без удаления старого контента и изменения прав доступа.»

«Создай канал объявлений и красиво оформи правила через embed. Используй welcome.png из папки assets.»

Область

Возможности

Оформление

Название, иконка, баннер, роли, цвета, эмодзи, стикеры, welcome screen, onboarding

Структура

Категории, текстовые и голосовые каналы, права, форумы, ветки

Сообщения

Чтение, поиск, embeds, компоненты, вложения, ответы, закрепления

Управление

Участники, роли, timeout, kick/ban, AutoMod, аудит

Сообщество

События, опросы, вебхуки, application commands

Голос

Подключение, локальное аудио, очередь, пауза, soundboard

Возможности ограничены правами бота, положением ролей, intents и правилами Discord. Например, баннер доступен только при поддержке со стороны самого сервера.

1. Создайте своего бота

  1. Откройте Discord Developer Portal → New Application.

  2. На странице Bot создайте бота, если он ещё не создан, и получите Bot Token. Нужен токен бота, не Client Secret и не токен личного аккаунта.

  3. Включите Message Content Intent, если хотите читать сообщения, и Server Members Intent, если нужны списки участников. Эти настройки также включаются в .env.

  4. Через раздел установки / OAuth2 пригласите бота на свой сервер со scope bot; для application commands добавьте applications.commands.

  5. Выдайте права под задачу. Для оформления обычно нужны управление сервером, каналами, ролями и выражениями, отправка сообщений и embeds. Права модерации и вебхуков выдаются отдельно.

  6. Поставьте роль бота выше ролей, которыми он должен управлять. Владельцем сервера и равными или более высокими ролями бот управлять не сможет.

  7. В Discord включите Настройки → Расширенные → Режим разработчика и скопируйте ID сервера.

2. Установите мост

Требуются Node.js 22.12+, npm и Git.

git clone https://github.com/JeamDev/DiscordMCP.git
cd DiscordMCP
npm ci
npm run build

На Windows можно запустить мастер:

npm run setup

Он запросит токен скрытым вводом, проверит его через Discord, сохранит .env и предложит регистрацию MCP через установленный Codex CLI. Встроенная ссылка приглашения запрашивает Administrator для полного управления: проверьте права и уменьшите их, если вашей задаче это не нужно. Уже приглашённого бота повторно приглашать не требуется.

На любой ОС доступна ручная настройка. Скопируйте .env.example в .env:

# Windows PowerShell
Copy-Item .env.example .env
# macOS / Linux
cp .env.example .env

Откройте .env локальным редактором и замените заглушки:

DISCORD_BOT_TOKEN=YOUR_BOT_TOKEN
DISCORD_GUILD_ID=YOUR_SERVER_ID
DISCORD_ALLOWED_GUILD_IDS=YOUR_SERVER_ID
DISCORD_MESSAGE_CONTENT=true
DISCORD_GUILD_MEMBERS=true

Токен не нужно отправлять ассистенту в чат или указывать в конфигурации MCP-клиента: приложение читает .env из своей папки. Этот файл исключён из Git. Если intents не нужны или не включены в Developer Portal, оставьте соответствующие значения false.

3. Подключите ChatGPT Desktop / Codex

Откройте Settings → MCP servers → Add server, выберите STDIO:

Поле

Значение

Name

discord-control

Command

node или полный путь к node.exe

Arguments

Один аргумент: полный путь к DiscordMCP/dist/index.js

Сохраните и нажмите Restart. Мастер Windows может выполнить регистрацию автоматически; отдельно она доступна через npm run register.

Либо используйте CLI:

codex mcp add discord-control -- node /absolute/path/DiscordMCP/dist/index.js

Путь должен быть абсолютным; пути с пробелами заключайте в кавычки. Поддерживаемые локальные клиенты одного Codex-host используют общую MCP-конфигурацию. Официальная инструкция OpenAI.

ChatGPT в браузере: этот проект предоставляет локальный stdio, не публичный HTTP endpoint. Веб-версия не читает локальный config.toml; облачному чату нужны доступные ему plugin/remote MCP tools. Инструкция выше относится к локальному desktop-host. Область поддержки.

{
  "mcpServers": {
    "discord-control": {
      "command": "node",
      "args": ["/absolute/path/DiscordMCP/dist/index.js"]
    }
  }
}

Формат зависит от клиента. В Windows JSON-путях используйте / или экранированные \\.

4. Начните работу

npm run doctor

Попросите ассистента: «Проверь подключение DiscordMCP и покажи доступные серверы. Пока ничего не меняй.» Затем опишите задачу обычными словами.

Для справки доступны discord_status, discord_help и ресурс discord://catalog. Без токена MCP тоже запускается для диагностики; операции Discord вернут ошибку настройки.

Получить схему через discord_help:

{"group":"channels","action":"create"}

Вызвать discord_channels:

{
  "action": "create",
  "params": {"guild_id": "123456789012345678"},
  "body": {"name": "welcome", "type": 0, "topic": "Start here"},
  "reason": "Approved server design"
}

Все snowflake ID и битовые права передаются строками. Упоминания отключены по умолчанию. Файлы берутся из assets/; выход за пределы папки, в том числе через symlink, блокируется.

Настройки

Переменная

Назначение

DISCORD_BOT_TOKEN

Токен созданного вами бота

DISCORD_GUILD_ID

Сервер по умолчанию

DISCORD_ALLOWED_GUILD_IDS

Разрешённые серверы через запятую; пусто — все доступные боту

DISCORD_ASSET_DIR

Папка изображений, вложений и аудио; по умолчанию ./assets

DISCORD_MESSAGE_CONTENT

Содержимое сообщений, по умолчанию false

DISCORD_GUILD_MEMBERS

Intent участников, по умолчанию false

DISCORD_EVENT_BUFFER_SIZE

Буфер событий: 10–2000, по умолчанию 200

Окружение процесса имеет приоритет над .env. После изменений перезапустите MCP. При заданном allowlist глобальные изменения профиля и приложения блокируются, чтобы не затронуть другие серверы.

Если что-то не работает

Симптом

Что проверить

401

Правильный Bot Token и перезапуск MCP после изменения

403

Права бота и канала, положение ролей, intents

Сервер не найден

ID сервера, приглашение бота, allowlist

Сообщения не читаются

Message Content Intent в Developer Portal и .env

Нет инструментов в чате

Абсолютный путь к сборке, доступность Node.js, Restart MCP

429

Дождитесь снятия rate limit; не повторяйте успешные изменения

Границы и безопасность

Используются только официальные bot accounts. Токены личных аккаунтов и self-bot не поддерживаются. Мост проверяет серверный allowlist, ограничивает файлы и скрывает токены в результатах. Подтверждения опасных действий настраиваются в MCP-клиенте; сам мост не является отдельной системой согласования.

Запрошенные сообщения и сведения о сервере возвращаются вашему ИИ-клиенту. Выдавайте боту доступ только к нужным каналам. Не публикуйте .env, токены и приватную переписку. Безопасность.

Разработка

npm run check

TypeScript и 22 офлайн-теста: MCP handshake, stdio, каталог операций, изоляция серверов, файлы, скрытие секретов и аудио. Токен не требуется; живой Discord не изменяется.

Стек: TypeScript · MCP SDK · Discord.js · Zod · FFmpeg.

Лицензия

MIT — код можно свободно использовать, изменять и распространять, в том числе в коммерческих проектах, с сохранением уведомления об авторских правах и текста лицензии. Зависимости сохраняют собственные лицензии.

Обложка — концептуальная иллюстрация, не интерфейс продукта.

Available Tools

27 tools
discord_accountC
Destructive

Discord account. Actions: me, edit, guilds, user, application, edit_application. Call discord_help with group="account" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_automodC
Destructive

Discord automod. Actions: list, get, create, edit, delete. Call discord_help with group="automod" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_channelsA
Destructive

Discord channels. Actions: list, get, create, edit, delete, reorder, set_permissions, delete_permissions, follow, typing. Call discord_help with group="channels" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_commandsC
Destructive

Discord commands. Actions: guild_list, guild_create, guild_edit, guild_delete, guild_replace_all, global_list, global_create, global_edit, global_delete, global_replace_all. Call discord_help with group="commands" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_communityC
Destructive

Discord community. Actions: welcome_get, welcome_edit, onboarding_get, onboarding_edit, widget_get, widget_edit, widget_json, templates, template_create, template_sync, template_edit, template_delete. Call discord_help with group="community" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_emojisB
Destructive

Discord emojis. Actions: list, get, create, edit, delete. Call discord_help with group="emojis" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_eventsB
Destructive

Discord events. Actions: list, get, create, edit, delete, users. Call discord_help with group="events" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_gatewayB

Connect/disconnect the real-time Discord Gateway, read bounded events by cursor, or set bot presence. enable_interactions=true auto-defers slash commands ephemerally and buttons/selects as updates so discord_interactions can respond within 14 minutes. Autocomplete returns no suggestions. No autonomous AI replies.

Inputs: action (required), after, limit, types, +5 more.

discord_guildB
Destructive

Discord guild. Actions: get, preview, edit, audit_log, voice_regions, integrations, delete_integration, vanity_url, incidents, leave. Call discord_help with group="guild" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_helpA
Read-onlyIdempotent

Discover operations and exact required route IDs, body schema and query fields. With no group returns the catalog summary; group+action returns a detailed schema.

Inputs: group, action.

discord_interactionsA
Destructive

Reply to an interaction_ready event from the Gateway. Uses an internally retained token, never a caller-provided credential. Initial command replies are ephemeral. body supports content, embeds and components (Discord.js response format). Tokens expire after 14 minutes. Opening modals requires a custom immediate handler and is not supported by deferred replies.

Inputs: action (required), interaction_id (required), body.

discord_invitesC
Destructive

Discord invites. Actions: guild_list, channel_list, create, get, delete. Call discord_help with group="invites" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_membersA
Destructive

Discord members. Actions: list, get, search, edit, edit_me, add_role, remove_role, kick, prune_count, prune. Call discord_help with group="members" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_messagesB
Destructive

Discord messages. Actions: list, search, get, send, edit, delete, bulk_delete, crosspost, pins, pin, unpin. Call discord_help with group="messages" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_moderationC
Destructive

Discord moderation. Actions: bans, ban_info, ban, unban, bulk_ban. Call discord_help with group="moderation" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_permissionsA
Read-onlyIdempotent

Encode named Discord permissions into a decimal bitfield or decode a bitfield. With no arguments lists all current permission names. Use for roles and channel overwrites.

Inputs: names, bitfield.

discord_pollsC
Destructive

Discord polls. Actions: voters, end. Call discord_help with group="polls" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_reactionsC
Destructive

Discord reactions. Actions: add, remove_own, remove_user, list, clear, clear_emoji. Call discord_help with group="reactions" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_rolesC
Destructive

Discord roles. Actions: list, get, member_counts, create, edit, reorder, delete. Call discord_help with group="roles" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_snapshotA
Read-onlyIdempotent

Read server settings, roles, channels, emojis and scheduled events together for planning an appearance/layout change. Each section reports its own permission error.

Inputs: guild_id.

discord_soundboardB
Destructive

Discord soundboard. Actions: defaults, list, get, create, edit, delete, play. Call discord_help with group="soundboard" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_stageC
Destructive

Discord stage. Actions: get, create, edit, delete, voice_state_me, voice_state_user. Call discord_help with group="stage" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_statusB
Read-onlyIdempotent

Check local setup, optional Discord authentication, default/allowed servers, Gateway and voice status. Works before a bot token is configured.

Inputs: check_connection.

discord_stickersB
Destructive

Discord stickers. Actions: list, get, create, edit, delete. Call discord_help with group="stickers" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_threadsB
Destructive

Discord threads. Actions: create, from_message, active, archived_public, archived_private, archived_joined, join, leave, add_member, remove_member, members. Call discord_help with group="threads" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

discord_voiceA

Join/leave a voice or stage channel and play/queue local audio using FFmpeg, Opus and Discord DAVE encryption. Supports pause/resume/skip/stop/status/dependencies. For soundboard join with self_deaf=false, then use discord_soundboard.play. This does not record or transcribe participants.

Inputs: action (required), file, volume, enqueue, +3 more.

discord_webhooksB
Destructive

Discord webhooks. Actions: guild_list, channel_list, create, get, edit, delete, execute, get_message, edit_message, delete_message. Call discord_help with group="webhooks" and action for required IDs, request fields, limits and examples.

Inputs: action (required), body, files, query, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 27 tools

    Disambiguation4/5

    Tools are cleanly grouped by Discord resource noun (channels, threads, messages, roles, members, moderation, etc.), so selection is mostly obvious. A few boundaries are blurry: stage/voice/soundboard, gateway vs interactions, and snapshot vs the individual resource tools could be confused by an agent.

    Naming Consistency5/5

    Every tool follows a strict discord_<resource> snake_case pattern, with the verb/action expressed uniformly through the action parameter. This is a fully predictable convention.

    Tool Count4/5

    27 tools is high, but each maps to a distinct Discord API resource group and covers many actions via a single action parameter, which is the right design given the massive surface area. The presence of discord_help keeps navigation manageable, though the count is near the upper bound of what an agent can scan.

    Completeness4/5

    Coverage is very broad—CRUD across guilds, channels, threads, messages, roles, webhooks, emojis, events, automod, commands, gateway and voice. Minor gaps remain: no direct-message tooling and no application command permission management, but core workflows have no dead ends.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      A local MCP server that lets AI clients control a Discord bot via Discord's REST API, offering messaging, administration, and moderation tools. Includes safety features such as guild scoping, allowlists, and opt-in write permissions.
      20
      MIT
    • A
      license
      Not graded
      quality
      F
      maintenance
      MCP server that gives AI agents first-class access to Discord, enabling discovery, messaging, channel management, moderation, and arbitrary REST calls through typed, consent-aware tools.
      3
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables an AI assistant to inspect and manage a Discord server, including organizing channels and roles, handling moderation tasks, and previewing plans before applying larger changes. It connects an MCP client to a Discord bot without hosting its own AI model.
      MIT