Discord Community MCP
Discord Community MCP
一个本地优先的 Model Context Protocol 服务器,通过机器人账号为 AI 智能体提供只读的 Discord 搜索、对话回溯、社区研究和增长分析。发送消息和表情回应仅在显式启用时可用。
它能做什么
即使措辞模糊,也能根据模糊的记忆找到对应对话
重建匹配消息周围的上下文
将选定的 Discord 历史索引到本地 SQLite 数据库
分析活跃度、响应时间、参与度、集中度、互惠性和增长
保存成员快照,并分析加入、离开、角色和贡献者增长
可选地发送消息、回复和表情回应
Related MCP server: Discord MCP Server
要求
Node.js 22.5 或更高版本
一个 Discord 应用和机器人令牌
一个支持本地 stdio 服务器的 MCP 客户端,如 Codex
1. 创建 Discord 机器人
打开 Discord Developer Portal 并创建一个应用。
打开 Bot,创建机器人并复制其令牌。
在 Bot → Privileged Gateway Intents 下启用:
Message Content Intent:用于消息文本和搜索
Server Members Intent:用于成员快照、加入日期、角色和贡献者增长
Presence Intent 不是必需的。
在 OAuth2 → URL Generator 下选择
bot作用域。为机器人授予 View Channels 和 Read Message History。只有在你计划启用写入工具时,才添加 Send Messages 或 Add Reactions 权限。
打开生成的 URL 并邀请机器人加入你的 Discord 服务器。
机器人只能访问其 Discord 角色被允许查看的频道。
2. 安装
git clone https://github.com/blackgirlbytes/discord-community-mcp.git
cd discord-community-mcp
npm ci
npm run build
cp .env.example .env打开 .env 并替换占位符令牌:
DISCORD_BOT_TOKEN=replace-with-your-bot-token
DISCORD_ENABLE_WRITE=false保持 .env 私密。它已被 git 排除。
3. 将其添加到 MCP 客户端
Codex CLI
使用绝对路径,以便客户端可以从任何目录启动服务器:
codex mcp add discord-community -- \
node \
--env-file=/absolute/path/to/discord-community-mcp/.env \
/absolute/path/to/discord-community-mcp/dist/index.js添加服务器后重启 Codex。
通用 stdio 配置
使用 mcpServers JSON 对象的客户端可以使用:
{
"mcpServers": {
"discord-community": {
"command": "node",
"args": [
"--env-file=/absolute/path/to/discord-community-mcp/.env",
"/absolute/path/to/discord-community-mcp/dist/index.js"
]
}
}
}更改配置后重启 MCP 客户端。之后你可以请它列出可供机器人访问的 Discord 服务器和频道。
4. 示例问题
“找到那条某人时说入职体验像做作业的对话。”
“去年春天我们决定如何重命名 SDK?”
“为什么 Beta 版、体验者响应迟迟来?找出过去三个月中的相关来说明。”
“社区每个月增长情况如何?增长与参与度相比如何变化?”
“上周哪些支持问题没有得到回答?”
对于整个社区,智能体首先应同步相关频道和日期范围,然后查看索引覆盖情况,最后再进行社区研究。行为方面的描述应作为假设呈现,除非有消息直接支持这些假设。
可用工具
Tool | Purpose |
| 列出机器人可访问的服务器 |
| 列出服务器中的频道 |
| 分页读取最新消息 |
| 通过模糊记忆搜索对应的对话 |
| 读取匹配消息周围的上下文 |
| 完善或刷新本地消息索引 |
| 为社区问题生成一份证据包 |
| 检查已索引的频道、日期和覆盖范围 |
| 保存当前成员、加入日期和角色数据 |
| 分析成员数量和参与度随时间的变化 |
| 在启用写入时发送消息 |
| 在启用写入时回复消息 |
| 在启用写入时添加表情回应 |
数据与隐私
默认情况下,消息内容和成员元数据已未加密存储在 data/discord-analytics.sqlite 中。可以通过 DISCORD_ANALYTICS_DB 覆盖这个存储位置。
DISCORD_ANALYTICS_DB=/absolute/private/path/discord-analytics.sqlite只索引分析所需的频道和日期范围。
请根据你所在社区的数据保护政策管理和删除数据库。
给机器人分配所需的最低 Discord 权限。
除非你确实想发布内容,否则保持
DISCORD_ENABLE_WRITE=false。当机器人令牌暴露后,请立即更换。
分析限制
消息档案可以显示决策模式,但不能证明用户为什么会有这些行为。
Discord 用户可能直接回复而不使用回复(Reply)操作,因此用回复操作的次数可能会被低估。
历史角色不会被重建;早期消息会使用最近一次观察到的角色。
只有在两次已保存的成员快照之间才能准确识别成员的离开。
机器的第一份成员快照,无法找回机器人之前已经离开的用户。
搜索和分析只能够覆盖机器人可见的频道以及已经捕获到的数据。
不支持私信转发。
写入权限
写入工具已经注册,但默认被禁用。如果要启用它们,请更新 .env:
DISCORD_ENABLE_WRITE=true机器人还必须有对应的 Discord 权限。如果仅供研究使用,请保持写入功能关闭状态。
开发
npm ci
npm run check
npm test服务器将运行日志写入 stderr,因为在 MCP 的 stdio 协议模式下 stdout 分配给协议输出。
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 Servers
- FlicenseNot gradedqualityBmaintenanceEnables interaction with Discord through natural language, including reading and sending messages, managing servers, and user actions.
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Discord through the REST API and real-time events, supporting message management, user info, channel operations, and more with security controls.131MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to send and read messages in Discord channels, manage servers, channels, and roles via Discord's API.162MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to read and write Discord messages, search content, and compute channel statistics via a Discord bot.MIT
Related MCP Connectors
Persistent docs and memory for AI agents — read, write, organize & search a shared workspace.
Give your agent live data from Twitter, Reddit, the web and GitHub. No API keys, no scraping stack.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
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/blackgirlbytes/discord-community-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server