Discord Raw API MCP Server
Discord Raw 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 と呼ばれ、3 つのパラメータを取ります。
メソッド: 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 絵文字をメッセージ コンテンツに直接含めることができます~~ ? モデルに :champagne_glass: のような discord 絵文字を使用するように指示します - Unicode 絵文字を含むメッセージは Claude Desktop をハングさせますか?
チャンネルの種類: 0 = テキスト、2 = 音声、4 = カテゴリ、13 = ステージ
ロールの色は10進数形式(16進数ではない)です
ほとんどの変更エンドポイントは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