Discord MCP server

Integrates with Discord through Discord.js to provide comprehensive bot capabilities including message management, channel operations, forum posts, reactions, webhooks, and server administration with automatic reconnection and rate limiting protection.
Back to servers
Setup instructions
Provider
IQAI
Release date
Jul 16, 2025
Language
TypeScript
Stats
1 star

The MCP-Discord server is a powerful tool that enables AI assistants to interact with Discord platforms. It provides functionality for managing messages, channels, forum posts, reactions, and webhooks through a standardized Model Context Protocol interface.

Installation Options

Quick Start with NPX

The easiest way to get started is using npx:

npx mcp-discord --config YOUR_DISCORD_TOKEN

Manual Installation

If you prefer to install the server locally:

# Clone the repository
git clone https://github.com/IQAICOM/mcp-discord.git
cd mcp-discord

# Install dependencies
npm install

# Compile TypeScript
npm run build

Prerequisites

Before using MCP-Discord, ensure you have:

  • Node.js (v16.0.0 or higher)
  • npm (v7.0.0 or higher)
  • A Discord bot with:
    • Bot token from the Discord Developer Portal
    • Message Content Intent enabled
    • Server Members Intent enabled
    • Presence Intent enabled

Required Permissions

Your bot needs these permissions in the Discord server:

  • Recommended: Administrator permission for full functionality
  • Alternatively, these specific permissions:
    • Send Messages
    • Create Public Threads
    • Send Messages in Threads
    • Manage Messages
    • Manage Threads
    • Manage Channels
    • Manage Webhooks
    • Add Reactions
    • View Channel

Adding Your Bot to a Server

Use one of these invite links (replace INSERT_CLIENT_ID_HERE with your bot's client ID):

  • Administrator (full access): https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=8

  • Custom permissions (minimum required): https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=52076489808

Configuration

Configure the server through environment variables or command-line arguments:

Option Type Default Description
DISCORD_TOKEN string Required. Discord bot token
SAMPLING_ENABLED boolean true Enables bi-directional message sampling
TRANSPORT string stdio Transport method: stdio or http
HTTP_PORT number 8080 Port for HTTP transport
DEFAULT_RATE_LIMIT_SECONDS number 2 Rate limit (seconds) for sampling requests per user
DEFAULT_MESSAGE_CHUNK_SIZE number 2000 Max message chunk size for sampling responses

Environment Variables Example

DISCORD_TOKEN=your_discord_bot_token
SAMPLING_ENABLED=false
TRANSPORT=http
HTTP_PORT=3000
DEFAULT_RATE_LIMIT_SECONDS=5
DEFAULT_MESSAGE_CHUNK_SIZE=1500

Command-line Arguments Example

node build/index.js --config "your_discord_bot_token" --sampling --transport http --port 3000 --rate-limit 5 --message-chunk-size 1500

Message Sampling Feature

The sampling feature enables bi-directional communication between Discord and the MCP server:

  • When enabled, the bot listens for new messages and mentions
  • Bot adds a 🤔 reaction when mentioned
  • Rate limiting is enforced per user
  • Long responses are split into chunks

To disable sampling, set SAMPLING_ENABLED=false or omit the --sampling flag.

Available Tools

Basic Functions

  • discord_send: Send a message to a specified channel
  • discord_get_server_info: Get Discord server information

Channel Management

  • discord_create_text_channel: Create a text channel
  • discord_delete_channel: Delete a channel

Forum Functions

  • discord_get_forum_channels: Get a list of forum channels
  • discord_create_forum_post: Create a forum post
  • discord_get_forum_post: Get a forum post
  • discord_reply_to_forum: Reply to a forum post
  • discord_delete_forum_post: Delete a forum post

Messages and Reactions

  • discord_read_messages: Read channel messages
  • discord_add_reaction: Add a reaction to a message
  • discord_add_multiple_reactions: Add multiple reactions to a message
  • discord_remove_reaction: Remove a reaction from a message
  • discord_delete_message: Delete a specific message

Webhook Management

  • discord_create_webhook: Create a new webhook
  • discord_send_webhook_message: Send a message using a webhook
  • discord_edit_webhook: Edit an existing webhook
  • discord_delete_webhook: Delete an existing webhook

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "discord" '{"command":"npx","args":["mcp-discord","--config","${DISCORD_TOKEN}"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "discord": {
            "command": "npx",
            "args": [
                "mcp-discord",
                "--config",
                "${DISCORD_TOKEN}"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "discord": {
            "command": "npx",
            "args": [
                "mcp-discord",
                "--config",
                "${DISCORD_TOKEN}"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later