Skip to main content
Glama
discord-mcp

discord-mcp

by jslay88

discord-mcp

A local MCP (Model Context Protocol) server for Discord, written in TypeScript. It lets MCP clients like Cursor and Claude Code read and send Discord messages through a bot account.

Tools

Tool

Description

list_servers

List servers the bot is a member of

list_channels

List channels in a server (with IDs and types)

read_messages

Read recent messages from a channel, with paging via before

send_message

Send a message to a channel, optionally as a reply

send_dm

Send a direct message to a user by ID

add_reaction

React to a message with an emoji

search_members

Search server members by name prefix

get_server_info

Get server name, description, member count, owner

Related MCP server: Discord Bridge MCP Server

Setup

1. Create a Discord bot

  1. Go to the Discord Developer Portal and click New Application.

  2. Under Bot, click Reset Token and copy the token — this is your DISCORD_TOKEN.

  3. Still under Bot, enable the Privileged Gateway Intents you want:

    • Message Content Intent — required to read message text.

    • Server Members Intent — required for search_members.

    (The server still works without these, but message content will be empty and member search unavailable.)

  4. Invite the bot to your server: under OAuth2 → URL Generator, select the bot scope, then permissions View Channels, Send Messages, Read Message History, Add Reactions. Open the generated URL and pick your server.

2. Build

npm install
npm run build

3. Register with your MCP client

Cursor — add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project):

{
  "mcpServers": {
    "discord": {
      "command": "node",
      "args": ["/absolute/path/to/discord-mcp/dist/index.js"],
      "env": {
        "DISCORD_TOKEN": "your-bot-token"
      }
    }
  }
}

Claude Code:

claude mcp add discord -e DISCORD_TOKEN=your-bot-token -- node /absolute/path/to/discord-mcp/dist/index.js

Notes

  • The bot connects to Discord lazily on the first tool call, so the server starts even before a token is configured.

  • Messages are capped at Discord's 2000-character limit.

  • DISCORD_BOT_TOKEN is accepted as an alternative to DISCORD_TOKEN.

Why a bot token instead of email/password?

Automating a regular user account (a "self-bot") violates Discord's Terms of Service and commonly results in permanent account bans. Bot tokens are the supported way to build integrations and take about two minutes to set up.

Available Tools

8 tools
add_reactionAdd reactionA

Add an emoji reaction to a message. Use a unicode emoji (e.g. 👍) or custom emoji in <:name:id> format.

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

get_server_infoGet server infoA

Get details about a Discord server: name, description, member count, owner.

Inputs: serverId (required).

list_channelsList channelsB

List channels in a Discord server, including their IDs and types.

Inputs: serverId (required).

list_serversList serversA

List Discord servers (guilds) the bot is a member of.

Inputs: no named parameters.

read_messagesRead messagesA

Read recent messages from a channel or DM. Optionally pass before (a message ID) to page further back in history.

Inputs: channelId (required), limit, before.

search_membersSearch membersA

Search for members in a server by username or nickname prefix.

Inputs: query (required), serverId (required), limit.

send_dmSend direct messageA

Send a direct message to a user by their user ID.

Inputs: userId (required), content (required).

send_messageSend messageA

Send a message to a channel. Optionally reply to an existing message by passing replyToMessageId.

Inputs: content (required), channelId (required), replyToMessageId.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools are clearly distinct (list_servers vs list_channels vs get_server_info). The only potential confusion is between send_message (to a channel) and send_dm (to a user), but the descriptions make the distinction clear.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with underscores (list_servers, send_message, add_reaction). No mixed conventions or vague verbs, making the API predictable.

    Tool Count5/5

    8 tools is well-scoped for a Discord server bot, covering essential operations without being too sparse or bloated. Each tool earns its place.

    Completeness3/5

    Core workflows like reading/sending messages and listing servers/channels are covered, but there are notable gaps such as editing/deleting messages, managing channels, or retrieving specific members. This creates dead ends for some common use cases.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers