MCP Discord
The most complete open-source MCP server for Discord — 80+ tools, dual-mode: integrated (plugin) or standalone
README
mcp-discord
The most complete open-source MCP server for Discord.
Give any MCP client (Claude, Cursor, custom agents) full control over Discord — messages, moderation, channels, roles, and more. Born from production use at delfus.app, open-sourced for the community.
Why mcp-discord?
- 30+ tools across 8 categories — servers, channels, messages, reactions, members, roles, moderation, and monitoring
- Dual-mode — run standalone (own process) or integrate as a plugin into your existing discord.js bot
- REST-only or Gateway — choose between lightweight REST-only mode or full WebSocket gateway for real-time features
- Two transports — stdio (default, for Claude Desktop / Claude Code) or HTTP with Bearer token auth
- Production-proven — built and used in production at delfus.app
Quick Start
Prerequisites
- Node.js 18 or higher
- A Discord bot token
Install
# Clone the repository
git clone https://github.com/goul4rt/mcp-discord.git
cd mcp-discord
# Install dependencies
npm install
# Build
npm run build
Configure
cp .env.example .env
Edit .env and add your Discord bot token:
DISCORD_TOKEN=your-bot-token-here
Run
# stdio transport (default — for MCP clients like Claude)
npm start
# HTTP transport (for remote/web clients)
npm run start:http
MCP Client Configuration
Claude Desktop / Claude Code
Add to your MCP config file:
{
"mcpServers": {
"discord": {
"command": "node",
"args": ["dist/standalone.js"],
"cwd": "/path/to/mcp-discord",
"env": {
"DISCORD_TOKEN": "your-bot-token-here"
}
}
}
}
With Gateway (real-time features)
{
"mcpServers": {
"discord": {
"command": "node",
"args": ["dist/standalone.js"],
"cwd": "/path/to/mcp-discord",
"env": {
"DISCORD_TOKEN": "your-bot-token-here",
"DISCORD_USE_GATEWAY": "true"
}
}
}
}
Tools
Server / Guild (2 tools)
| Tool | Description |
|---|---|
list_servers |
List all Discord servers the bot has access to |
get_server_info |
Get detailed info about a specific server |
Channels (7 tools)
| Tool | Description |
|---|---|
get_channels |
List all channels in a server |
get_channel |
Get detailed info about a channel |
create_channel |
Create text, voice, category, announcement, forum, or stage channels |
edit_channel |
Edit channel name, topic, NSFW, slowmode, position, category |
delete_channel |
Permanently delete a channel |
create_thread |
Create a thread in a channel (optionally from a message) |
archive_thread |
Archive a thread |
Messages (8 tools)
| Tool | Description |
|---|---|
send_message |
Send messages with text, rich embeds, and replies |
read_messages |
Read recent messages with pagination (up to 100) |
search_messages |
Search messages by content, author, or channel |
edit_message |
Edit a bot message |
delete_message |
Delete a single message |
delete_messages_bulk |
Bulk delete 2-100 messages (< 14 days old) |
pin_message |
Pin a message |
unpin_message |
Unpin a message |
Reactions (2 tools)
| Tool | Description |
|---|---|
add_reaction |
Add emoji reaction (Unicode or custom) |
remove_reaction |
Remove a reaction |
Members / Users (4 tools)
| Tool | Description |
|---|---|
list_members |
List server members with pagination |
get_member |
Get detailed member info (roles, nickname, join date) |
get_user |
Get info about any Discord user by ID |
search_members |
Search members by username or nickname |
Roles (4 tools)
| Tool | Description |
|---|---|
list_roles |
List all roles with permissions, colors, and member counts |
create_role |
Create a new role |
add_role |
Add a role to a member |
remove_role |
Remove a role from a member |
Moderation (4 tools)
| Tool | Description |
|---|---|
timeout_user |
Temporarily mute a user (up to 28 days) |
kick_user |
Kick a user from the server |
ban_user |
Ban a user with optional message deletion |
unban_user |
Unban a user |
Monitoring (2 tools)
| Tool | Description |
|---|---|
get_audit_log |
View server audit log (bans, kicks, changes) |
check_mentions |
Find recent @mentions of the bot or a user |
Architecture
┌─────────────────────────────────────────────────┐
│ MCP Client │
│ (Claude, Cursor, custom) │
└──────────────────┬──────────────────────────────┘
│ stdio or HTTP
┌──────────────────▼──────────────────────────────┐
│ MCP Server │
│ (transport + tool routing) │
└──────────────────┬──────────────────────────────┘
│
┌──────────────────▼──────────────────────────────┐
│ Tool Registry │
│ (30 tools, Zod validation) │
└──────────────────┬──────────────────────────────┘
│
┌──────────────────▼──────────────────────────────┐
│ DiscordProvider (interface) │
├─────────────────────┬───────────────────────────┤
│ StandaloneProvider │ IntegratedProvider │
│ (own token + REST/ │ (uses host bot's │
│ optional gateway) │ existing connection) │
└─────────────────────┴───────────────────────────┘
│
┌──────────────────▼──────────────────────────────┐
│ Discord API │
└─────────────────────────────────────────────────┘
Provider abstraction: MCP tools never touch discord.js directly. They call the DiscordProvider interface, which has two implementations:
- StandaloneProvider — creates its own connection using a bot token. REST-first with optional gateway. Use when running as a separate process.
- IntegratedProvider — receives an existing discord.js
Clientfrom the host bot. Zero overhead, shared cache and gateway. Use when embedding in an existing bot.
Integration Guide
To use mcp-discord as a plugin inside your existing discord.js bot:
import { IntegratedProvider, createMcpServer } from 'mcp-discord';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
// Your existing discord.js client
const provider = new IntegratedProvider({ client: myDiscordClient });
await provider.connect();
const server = createMcpServer({ provider });
const transport = new StdioServerTransport();
await server.connect(transport);
The IntegratedProvider uses your bot's existing gateway connection — no extra WebSocket, no extra authentication, no extra memory.
Configuration Reference
| Variable | Required | Default | Description |
|---|---|---|---|
DISCORD_TOKEN |
Yes | — | Discord bot token |
DISCORD_USE_GATEWAY |
No | false |
Connect to Discord WebSocket gateway for real-time features |
MCP_TRANSPORT |
No | stdio |
Transport mode: stdio or http |
MCP_PORT |
No | 3100 |
HTTP server port (only when MCP_TRANSPORT=http) |
MCP_AUTH_TOKEN |
No | — | Bearer token for HTTP transport authentication |
Contributing
Contributions are welcome! See CONTRIBUTING.md for development setup, code style, and how to add new tools.
License
Author
Created by @goul4rt. Born from delfus.app, open-sourced for the community.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。