home / mcp / discord mcp server

Discord MCP Server

Discord MCP Server for Claude Integration

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "v-3-discordmcp": {
      "command": "node",
      "args": [
        "path/to/discordmcp/build/index.js"
      ],
      "env": {
        "DISCORD_TOKEN": "your_discord_bot_token_here"
      }
    }
  }
}

You can run a Discord MCP Server that lets LLMs interact with Discord channels by sending and reading messages through Discord’s API. This enables safe, controlled conversations in your channels while keeping user consent and security at the forefront.

How to use

You interact with the Discord MCP Server through a client that supports MCP configurations. Add the Discord MCP server to your client after you have started the server locally. Use the available tools to send messages to a channel or to read recent messages from a channel. The server discovers channels automatically and accepts either channel names or IDs. For multiple servers, distinguish by server name in your client configuration.

How to install

Prerequisites: install Node.js 16.x or higher. Install Git if you plan to clone the project. You also need a Discord bot token and invite the bot to your server with Read Messages, View Channels, Send Messages, and Read Message History permissions.

# Step 1: Install Node.js (16.x+)
# Ensure you have npm installed with Node.js
node -v
npm -v

# Step 2: Clone the project
git clone https://github.com/yourusername/discordmcp.git
cd discordmcp

# Step 3: Install dependencies
npm install

# Step 4: Create environment file with your Discord token
# In the project root, create a file named .env with the following line:
DISCORD_TOKEN=your_discord_bot_token_here

# Step 5: Build the server
npm run build

Additional sections

Configuration is done by providing a local MCP configuration for your client. A typical local runtime uses Node to execute the built server, passing the path to the compiled entry file. The server expects the Discord bot token as an environment variable.

Security considerations include ensuring your bot token is never committed to version control and that the bot only has access to channels it is invited to. All message sending actions require explicit user approval in the MCP client flow.

Example usage with a client configuration (illustrative): the client runs the Node process that starts the Discord MCP server and passes the token via environment variables.

Configuration and runtime example

{
  "mcpServers": {
    "discord": {
      "command": "node",
      "args": ["path/to/discordmcp/build/index.js"],
      "env": {
        "DISCORD_TOKEN": "your_discord_bot_token_here"
      }
    }
  }
}

Available tools

send-message

Sends a message to a specified Discord channel. Requires channel name or ID and message content. Optionally specify the target server if the bot is in multiple servers.

read-messages

Fetches recent messages from a specified Discord channel. You can limit how many messages to retrieve and choose a server context if necessary.