Discord MCP Server
Lets members of a specific Discord server read that server's users, roles, channels, threads, pins, messages and reactions (including search), and perform limited write actions such as sending and editing the bot's own messages, adding/removing the bot's reactions, and creating and joining threads — all executed with the bot token and restricted to the configured guild.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-server
特定の Discord サーバーのメンバーだけが使える、リモート MCP サーバーです。Cloudflare Workers で動きます。Discord の操作には @djsk/discord-mcp を使い、その前に Discord OAuth2 によるログインとツールの許可リストを置いています。
仕組み
MCP クライアントが接続すると、この Worker の同意画面が開きます。許可すると Discord でログインし、Worker はユーザーのトークンで GET /users/@me/guilds/{guild.id}/member を呼んで、DISCORD_GUILD_ID のサーバーに参加しているかを確認します。参加していないユーザーと、メンバーシップ審査 (ルールへの同意) を終えていないユーザーにはトークンを発行しません。Discord のトークンは確認が済んだらすぐ失効させ、保存しません。
/mcp へのリクエストのたびに、bot でもう一度参加を確認します。結果は KV に membershipCacheTtlSeconds 秒 (既定は 300 秒) 保持するので、サーバーを抜けたユーザーは遅くともその時間が過ぎると使えなくなります。
Discord への操作はすべて bot のトークンで行います。メッセージを送ると、送信者は bot になります。操作できるのは DISCORD_GUILD_ID のサーバーだけです。ツールの guild_id 引数は tools/list に出さず、呼び出しのたびに DISCORD_GUILD_ID を入れます。AI がサーバー ID を知らなくても使えます。ツールの呼び出しはユーザー ID とツール名を Workers Logs に記録します。
Related MCP server: Discord MCP Server
公開するツール
公開するツールは mcp.config.jsonc の allowedTools で決めます。ここにないツールは tools/list に出ず、呼び出しても拒否します。toolset に新しいツールが増えても、allowedTools に足すまでは公開されません。
初期状態で公開しているのは、default toolset のうちの次のツールです。
読み取り: ユーザー、サーバー、チャンネル、ロール、メンバー、スレッド、ピン留め、メッセージ、リアクションの取得と検索
書き込み: メッセージの送信と編集 (bot が送ったものだけ)、bot のリアクションの追加と削除、スレッドの作成と参加
ban、kick、timeout、ロールの付け外し、メッセージの削除、ピン留めの変更、DM の送信のように、ほかのユーザーに影響する操作は公開していません。ツールの一覧は discord-mcp-cli の docs/tools.md にあります。
メンバーは、bot が見えるチャンネルをすべて読めます。運営用の非公開チャンネルなどを読ませたくない場合は、bot のロールからそのチャンネルの閲覧権限を外してください。同じように、bot に「@everyone、@here、全てのロールにメンション」の権限があると、メンバーが bot 経由で全員にメンションできます。不要なら外してください。
設定
設定は 2 か所に分かれています。
mcp.config.jsonc: リポジトリで管理する設定。有効にする toolset、公開するツール、参加確認のキャッシュ時間Worker の secret: デプロイ先ごとの値と秘密の値
secret | 内容 |
| 利用者が参加していなければならないサーバーの ID |
| Discord アプリケーションの ID |
| Discord アプリケーションの OAuth2 クライアントシークレット |
| 同じアプリケーションの bot トークン |
secret が足りないか形式が正しくない場合、Worker は最初のリクエストで不足している項目を並べたエラーを返します。
セットアップ
Discord アプリケーション
Discord Developer Portal でアプリケーションを開き、次を設定します。
OAuth2 の Redirects に
https://<Worker のホスト名>/callbackを追加するbot を対象のサーバーに招待しておく。メンバーの参加確認には特権インテントは不要です。メッセージの本文を読むには Message Content Intent を有効にします
Cloudflare
KV namespace を作り、
wrangler.jsoncのOAUTH_KVのidに設定するWorkers Builds でこのリポジトリを接続するか、
pnpm run deployでデプロイするダッシュボードの Settings > Variables and Secrets か
pnpm exec wrangler secret put <名前>で、上の 4 つの secret を設定する
MCP クライアントからの接続
エンドポイントは https://<Worker のホスト名>/mcp です。Claude Code なら次のように追加します。
claude mcp add --transport http discord https://<Worker のホスト名>/mcp最初の接続でブラウザが開き、同意画面と Discord のログインに進みます。
開発
pnpm install
cp .dev.vars.example .dev.vars # 値を埋める
pnpm run devpnpm run typecheck で型を、pnpm test でツールの許可判定のテストを実行します。wrangler.jsonc を変えたら pnpm run types で worker-configuration.d.ts を作り直してください。
ローカルで Discord のログインまで試すには、Discord アプリケーションの Redirects に http://localhost:8787/callback も追加します。
ライセンス
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Manage a Discord server from Claude, ChatGPT or any MCP client. Sign in with Discord, no bot token.
Read Discord channels, threads and message history from an AI assistant via a read-only bot.
Read servers, channels, messages and pins; post messages as a bot in Discord.
Publish and schedule Discord server posts from your AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables comprehensive interaction with Discord servers to manage guilds, channels, messages, and members through an agentic workflow. It supports RAG capabilities, rate-limited message operations, and includes a React-based dashboard for monitoring and configuration.2MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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.18 npm1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to interact with Discord guilds, channels, messages, threads, members, roles, webhooks, and DMs through a focused set of tools.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with Discord through a bot, supporting server and member inspection, channel and role management, message and reaction operations, forum management, and webhook configuration.2,790 npmMIT