Discord Community MCP
Enables AI agents to search and recall Discord conversations, analyze community activity, participation, and growth, and optionally send messages when writes are enabled.
README
Discord Community MCP
A local-first Model Context Protocol server that gives AI agents read-only Discord search, conversation recall, community research, and growth analysis through a bot account. Sending messages and reactions is available only when explicitly enabled.
What it can do
- Find conversations from a vague memory, even when the wording is uncertain
- Reconstruct context around a matching message
- Index selected Discord history in a local SQLite database
- Analyze activity, response times, participation, concentration, reciprocity, and themes
- Save member snapshots and analyze joins, departures, roles, and contributor growth
- Optionally send messages, replies, and reactions
Requirements
- Node.js 22.5 or newer
- A Discord application and bot token
- An MCP client that supports local stdio servers, such as Codex
1. Create a Discord bot
- Open the Discord Developer Portal and create an application.
- Open Bot, create the bot, and copy its token.
- Under Bot → Privileged Gateway Intents, enable:
- Message Content Intent for message text and search
- Server Members Intent for member snapshots, join dates, roles, and growth
- Presence Intent is not required.
- Under OAuth2 → URL Generator, select the
botscope. - Give the bot View Channels and Read Message History. Add Send Messages or Add Reactions only if you plan to enable write tools.
- Open the generated URL and invite the bot to your Discord server.
The bot can only access channels its Discord role is allowed to view.
2. Install
git clone https://github.com/blackgirlbytes/discord-community-mcp.git
cd discord-community-mcp
npm ci
npm run build
cp .env.example .env
Open .env and replace the placeholder token:
DISCORD_BOT_TOKEN=replace-with-your-bot-token
DISCORD_ENABLE_WRITE=false
Keep .env private. It is excluded from git.
3. Add it to an MCP client
Codex CLI
Use absolute paths so the client can start the server from any directory:
codex mcp add discord-community -- \
node \
--env-file=/absolute/path/to/discord-community-mcp/.env \
/absolute/path/to/discord-community-mcp/dist/index.js
Restart Codex after adding the server.
Generic stdio configuration
Clients that use an mcpServers JSON object can use:
{
"mcpServers": {
"discord-community": {
"command": "node",
"args": [
"--env-file=/absolute/path/to/discord-community-mcp/.env",
"/absolute/path/to/discord-community-mcp/dist/index.js"
]
}
}
}
Restart the MCP client after changing its configuration. You can then ask it to list the Discord servers and channels available to the bot.
Example questions
- “Find the conversation where someone said onboarding felt like homework.”
- “What did we decide about renaming the SDK last spring?”
- “Why are beta testers responding slowly? Look for evidence across the last three months.”
- “How has the community grown by month, and how does growth compare with participation?”
- “Which support questions went unanswered last week?”
For broad analysis, the agent should first synchronize the relevant channels and date range, check index coverage, and then run community research. Behavioral explanations should be presented as hypotheses unless messages directly support them.
Available tools
| Tool | Purpose |
|---|---|
discord_list_guilds |
List servers available to the bot |
discord_list_channels |
List channels in a server |
discord_read_messages |
Read recent messages with pagination |
discord_find_messages |
Search for a vaguely remembered conversation |
discord_get_message_context |
Read messages surrounding a match |
discord_sync_community_history |
Build or refresh the local message index |
discord_research_community |
Produce an evidence packet for a community question |
discord_get_community_index_status |
Check indexed channels, dates, and coverage |
discord_sync_member_snapshot |
Save current membership, join-date, and role data |
discord_analyze_growth |
Analyze membership and participation over time |
discord_send_message |
Send a message when writes are enabled |
discord_reply_to_message |
Reply when writes are enabled |
discord_add_reaction |
React when writes are enabled |
Data and privacy
Message content and membership metadata are stored unencrypted in data/discord-analytics.sqlite by default. Override the location with DISCORD_ANALYTICS_DB.
DISCORD_ANALYTICS_DB=/absolute/private/path/discord-analytics.sqlite
- Index only channels and date ranges needed for the analysis.
- Protect and delete the database according to your community's privacy policy.
- Give the bot the minimum Discord permissions it needs.
- Keep
DISCORD_ENABLE_WRITE=falseunless sending content is intentional. - Rotate the bot token immediately if it is exposed.
Analysis limitations
- A message archive can show behavioral patterns but cannot prove why people behaved that way.
- Discord users may respond without using the Reply action, so reply metrics can undercount responses.
- Historical role membership is not reconstructed; older messages use the latest observed role.
- Exact departures are detected only between saved member snapshots.
- A first member snapshot cannot recover people who left before the bot observed them.
- Search and analytics cover only channels visible to the bot and history that was synchronized.
- Direct messages are not supported.
Write access
Write tools are registered but blocked by default. To enable them, update .env:
DISCORD_ENABLE_WRITE=true
The bot must also have the corresponding Discord permissions. Keep writes disabled for research-only installations.
Development
npm ci
npm run check
npm test
The server writes operational logs to stderr because stdout is reserved for the MCP stdio protocol.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。