Nika
Nika — Discord MCP 服务器
一个全面的 Model Context Protocol 服务器,让 AI 助手能够管理 Discord 社区:消息、审核、角色、频道、论坛、Webhook、邀请、预定事件、AutoMod、入门引导、表情/贴纸、权限覆盖、语音管理——共 111 个工具,外加一个原始 REST 透传(discord_api_request),因此 任何 Discord API 能实现的功能都可以触达。
基于 Python + discord.py(持久网关连接)和 FastMCP 构建。
设置
1. 创建 Discord 机器人(已完成)
应用:Nika(ID
1538805149865091092)已启用的意图:服务器成员、消息内容
Token:存储在
.env中(切勿提交它——.gitignore会保护它)
2. 邀请机器人加入你的服务器
打开此 URL 并选择你的服务器(授予 管理员 以获得全部功能):
https://discord.com/api/oauth2/authorize?client_id=1538805149865091092&permissions=8&scope=bot%20applications.commands⚠️ 机器人必须先加入服务器,否则大多数工具无法执行任何操作。
3. 安装与配置
python -m venv .venv
.venv\Scripts\pip install -e ".[dev]".env(已创建):
DISCORD_TOKEN=... # bot token
DISCORD_GUILD_ID= # optional: default server id → makes guildId optional everywhere
MCP_TRANSPORT=stdio # stdio | http
HTTP_HOST=0.0.0.0 # HTTP mode only
HTTP_PORT=8085
LOG_LEVEL=INFORelated MCP server: Cloud Discord
使用
stdio(默认——Claude Desktop、VS Code、Cursor 等)
.venv\Scripts\python -m discord_mcpClaude Desktop 的 claude_desktop_config.json:
{
"mcpServers": {
"nika": {
"command": "d:\\Projects\\david\\DiscordMCP\\.venv\\Scripts\\python.exe",
"args": ["-m", "discord_mcp"],
"cwd": "d:\\Projects\\david\\DiscordMCP"
}
}
}HTTP(流式)——远程访问、n8n、多客户端
.venv\Scripts\python -m discord_mcp --transport http --port 8085
# endpoint: http://localhost:8085/mcp客户端配置:
{
"mcpServers": {
"nika": { "url": "http://localhost:8085/mcp" }
}
}Docker
docker compose up -d # builds + runs HTTP mode on :8085
docker run -i --rm -e DISCORD_TOKEN=$env:DISCORD_TOKEN discord-mcp:latest # stdio使用 MCP Inspector 进行测试
npx @modelcontextprotocol/inspector .venv\Scripts\python.exe -m discord_mcp工具参考(111 个工具)
领域 | 工具 |
服务器 |
|
频道 |
|
消息 |
|
成员 |
|
角色 |
|
私信 |
|
审核 |
|
语音 |
|
事件 |
|
权限 |
|
邀请 |
|
Webhook |
|
论坛 |
|
表情与贴纸 |
|
AutoMod |
|
入门引导与审计 |
|
原始 API |
|
设计说明
混合网关 + REST:一个持久的 discord.py 网关连接提供实时状态(成员/频道查找、名称→ID),而变更操作通过同一客户端进行。工具调用通过
asyncio.run_coroutine_threadsafe桥接到网关循环。安全性:原始工具要求变更方法使用
confirmDestructive=true;prune_members默认进行试运行;破坏性工具接受reason,该参数会写入审计日志。可选的
guildId:在.env中设置DISCORD_GUILD_ID,所有guildId参数都将变为可选。错误:Discord 错误会被转换为可读的消息(例如
Missing permissions: ...)。
限制
需要 机器人令牌(用户令牌/自机器人自动化违反 Discord 服务条款)。
读取消息需要机器人能够看到频道,并且(对于内容)需要 消息内容意图。
不支持语音音频流式传输/接收。
开发
.venv\Scripts\python -m pytest # 22 unit tests布局:discord_mcp/bot.py(网关桥) · discord_mcp/server.py(FastMCP) · discord_mcp/tools/*.py(每个领域一个模块) · discord_mcp/utils/(序列化器、嵌入)。
许可证
MIT
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
- AlicenseBqualityDmaintenanceA Discord MCP server that enables AI assistants to interact with Discord platforms, providing functionalities like sending messages, managing channels, creating forum posts, and handling webhooks.214651MIT
- Alicense-qualityDmaintenanceAn MCP server that gives AI agents full admin control over Discord servers with 59 tools for messaging, moderation, roles, channels, forums, reactions, files, and more, deployed on Cloudflare Workers.4MIT
- Alicense-qualityDmaintenanceComprehensive Discord MCP server with 66 tools that provides rich message context including emoji reactions, thread indicators, and attachment metadata inline. Enables AI assistants to interact with Discord servers for messaging, moderation, roles, channels, and more.1591MIT
- AlicenseBqualityDmaintenanceA Discord MCP server that enables AI assistants to interact with the Discord platform, providing features like message sending, channel management, forum operations, reactions, and webhook management.22465MIT
Related MCP Connectors
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
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/alive2/discord-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server