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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
An MCP server that integrates with Discord to provide AI-powered features.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
The Canva MCP server connects AI assistants (like Claude, ChatGPT, and Cursor) to Canva's API, enabling them to create and manage designs directly within chat conversations. Key capabilities include generating new designs from prompts, autofilling templates, searching and resizing existing designs, importing files from URLs, exporting designs as PDFs or images, and managing folders and comments without switching between tools.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to manage Discord servers through natural language, offering tools for guilds, channels, messages, roles, members, webhooks, invites, and automations. Includes a conversational agent that responds to @mentions in Discord.8Apache 2.0
- AlicenseNot gradedqualityDmaintenanceControl your Discord server with AI. Lets you manage channels, roles, members, messages, and more through natural language.348MIT
- AlicenseNot gradedqualityDmaintenanceEnables managing a Discord server using natural language through AI clients like Claude, with 139 admin tools across 20 categories for roles, channels, members, messages, threads, moderation, and more.16828MIT
- AlicenseBqualityAmaintenanceGives your AI assistant full control of a Discord server: 148 tools for chat, moderation, automod, events, and administration, up to building a complete community server from one paragraph. Every destructive action previews first and waits for your confirmation.1001547Elastic 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hevji/Discord-Bot-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server