Discord MCP Server
Discord MCP Server
直接从你的 AI 编程助手中管理 Discord 服务器。创建频道、分类、角色,设置权限,分配角色,以及更多操作——全部通过自然语言完成。
virustotal: https://www.virustotal.com/gui/file/56fafed35e2734debed600e585741c53f456148da257065e9ea8c9fcb62c798d
工具
工具 | 描述 |
| 创建新的分类频道 |
| 在分类下创建文字或语音频道 |
| 创建具有颜色、独立显示、可提及属性的新角色 |
| 编辑角色的名称、颜色、独立显示或可提及属性 |
| 删除角色(非托管,且位于机器人层级之下) |
| 按用户名将角色分配给成员 |
| 按用户名移除成员的角色 |
| 设置频道权限(允许/拒绝角色、只读模式、帖子控制) |
| 一次调用即可创建频道并设置限制 |
| 重命名文字或语音频道 |
| 删除分类频道 |
| 删除文字或语音频道 |
| 列出所有频道及其名称、类型和分类 |
| 列出所有角色及其名称、颜色和成员数量 |
| 在文字频道中创建 Webhook |
| 通过现有 Webhook 发送消息 |
| 设置文字频道的慢速模式延迟(秒) |
Related MCP server: discord-mcp
设置
1. 创建 Discord 机器人
点击新建应用 → 为其命名 → 创建
转到机器人 → 添加机器人
在特权网关意图下,启用:
Server Members IntentMessage Content Intent
复制令牌
转到 OAuth2 → URL 生成器
作用域:
bot机器人权限:
Administrator(或手动选择:管理频道、管理角色、踢出成员、管理 Webhook、发送消息、读取消息、查看频道)
在浏览器中打开生成的 URL,将机器人邀请到你的服务器
2. 配置环境
cp .env.example .env编辑 .env 并粘贴你的机器人令牌:
DISCORD_TOKEN=your_token_here可选:按名称将机器人固定到特定服务器(默认为 Monolith)。所有工具仅在此服务器上运行:
DISCORD_GUILD_NAME=Monolith3. 安装依赖
pip install -r requirements.txtMCP 主机配置
opencode
将以下内容添加到项目根目录的 opencode.json 中:
{
"mcp": {
"discord": {
"type": "local",
"command": ["python", "/absolute/path/to/discord_mcp_server.py"]
}
}
}重启 opencode 以加载服务器。
Claude Desktop
编辑 claude_desktop_config.json(文件 → 设置 → 开发者 → 编辑配置):
{
"mcpServers": {
"discord": {
"command": "python",
"args": ["/absolute/path/to/discord_mcp_server.py"],
"env": {
"DISCORD_TOKEN": "your_token_here"
}
}
}
}Claude Code
将以下内容添加到 ~/.claude.json 或项目中的 .mcp.json:
{
"mcpServers": {
"discord": {
"command": "python",
"args": ["/absolute/path/to/discord_mcp_server.py"],
"env": {
"DISCORD_TOKEN": "your_token_here"
}
}
}
}Cursor
在项目根目录创建 .cursor/mcp.json(或全局使用 ~/.cursor/mcp.json):
{
"mcpServers": {
"discord": {
"command": "python",
"args": ["/absolute/path/to/discord_mcp_server.py"],
"env": {
"DISCORD_TOKEN": "your_token_here"
}
}
}
}Windsurf
将以下内容添加到 ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"discord": {
"command": "python",
"args": ["/absolute/path/to/discord_mcp_server.py"],
"env": {
"DISCORD_TOKEN": "your_token_here"
}
}
}
}Codex CLI
将以下内容添加到 ~/.codex/config.toml:
[mcp_servers.discord]
command = "python"
args = ["/absolute/path/to/discord_mcp_server.py"]
[mcp_servers.discord.env]
DISCORD_TOKEN = "your_token_here"或通过 CLI 添加:
codex mcp add discord -- python /absolute/path/to/discord_mcp_server.pyAntigravity (Google)
将以下内容添加到 ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"discord": {
"command": "python",
"args": ["C:\\path\\to\\discord_mcp_server.py"],
"env": {
"DISCORD_TOKEN": "your_token_here"
}
}
}
}打开 Antigravity → Agent 面板 → ... → MCP 服务器 → 管理 MCP 服务器 → 查看原始配置。
注意: 如果使用
.env文件而不是内联的env,请省略env块,并确保脚本中的load_dotenv()能找到你的.env(工作目录取决于主机)。
工作原理
该脚本通过 stdio 运行一个 MCP 服务器,通过机器人令牌连接到 Discord。它在启动时注册所有工具,你的 AI 助手可以按需调用这些工具。Discord 机器人只需要在一个服务器中——它会在登录时自动选择第一个服务器。
This server cannot be deployed
Maintenance
Related MCP Connectors
Build Discord communities with AI: roles, channels, modules, automations and reviewed announcements.
Control your Discord community: send/read messages, manage channels and forums, and handle webhook…
An MCP server that integrates with Discord to provide AI-powered features.
Run Discord forms, surveys, polls and quizzes from your AI app: build, launch and analyze projects.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceControl your Discord server with AI. Lets you manage channels, roles, members, messages, and more through natural language.131 npmMIT
- AlicenseAqualityCmaintenanceEnables AI clients to manage Discord servers, including channels, messages, roles, members, permissions, threads, invites, events, webhooks, and emoji, through natural language commands.55131 npm1MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with Discord by managing servers, channels, roles, members, messages, forum posts, reactions, webhooks, and permissions.1,016 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with the Discord platform for managing servers, channels, messages, roles, members, forums, and webhooks through natural language.1,016 npmMIT