关于 Danushkumar-V-mcp-discord
MCP-Discord 通过基于机器人的工具,让 AI 助手与 Discord 交互。它支持消息和频道操作、论坛帖子、表情回应及 Webhook,并提供 stdio 和 streamable HTTP 传输方式。
主要功能
- 01发送和读取频道消息
- 02管理文本频道
- 03创建和管理论坛帖子
- 04添加或移除表情回应
- 05管理 Webhook
适用场景
- 01向 Discord 频道发送消息
- 02查看或删除频道消息
- 03创建论坛帖子并回复
- 04管理频道 Webhook
MCP 相关
此 MCP 服务将 Discord 机器人操作作为工具提供给 MCP 客户端,支持 stdio 和 streamable HTTP 传输方式。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://server.smithery.ai/@Danushkumar-V/mcp-discord/mcpclaude mcp add --transport http ai-smithery-danushkumar-v-mcp-discord https://server.smithery.ai/@Danushkumar-V/mcp-discord/mcp{"mcpServers":{"ai-smithery-danushkumar-v-mcp-discord":{"type":"http","url":"https://server.smithery.ai/@Danushkumar-V/mcp-discord/mcp"}}}在 Cursor 中打开{"servers":{"ai-smithery-danushkumar-v-mcp-discord":{"type":"http","url":"https://server.smithery.ai/@Danushkumar-V/mcp-discord/mcp"}}}在 VS Code 中打开{"mcpServers":{"ai-smithery-danushkumar-v-mcp-discord":{"type":"http","url":"https://server.smithery.ai/@Danushkumar-V/mcp-discord/mcp"}}}{"mcpServers":{"ai-smithery-danushkumar-v-mcp-discord":{"serverUrl":"https://server.smithery.ai/@Danushkumar-V/mcp-discord/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
https://server.smithery.ai/@Danushkumar-V/mcp-discord/mcp需要授权工具
详细介绍
MCP-Discord
一个 Discord MCP(Model Context Protocol)服务,可让 AI 助手与 Discord 平台交互。
概述
MCP-Discord 提供以下 Discord 相关功能:
- 登录 Discord 机器人
- 获取服务信息
- 读取/删除频道消息
- 向指定频道发送消息(可使用频道 ID 或频道名称)
- 获取论坛频道列表
- 创建/删除/回复论坛帖子
- 创建/删除文本频道
- 添加/移除消息回应
- 创建/编辑/删除/使用 Webhook
目录
前置条件
-
Node.js(v16.0.0 或更高版本)
-
npm(v7.0.0 或更高版本)
-
拥有适当权限的 Discord 机器人
- 机器人令牌(可从 Discord Developer Portal 获取)
- 已启用 Message Content Intent
- 已启用 Server Members Intent
- 已启用 Presence Intent
-
Discord 服务中所需的权限:
最简单的设置
- Administrator(推荐用于快速设置并获得完整功能)
或者,仅选择所需权限:
- Send Messages
- Create Public Threads
- Send Messages in Threads
- Manage Messages
- Manage Threads
- Manage Channels
- Manage Webhooks
- Add Reactions
- View Channel
-
将 Discord 机器人添加到你的服务中
- 若要将 Discord 机器人添加到你的服务中,请使用以下任一邀请链接(将
INSERT_CLIENT_ID_HERE替换为机器人的客户端 ID):
- 若要将 Discord 机器人添加到你的服务中,请使用以下任一邀请链接(将
注意:
根据 Discord 的安全模型,机器人只能访问已明确将其添加到的服务中的信息。
如果你想使用此 MCP 服务访问特定的 Discord 服务,必须先将机器人添加到该服务。
使用下面的邀请链接将机器人添加到目标服务。
安装
通过 NPM 安装
你可以使用以下命令:
npx mcp-discord --config ${DISCORD_TOKEN}
如需了解更多详情,请查看 NPM Package。
通过 Smithery 安装
通过 Smithery 自动安装 mcp-discord。
通过 Docker 安装
你可以使用 Docker 运行 mcp-discord。Docker 镜像会自动构建并发布到 Docker Hub。
Docker Hub 仓库:barryy625/mcp-discord
# Pull the latest image
docker pull barryy625/mcp-discord:latest
# Run with environment variable
docker run -e DISCORD_TOKEN=your_discord_bot_token -p 8080:8080 barryy625/mcp-discord:latest
# Or run with command line config
docker run -p 8080:8080 barryy625/mcp-discord:latest --config "your_discord_bot_token"
可用标签:
latest- main 分支中的最新稳定版本v1.3.3等 - 指定版本的发布
手动安装
# Clone the repository
git clone https://github.com/barryyip0625/mcp-discord.git
cd mcp-discord
# Install dependencies
npm install
# Compile TypeScript
npm run build
配置
要正常运行,需要 Discord 机器人令牌。此服务支持两种传输方式:stdio 和 streamable HTTP。
传输方式
-
stdio(默认)
- 用于基本场景的传统 stdio 传输
- 适用于简单集成
-
streamable HTTP
- 基于 HTTP 的传输,适用于更高级的场景
- 支持无状态运行
- 端口号可配置
配置选项
你可以通过以下两种方式提供配置:
- 环境变量:
DISCORD_TOKEN=your_discord_bot_token
- 使用命令行参数:
# For stdio transport (default)
node build/index.js --config "your_discord_bot_token"
# For streamable HTTP transport
node build/index.js --transport http --port 3000 --config "your_discord_bot_token"
与 Claude/Cursor 搭配使用
Docker
你可以在 Claude 和 Cursor 中使用 Docker 容器:
{
"mcpServers": {
"discord": {
"command": "docker",
"args": [
"run",
"--rm",
"-e",
"DISCORD_TOKEN=your_discord_bot_token",
"-p",
"8080:8080",
"barryy625/mcp-discord:latest",
"--transport",
"http",
"--port",
"8080"
]
}
}
}
Claude
- 使用 stdio 传输:
{
"mcpServers": {
"discord": {
"command": "node",
"args": [
"path/to/mcp-discord/build/index.js",
"--config",
"your_discord_bot_token"
]
}
}
}
- 使用 streamable HTTP 传输:
{
"mcpServers": {
"discord": {
"command": "node",
"args": [
"path/to/mcp-discord/build/index.js",
"--transport",
"http",
"--port",
"3000",
"--config",
"your_discord_bot_token"
]
}
}
}
Cursor
- 使用 stdio 传输:
{
"mcpServers": {
"discord": {
"command": "cmd",
"args": [
"/c",
"node",
"path/to/mcp-discord/build/index.js",
"--config",
"your_discord_bot_token"
]
}
}
}
- 使用 streamable HTTP 传输:
{
"mcpServers": {
"discord": {
"command": "cmd",
"args": [
"/c",
"node",
"path/to/mcp-discord/build/index.js",
"--transport",
"http",
"--port",
"3000",
"--config",
"your_discord_bot_token"
]
}
}
}
工具文档
基本功能
discord_send:向指定频道发送消息(支持频道 ID 和频道名称)discord_get_server_info:获取 Discord 服务器信息
频道管理
discord_create_text_channel:创建文本频道discord_delete_channel:删除频道
论坛功能
discord_get_forum_channels:获取论坛频道列表discord_create_forum_post:创建论坛帖子discord_get_forum_post:获取论坛帖子discord_reply_to_forum:回复论坛帖子discord_delete_forum_post:删除论坛帖子
消息和表情回应
discord_read_messages:读取频道消息discord_add_reaction:为消息添加表情回应discord_add_multiple_reactions:为消息添加多个表情回应discord_remove_reaction:移除消息上的表情回应discord_delete_message:从频道中删除指定消息
Webhook 管理
discord_create_webhook:为 Discord 频道创建新的 webhookdiscord_send_webhook_message:使用 webhook 向 Discord 频道发送消息discord_edit_webhook:编辑 Discord 频道现有的 webhookdiscord_delete_webhook:删除 Discord 频道现有的 webhook
开发
# Development mode
npm run dev
许可证
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。