Discord MCP Server
Enables Claude to interact with Discord through natural conversation, including reading and sending messages, managing threads, reacting, searching history, and sending direct messages using a user token.
README
<div align="center">
🤖 Discord MCP Server
Give Claude full access to Discord.
Read messages, send messages, manage threads, react, search history, send DMs — all through natural conversation.
</div>
What is this?
Discord MCP Server is a Model Context Protocol server that bridges Claude and Discord. Once connected, you can talk to Claude in plain English and it will interact with your Discord account — no scripting, no dashboards, no manual API calls.
Uses a Discord user token — no bot registration needed.
Demo
You: "What are the last 15 messages in #general?"
You: "Send a message to #announcements: deployment done ✅"
You: "Search #support for messages about 'login error'"
You: "DM user 123456789 and say hey, got a minute?"
You: "Create a thread called 'Release notes' from that last message"
You: "What are my recent mentions across all servers?"
You: "React to message 987654321 with 👍"
Tools
| Tool | Description |
|---|---|
get_bot_info |
Connected account info (username, ping, server count) |
list_guilds |
All Discord servers you're in |
get_guild_info |
Server details: members, boosts, verification level, etc. |
list_channels |
All channels in a server, sorted by position |
get_channel_info |
Info about a specific channel |
get_messages |
Fetch recent messages (up to 100), with pagination |
send_message |
Send a message, with optional reply |
send_embed |
Send a rich embed (title, description, fields, color, footer) |
edit_message |
Edit one of your own messages |
delete_message |
Delete a message |
pin_message |
Pin or unpin a message |
add_reaction |
React with a Unicode or custom emoji |
create_thread |
Start a thread from a message or create a standalone one |
list_members |
List server members with roles (up to 1 000) |
get_user_info |
Full profile of a user in a server |
search_messages |
Keyword search across recent channel history |
get_pinned_messages |
All pinned messages in a channel |
get_dm_channels |
List your open DM conversations |
send_dm |
Send a direct message to any user by ID |
get_mentions |
Recent messages that mention you across all servers |
Requirements
- Node.js 18+
- Your Discord user token
Setup
1. Get your Discord User Token
- Open Discord in your browser at discord.com/app
- Press
F12→ Network tab - Send any message or switch a channel
- Find any request to
discord.com/api, click it, look at Request Headers - Copy the value of the
Authorizationheader — that's your token
Or paste this in the browser Console:
(webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m)
.find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken()
⚠️ Your user token = your password. Never share it, commit it to git, or put it in public config files.
2. Install
git clone https://github.com/vovafes/discord-mcp-server.git
cd discord-mcp-server
npm install
npm run build
3. Connect to Claude Desktop
Edit your Claude Desktop config:
- macOS →
~/Library/Application Support/Claude/claude_desktop_config.json - Windows →
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"discord": {
"command": "node",
"args": ["/absolute/path/to/discord-mcp-server/dist/index.js"],
"env": {
"DISCORD_USER_TOKEN": "YOUR_TOKEN_HERE"
}
}
}
}
Restart Claude Desktop — the Discord tools will appear automatically.
4. Connect to Claude Code CLI
claude mcp add discord \
--env DISCORD_USER_TOKEN=YOUR_TOKEN_HERE \
-- node /absolute/path/to/discord-mcp-server/dist/index.js
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
DISCORD_USER_TOKEN |
✅ | — | Your Discord user token |
REQUEST_DELAY_MS |
❌ | 5000 |
Delay between REST calls in ms. Lower = faster, higher = safer. |
Rate-Limit Protection
Discord enforces strict limits on user tokens. Three layers of protection are built in:
Global throttle
Every REST call passes through a shared gate that enforces a minimum gap of REQUEST_DELAY_MS (default 5 seconds) between consecutive requests.
Exponential back-off
On a 429 Too Many Requests response, the server automatically retries:
attempt 1 → wait 2s
attempt 2 → wait 4s
attempt 3 → wait 8s
attempt 4 → wait 16s (then give up)
Hard scan caps
Bulk tools that touch many channels are capped to prevent runaway API storms:
| Tool | Limit |
|---|---|
search_messages |
Max 500 messages (5 batches × 100) |
get_mentions |
Max 20 channels scanned across all servers |
To tune the throttle:
"env": {
"DISCORD_USER_TOKEN": "...",
"REQUEST_DELAY_MS": "2000"
}
Architecture
╔══════════════════╗
║ Claude / MCP ║
║ Client ║
╚════════╤═════════╝
│ stdio (JSON-RPC)
╔════════▼═════════╗
║ discord-mcp ║ ← this server
║ (Node.js) ║
╚════════╤═════════╝
│ discord.js (WebSocket + REST)
╔════════▼═════════╗
║ Discord API ║
╚══════════════════╝
The server speaks MCP over stdio — no open ports, no HTTP server. The MCP host (Claude Desktop, Claude Code, etc.) spawns it as a subprocess.
Development
# Dev mode — no build step needed
DISCORD_USER_TOKEN=your_token npm run dev
# Build
npm run build
# Run built output
DISCORD_USER_TOKEN=your_token npm start
<div align="center">
Made by Claude for Claude 🤖
Built with discord.js · Model Context Protocol SDK
</div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。