一个允许AI助手与Discord平台交互的Discord MCP(模型上下文协议)服务器。
<a href="https://glama.ai/mcp/servers/@barryyip0625/mcp-discord"> <img width="380" height="200" src="https://gips1.baidu.com/it/u=4205092261,865043839&fm=3081&app=3_3081&f=PNG?w=760&h=400" alt="MCP-Discord MCP 服务器" /> </a>MCP-Discord 提供以下与Discord相关的功能:
Node.js (v16.0.0 或更高版本)
npm (v7.0.0 或更高版本)
具有适当权限的Discord机器人
您的Discord服务器中的所需权限:
将您的Discord机器人添加到您的服务器
INSERT_CLIENT_ID_HERE替换为您的机器人的客户端ID):
注意: 根据Discord的安全模型,机器人只能访问它被明确添加到的服务器的信息。 如果您想使用此MCP服务器访问特定的Discord服务器,必须首先将机器人添加到该服务器。 使用下面的邀请链接将机器人添加到目标服务器。
您可以使用以下命令:
npx mcp-discord --config ${DISCORD_TOKEN}
更多详情,请参阅NPM 包。
要通过Smithery自动安装mcp-discord
您可以使用Docker运行mcp-discord。Docker镜像会自动构建并发布到Docker Hub。
Docker Hub 仓库:barryy625/mcp-discord
Docker容器默认使用stdio。
# 拉取最新镜像
docker pull barryy625/mcp-discord:latest
# 使用环境变量运行
docker run -e DISCORD_TOKEN=your_discord_bot_token barryy625/mcp-discord:latest
# 或者使用命令行配置运行
docker run barryy625/mcp-discord:latest --config "your_discord_bot_token"
或者,覆盖--transport和--port标志以在您选择的端口上运行http。在这种情况下,还需要映射端口。
# 拉取最新镜像
docker pull barryy625/mcp-discord:latest
# 使用环境变量运行
docker run -e DISCORD_TOKEN=your_discord_bot_token -p 8080:8080 barryy625/mcp-discord:latest --transport http --port 8081
# 或者使用命令行配置运行
docker run -p 8080:8080 barryy625/mcp-discord:latest --config "your_discord_bot_token" --transport http --port 8081
可用标签:
latest - 主分支上的最新稳定版本v1.3.3等 - 特定版本发布# 克隆仓库
git clone https://github.com/barryyip0625/mcp-discord.git
cd mcp-discord
# 安装依赖
npm install
# 编译TypeScript
npm run build
需要Discord机器人令牌才能正常运行。服务器支持两种传输方式:stdio和流式HTTP。
stdio(默认)
流式HTTP
您可以使用两种方式提供配置:
DISCORD_TOKEN=your_discord_bot_token
# 对于stdio传输(默认)
node build/index.js --config "your_discord_bot_token"
# 对于流式HTTP传输
node build/index.js --transport http --port 3000 --config "your_discord_bot_token"
您可以使用Docker容器与Claude和Cursor:
{
"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"
]
}
}
}
{
"mcpServers": {
"discord": {
"command": "node",
"args": [
"path/to/mcp-discord/build/index.js",
"--config",
"your_discord_bot_token"
]
}
}
}
{
"mcpServers": {
"discord": {
"command": "node",
"args": [
"path/to/mcp-discord/build/index.js",
"--transport",
"http",
"--port",
"3000",
"--config",
"your_discord_bot_token"
]
}
}
}
{
"mcpServers": {
"discord": {
"command": "cmd",
"args": [
"/c",
"node",
"path/to/mcp-discord/build/index.js",
"--config",
"your_discord_bot_token"
]
}
}
}
{
"mcpServers": {
"discord": {
"command": "cmd",
"args": [
"/c",
"node",
"path/to/mcp-discord/build/index.js",
"--transport",
"http",
"--port",
"3000",
"--config",
"your_discord_bot_token"
]
}
}
}
discord_login: 使用配置的令牌登录到Discorddiscord_list_servers: 列出机器人所属的所有Discord服务器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_search_messages: 在服务器中搜索消息discord_read_messages: 读取频道消息discord_add_reaction: 向消息添加反应discord_add_multiple_reactions: 向消息添加多个反应discord_remove_reaction: 从消息中移除反应discord_delete_message: 从频道中删除特定消息discord_create_webhook: 为Discord频道创建新的网络钩子discord_send_webhook_message: 使用网络钩子向Discord频道发送消息discord_edit_webhook: 编辑现有网络钩子discord_delete_webhook: 删除现有网络钩子# 开发模式
npm run dev