Skip to main content
Glama
Discord MCP

Discord MCP

Discord MCP

Local, read-only Discord MCP server. It uses stdio and direct Discord REST API calls—there is no HTTP listener, Kubernetes deployment, Gateway connection, event cache, or write tool.

Safety boundaries

  • DISCORD_ALLOWED_GUILDS is required; the server fails to start without it.

  • DISCORD_ALLOWED_CHANNELS is optional but recommended. When set, all channel and message reads outside it are rejected.

  • Message tools always return message bodies. Enable Message Content Intent for the bot in Discord Developer Portal; without it, Discord returns empty content fields.

  • The bot needs only View Channel and Read Message History for the initial tools. Do not grant Administrator, management, moderation, webhook, invite, or voice permissions.

  • The bot token stays in your local MCP configuration or a local .env file; .env is ignored by Git.

Related MCP server: telegram-mcp

Tools

  • discord_list_guilds

  • discord_list_channels

  • discord_get_channel

  • discord_list_messages

  • discord_get_message

All tools are read-only. Message reads support a bounded limit (1–100) and a before or after cursor. The service never downloads attachments and never returns attachment URLs.

Setup

npm install

Copy .env.example to an ignored local .env file if you want a convenience template, then export it deliberately before running the development command:

set -a
. ./.env
set +a
npm run dev

Populate DISCORD_BOT_TOKEN and the numeric guild ID in that local file. Use Discord's Developer Mode to copy IDs. Add channel IDs to DISCORD_ALLOWED_CHANNELS before enabling the server for a shared guild.

Build and verify without contacting Discord:

npm run check
npm run build

Codex configuration

Export the configuration variables in the same local environment that launches the Codex CLI. Do not put the token in this repository or config.toml.

Add this local MCP entry to ~/.codex/config.toml, replacing the path with your clone path:

[mcp_servers.discord]
command = "node"
args = ["/absolute/path/to/discord-mcp/dist/index.js"]
cwd = "/absolute/path/to/discord-mcp"
env_vars = [
  "DISCORD_BOT_TOKEN",
  "DISCORD_ALLOWED_GUILDS",
  "DISCORD_ALLOWED_CHANNELS",
]

For example, in the shell you use to start Codex:

export DISCORD_BOT_TOKEN='...'
export DISCORD_ALLOWED_GUILDS='your-guild-id'
export DISCORD_ALLOWED_CHANNELS='your-test-channel-id'
codex

Build first, then restart Codex from that environment. If you use the ChatGPT desktop app rather than Codex CLI, configure the environment at the app-launch level or use the app's MCP-server form; a variable exported in an unrelated Terminal window will not be inherited by the already-running app.

Development

npm run dev
npm test
npm run typecheck

npm run dev reads environment variables from the current shell. It deliberately does not load .env automatically so the token cannot be accidentally supplied through an unexpected execution path.

Available Tools

5 tools
discord_get_channelGet Discord channel metadataA
Read-onlyIdempotent

Gets metadata for one allowlisted guild channel. This does not fetch messages.

Inputs: channelId (required).

discord_get_messageGet one Discord messageA
Read-onlyIdempotent

Gets one message from an allowlisted guild channel. The Discord application must have Message Content Intent enabled.

Inputs: channelId (required), messageId (required).

discord_list_channelsList Discord channelsA
Read-onlyIdempotent

Lists channels in one allowlisted Discord guild. Optional channel allowlisting is applied.

Inputs: guildId (required).

discord_list_guildsList allowed Discord guildsA
Read-onlyIdempotent

Lists only the Discord guilds explicitly allowed by local configuration.

Inputs: no named parameters.

discord_list_messagesList Discord messagesA
Read-onlyIdempotent

Reads a bounded page of messages from one allowlisted guild channel. The Discord application must have Message Content Intent enabled.

Inputs: channelId (required), after, limit, before.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action: listing guilds, listing channels, getting channel metadata, listing messages, and getting a single message. There is no overlap or ambiguity between them.

    Naming Consistency5/5

    All tool names follow the consistent pattern of 'discord_' + verb + '_' + noun, using lowercase snake_case throughout (list_guilds, get_channel, list_messages). This makes the set predictable and easy to navigate.

    Tool Count5/5

    With 5 tools, the server is well-scoped and focused on read-only Discord operations. Each tool covers a distinct aspect of the domain without excess or omissions that would make the set feel thin.

    Completeness3/5

    The tool set provides solid read coverage (guilds, channels, messages), but lacks any write operations like sending messages or creating/deleting channels. This is a notable gap for a general-purpose Discord MCP, though it may be intentional for a read-only use case.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server for interacting with Discord via REST API, enabling guild, channel, and message operations using a bot token.
      7
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Read-only MCP server for self-hosted Telegram access via Telethon. Enables reading messages, chats, and media but disallows any write operations.
      10
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Read-only MCP server for Discord that lists guilds, channels, and reads or searches messages using a self-bot account via discord.py-self.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A local MCP server that reads Discord servers and channels and optionally sends messages with explicit allowlists, read-only by default.
      58 npm
      MIT