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.
The easiest way to get started is using npx:
npx mcp-discord --config YOUR_DISCORD_TOKEN
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
Before using MCP-Discord, ensure you have:
Your bot needs these permissions in the Discord 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
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 |
DISCORD_TOKEN=your_discord_bot_token
SAMPLING_ENABLED=false
TRANSPORT=http
HTTP_PORT=3000
DEFAULT_RATE_LIMIT_SECONDS=5
DEFAULT_MESSAGE_CHUNK_SIZE=1500
node build/index.js --config "your_discord_bot_token" --sampling --transport http --port 3000 --rate-limit 5 --message-chunk-size 1500
The sampling feature enables bi-directional communication between Discord and the MCP server:
To disable sampling, set SAMPLING_ENABLED=false
or omit the --sampling
flag.
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.
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.
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}"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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