Discord MCP Server

Discord MCP Server

site icon
2025.03.07 0
JavaScriptDiscord API 集成消息管理自动化交互交流协作
Discord MCP Server 是一个用于集成 Discord API 与 Claude 的 MCP(Model Context Protocol)服务器。它允许 Claude 通过工具与 Discord 服务器进行交互,执行发送消息、读取消息和管理服务器资源等操作。
View on GitHub

Overview

基本能力

产品定位

Discord MCP Server 是一个中间件服务,用于连接 Claude 和 Discord API,实现自动化交互和消息管理。

核心功能

  • 发送消息到 Discord 频道
  • 读取 Discord 频道的最近消息
  • 列出服务器中的可用频道
  • 列出机器人有权访问的服务器
  • 获取特定用户的信息

适用场景

  • 自动化 Discord 消息管理
  • 集成 Claude 与 Discord 进行智能交互
  • 服务器资源管理自动化

工具列表

  • send-message: 向 Discord 频道发送消息
  • read-messages: 读取 Discord 频道的最近消息
  • list-channels: 列出服务器中的可用频道
  • list-servers: 列出机器人有权访问的服务器
  • get-user-info: 获取特定用户的信息

常见问题解答

  • 安全性问题: Discord 机器人令牌应妥善保管,避免泄露。
  • 权限限制: 机器人的操作受限于其在每个服务器中的权限。

使用教程

使用依赖

  • Node.js 16 或更高版本
  • Discord 机器人令牌(可在 Discord Developer Portal 创建)
  • 适当的机器人权限:
  • 读取消息/查看频道
  • 发送消息
  • 读取消息历史
  • (可选)管理角色、管理频道等

安装教程

  1. 克隆仓库
  2. 安装依赖: bash npm install
  3. 构建项目: bash npm run build
  4. 创建 .env 文件并配置 Discord 令牌: DISCORD_TOKEN=your_discord_bot_token_here

调试方式

  1. 启动服务器: bash npm start
  2. 配置 Claude Desktop: json { "mcpServers": { "discord": { "command": "node", "args": ["path/to/discord-mcp/build/index.js"], "env": { "DISCORD_TOKEN": "your_discord_bot_token_here" } } } }

许可证

该项目遵循 MIT 开源许可条款。