Discord Raw API MCP Server
Discord 原始 API MCP 服务器
此 MCP 服务器通过单一灵活的工具提供原始 Discord API 访问。它支持 REST API 调用和斜线命令语法。
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 Discord Raw API:
npx -y @smithery/cli install @hanweg/mcp-discord-raw --client claude手动安装
设置你的 Discord 机器人:
在Discord 开发者门户创建新应用程序
创建机器人并复制令牌
启用所需的特权意图:
消息内容意图
存在意图
服务器成员意图
使用 OAuth2 URL 生成器邀请机器人加入你的服务器
克隆并安装包:
# Clone the repository
git clone https://github.com/hanweg/mcp-discord-raw.git
cd mcp-discord-raw
# Create and activate virtual environment
uv venv
.venv\Scripts\activate
### If using Python 3.13+ - install audioop library: `uv pip install audioop-lts`
# Install the package
uv pip install -e .Related MCP server: poke_discord
配置
将其添加到您的claude_desktop_config.json
"discord-raw": {
"command": "uv",
"args": [
"--directory",
"PATH/TO/mcp-discord-raw",
"run",
"discord-raw-mcp"
],
"env": {
"DISCORD_TOKEN": "YOUR-BOT-TOKEN"
}
}用法
REST API 样式
{
"method": "POST",
"endpoint": "guilds/123456789/roles",
"payload": {
"name": "Bot Master",
"permissions": "8",
"color": 3447003,
"mentionable": true
}
}斜线命令样式
{
"method": "POST",
"endpoint": "/role create name:Bot_Master color:blue permissions:8 mentionable:true guild_id:123456789"
}示例
创建角色:
{
"method": "POST",
"endpoint": "/role create name:Moderator color:red permissions:moderate_members guild_id:123456789"
}发送消息:
{
"method": "POST",
"endpoint": "channels/123456789/messages",
"payload": {
"content": "Hello from the API!"
}
}获取服务器信息:
{
"method": "GET",
"endpoint": "guilds/123456789"
}建议:
将服务器、频道和用户 ID 以及一些示例放入项目知识中,以避免必须提醒模型这些内容,以及类似这样的内容来启动它:
“以下是如何有效使用 Discord 原始 API 工具的方法:该工具称为 discord_api 并采用三个参数:
方法:HTTP 方法(“GET”、“POST”、“PUT”、“PATCH”、“DELETE”)
端点:Discord API 端点(例如,“guilds/{guild.id}/roles”)
有效载荷:请求主体的可选 JSON 对象我使用的关键示例:
创建角色:
discord_api
method: POST
endpoint: guilds/{server_id}/roles
payload: {
"name": "Role Name",
"color": 3447003, // Blue color in decimal
"mentionable": true
}创建类别和频道:
// Category
discord_api
method: POST
endpoint: guilds/{server_id}/channels
payload: {
"name": "Category Name",
"type": 4 // 4 = category
}
// Text channel in category
discord_api
method: POST
endpoint: guilds/{server_id}/channels
payload: {
"name": "channel-name",
"type": 0, // 0 = text channel
"parent_id": "category_id",
"topic": "Channel description"
}将频道移至类别:
discord_api
method: PATCH
endpoint: channels/{channel_id}
payload: {
"parent_id": "category_id"
}发送消息:
discord_api
method: POST
endpoint: channels/{channel_id}/messages
payload: {
"content": "Message text with emojis \ud83d\ude04"
}分配角色:
discord_api
method: PUT
endpoint: guilds/{server_id}/members/{user_id}/roles/{role_id}
payload: {}该工具支持完整的 Discord API,因此您可以参考 Discord API 文档了解更多端点和功能。响应包含 ID 和其他元数据,可用于后续请求。专业提示:
保存创建请求返回的 ID 以便在后续请求中使用
~~Unicode 表情符号可以直接包含在消息内容中~~ ? 告诉模型使用 discord 表情符号,例如 :champagne_glass: - 带有 unicode 表情符号的消息会挂起 Claude Desktop?
频道类型:0 = 文本、2 = 语音、4 = 类别、13 = 舞台
角色颜色采用十进制格式(不是十六进制)
大多数修改端点使用 PATCH 方法
空有效载荷应为 {},而不是 null”
执照
MIT 许可证
Available Tools
1 tooldiscord_apiC
Execute raw Discord API commands. Supports both REST API calls and application commands.
Inputs: method (required), endpoint (required), payload.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'discord_api' has a clearly distinct purpose that covers all Discord API interactions.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'discord_api' follows a clear and appropriate pattern for its function.
A single tool for a Discord API server is too few for the apparent scope, as Discord's API typically involves multiple resources and operations (e.g., channels, messages, users). This forces all functionality through one generic tool, which is a mismatch for the domain's complexity.
The tool surface is severely incomplete for a Discord API server. While the single tool can execute any raw API command, there are no specific tools for common Discord operations (e.g., send_message, get_channel, list_members), leaving significant gaps that will likely cause agent failures due to lack of structured guidance.
Related MCP Connectors
Control your Discord community: send/read messages, manage channels and forums, and handle webhook…
Build and change Discord bots by describing them: slash commands, events, embeds, modals and data.
Discord MCP server for ChatGPT, Claude and any AI agent: list servers and channels, read channel messages, search messages, send message, reply to message, send DM, read mentions and assign role in your own Discord account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Discord yourself; Cotlet does not store your password and you need no Discord API key. About the official Discord API: Yes, Discord has an official API for bots and OAuth2 apps, but it acts as a bot that a server manager adds, not as you, and Discord has no official MCP server for it (checked 5 Nov 2026). The MCP server on Discord's docs site only searches documentation. Setup and FAQ: https://cotlet.dev/integrations/discord-api-mcp-server
Connect a Discord bot (bot token from the developer portal) to read/send messages, list guilds and c
Related MCP Servers
- AlicenseBqualityFmaintenanceEnables interaction with Discord channels through a bot, allowing users to send messages and files, retrieve messages with advanced filtering, and download attachments of any type.54MIT
- FlicenseNot gradedqualityCmaintenanceEnables interaction with Discord through natural language, including reading and sending messages, managing servers, and user actions.-
- AlicenseNot gradedqualityDmaintenanceProvides full Discord REST API access through a bot token, enabling server management including channels, messages, members, roles, and more.1MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Discord through the REST API, supporting message reading and sending, channel and guild management, threads, pins, and reactions.17MIT