Discord MCP Server
Discord MCP 服务器
一个模型上下文协议 (MCP) 服务器,使 LLM 能够与 Discord 频道交互,允许他们通过 Discord 的 API 发送和读取消息。使用此服务器,像 Claude 这样的 LLM 可以直接与 Discord 频道交互,同时保持用户的控制权和安全性。
特征
向 Discord 频道发送消息
阅读频道中的最新消息
自动服务器和频道发现
支持频道名称和 ID
正确的错误处理和验证
Related MCP server: Discord MCP Server
先决条件
Node.js 16.x 或更高版本
Discord 机器人令牌
必须以适当的权限邀请机器人加入您的服务器:
阅读消息/查看频道
发送消息
阅读消息历史记录
设置
克隆此存储库:
git clone https://github.com/yourusername/discordmcp.git
cd discordmcp安装依赖项:
npm install使用您的 Discord 机器人令牌在根目录中创建一个
.env文件:
DISCORD_TOKEN=your_discord_bot_token_here构建服务器:
npm run build与 Claude 桌面版一起使用
打开您的 Claude for Desktop 配置文件:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
添加 Discord MCP 服务器配置:
{
"mcpServers": {
"discord": {
"command": "node",
"args": ["path/to/discordmcp/build/index.js"],
"env": {
"DISCORD_TOKEN": "your_discord_bot_token_here"
}
}
}
}重启 Claude 桌面版
可用工具
发送消息
向指定的 Discord 频道发送消息。
参数:
server(可选):服务器名称或 ID(如果机器人位于多个服务器中则为必需)channel:频道名称(例如“general”)或 IDmessage:要发送的消息内容
例子:
{
"channel": "general",
"message": "Hello from MCP!"
}阅读消息
从指定的 Discord 频道读取最新消息。
参数:
server(可选):服务器名称或 ID(如果机器人位于多个服务器中则为必需)channel:频道名称(例如“general”)或 IDlimit(可选):要获取的消息数量(默认值:50,最大值:100)
例子:
{
"channel": "general",
"limit": 10
}发展
安装开发依赖项:
npm install --save-dev typescript @types/node以开发模式启动服务器:
npm run dev测试
您可以使用 MCP 检查器测试服务器:
npx @modelcontextprotocol/inspector node build/index.js示例
设置 Discord MCP 服务器后,您可以尝试与 Claude 进行以下一些示例交互:
“您能读取普通频道的最后5条消息吗?”
“请向公告频道发送一条消息,说明‘会议将在 10 分钟后开始’”
“开发频道中关于最新版本的最新消息是什么?”
克劳德将使用适当的工具与 Discord 进行交互,同时在发送任何消息之前征求您的批准。
安全注意事项
该机器人需要适当的 Discord 权限才能运行
所有消息发送操作均需要用户明确批准
环境变量应得到妥善保护
令牌永远不应该提交到版本控制
频道访问仅限于机器人被授予访问权限的频道
贡献
分叉存储库
创建你的功能分支(
git checkout -b feature/amazing-feature)提交您的更改(
git commit -m 'Add some amazing feature')推送到分支(
git push origin feature/amazing-feature)打开拉取请求
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
支持
如果您遇到任何问题或有疑问:
查看 GitHub 问题部分
请参阅https://modelcontextprotocol.io上的 MCP 文档
开启新问题并附上详细的复现步骤
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
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Let your AI agent notify you by email, Slack, Discord, or webhook. One tool: send_notification.
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
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/v-3/discordmcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server