Discord MCP
Discord MCP
仓库: github.com/sandraschi/discord-mcp
FastMCP 3.1 Discord MCP 服务器,具备采样(服务器端 Ollama / OpenAI 兼容或客户端 LLM)、代理工作流 (discord_agentic_workflow)、技能 (SkillsDirectoryProvider + skill:///SKILL.md)、提示词以及2026 舰队风格仪表板(React + Vite + Tailwind,深色玻璃质感界面)。
端口
后端: 10756 REST (
/api/v1/) + MCP 流式 HTTP,位于/mcp前端: 10757
Related MCP server: Discord Notifications MCP Server
设置
在 Discord 开发者门户 创建一个机器人。复制机器人令牌。
将机器人邀请到您的服务器(使用 OAuth2 URL 生成器,范围:
bot)。将
.env.example复制到 仓库根目录下的.env(discord-mcp/.env) 并设置DISCORD_TOKEN=...(无需引号)。后端在启动时加载此文件 (python-dotenv)。更改.env后请重启服务器。如果令牌已在系统环境变量或 Cursor MCPenv中设置,则该值优先(.env不会覆盖现有变量)。对于本地代理采样(当 MCP 主机不提供采样时):运行 Ollama,并可选择设置
DISCORD_SAMPLING_BASE_URL/DISCORD_SAMPLING_MODEL。如果您希望由主机 LLM 进行采样,仅将服务器处理程序作为后备,请设置DISCORD_SAMPLING_USE_CLIENT_LLM=1。
运行
Web 应用(后端 + 仪表板):从仓库根目录运行
.\start.ps1或start.bat,或者从webapp/目录运行:.\start.ps1。仅后端:
uv run python -m discord_mcp.server --mode dual --port 10756Stdio(仅 MCP):
uv run python -m discord_mcp.server --mode stdio
Cursor MCP
将此仓库作为工作区根目录:
.cursor/mcp.json注册了 discord-mcp (stdio)。请在该文件的env中设置DISCORD_TOKEN,或依赖您的 shell 环境变量。编辑后请重新加载 MCP / 重启 Cursor。全局 / 多根合并:将
discord-mcp代码块从cursor-config-template.json复制到您的用户 MCP JSON 中(Windows:%USERPROFILE%\.cursor\mcp.json)。如果您没有使用默认的D:/Dev/repos/discord-mcp,请调整cwd为您的克隆路径。
MCP HTTP (远程 / Inspector)
端点:
http://localhost:10756/mcp(流式 HTTP, FastMCP 3.1.0)发现 / 清单:
GET /api/v1/meta健康检查:
GET /api/v1/health(包含采样状态)
工具
discord(operation=) 组合工具:
list_guilds,list_channels,send_message,get_messages,get_guild_stats,create_channel,create_guild,create_invite,list_invites,revoke_invite,list_members,get_member,list_active_threads,rag_ingest,rag_query。create_guild需要用户 OAuth2 (机器人权限为 403)。list_members/get_member需要 GUILD_MEMBERS 意图。discord_help(category=, topic=) 多级帮助。
discord_agentic_workflow(goal, ctx) 通过
ctx.sample+ 工具实现的高级目标 (SEP-1577)。返回一个结构化的 字典 (success,message,recommendations或错误字段)。
提示词 (已注册)
discord_quick_start, discord_diagnostics, discord_moderation_playbook, discord_rag_workflow, discord_invite_operations
技能
打包在 src/discord_mcp/skills/<name>/SKILL.md 下,作为 MCP 资源 (skill://) 公开。在仪表板的“技能”页面以及通过 GET /api/v1/skills 列出。
资源
resource://discord-mcp/capabilities客户端的功能简要摘要。
API (REST)
GET /api/v1/health健康状态、token_set、速率限制、采样、mcp_http_pathGET /api/v1/meta工具、提示词、资源、技能根目录、采样GET /api/v1/skills打包的技能预览(仪表板)GET /api/v1/guilds列出服务器(代理至工具)GET /api/v1/guilds/{guild_id}/channels列出频道(完整列表请参阅
/docs下的 OpenAPI 文档。)
Discord HTTP 429 (API 速率限制)
Discord 对 REST API 强制执行按路由限制。在遇到 HTTP 429 时,服务器现在会等待 retry_after(来自响应体或 Retry-After 标头),并重试同一请求最多 5 次,之后才会返回错误。如果在此之后仍然看到 429,请降低频率(例如减少并行消息获取、减小 RAG 摄入批次)或等待一分钟,特别是当 Discord 的响应中出现 "global": true 时(这种情况很少见,表示更广泛的限制)。
安全与速率限制 (反垃圾信息)
写入操作受到速率限制,以防止机器人被用作垃圾邮件发送工具:
消息:全局每分钟最多 10 条,每个频道每分钟最多 3 条,发送间隔至少 5 秒(可配置)。
频道:每分钟最多创建 5 个。
邀请:每分钟最多创建 5 个 (
DISCORD_RATE_LIMIT_INVITES_PER_MINUTE)。消息长度:上限为 2000(Discord 最大值);可通过
DISCORD_MAX_MESSAGE_LENGTH覆盖。
环境变量:DISCORD_RATE_LIMIT_MESSAGES_PER_MINUTE, DISCORD_RATE_LIMIT_MESSAGES_PER_CHANNEL_PER_MINUTE, DISCORD_RATE_LIMIT_CHANNELS_PER_MINUTE, DISCORD_MAX_MESSAGE_LENGTH, DISCORD_MIN_MESSAGE_INTERVAL_SECONDS。当达到限制时,工具将返回 success: false, rate_limited: true 以及解释性的 error。当前配置可在 GET /api/v1/health 下的 rate_limit 中查看。
文档
docs/README.md 文档索引
docs/TECHNICAL.md 架构、环境变量、Discord 429、MCP
/mcpCHANGELOG.md 发行说明
标准
FastMCP 3.1.0:指令、采样处理程序、技能提供程序、严格验证、流式 HTTP 挂载。
Web 应用:
start.ps1,端口 10756/10757,深色玻璃布局,顶部状态栏,活动日志,工具/技能/应用页面。
🛡️ 工业级技术栈
本项目遵循 SOTA 14.1 高保真代理编排的工业标准:
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 Connectors
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Give your agent live data from Twitter, Reddit, the web and GitHub. No API keys, no scraping stack.
- SkilderOAuthai.skilder
One place to build, share, and govern the skills and tools your AI agents use at work.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with Discord servers through a bot, supporting channel management, messaging, forum operations, reactions, and webhooks.22400MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Discord by sending notifications, creating channels, and managing interactive questions with support for two-way responses. It allows for streamlined communication through channel keys and supports various question types like multiple-choice and extended-answer modals.-
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to manage Discord servers through natural language, offering tools for guilds, channels, messages, roles, members, webhooks, invites, and automations. Includes a conversational agent that responds to @mentions in Discord.8Apache 2.0
- 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.61MIT