Skip to main content
Glama
Discord MCP

Discord MCP

by Stella2211

English

discord-mcp

1つの Discord Bot(トークン1つ)を、通知Botと MCP の2か所から使う仕組みです。

  • 通知Bot(packages/notifier):常駐PCで動く。新しい投稿のうち、自分へのメンションなどはすぐに、それ以外は判定モデルが「関係ありそう」としたものだけ(判定モデルを使わない設定では、見られるチャンネルのすべての投稿)を、duet-send で Claude Duet に知らせる。

  • Discord MCP(packages/mcp):Cloudflare Workers + Cloudflare Access で動くリモートMCPサーバー。claude.ai から、サーバー・チャンネルの一覧、過去の投稿の読み取り、検索、投稿、返信、リアクション、Bot 自身の投稿の編集ができる。

  • 共通部品(packages/discord):REST クライアント、型、権限の計算、Snowflake、文字列の整形。Bun と Workers の両方で動く。

設計と詳細は docs/README.md にあります。

前提

  • Bun

  • Discord の Developer Portal で作った Bot(docs/discord-app/)

  • 通知Bot:常駐PC(macOS・Linux・Windows)、duet-send と Claude Code(claude)

  • MCP:Cloudflare アカウント、カスタムドメイン、Cloudflare Zero Trust(無料プランで可)

Related MCP server: claudeai-mcp-bridge

はじめ方

bun install
  1. Bot を作る。 Message Content Intent をオンにし、招待URLで自分のサーバーに追加する(docs/discord-app/)。

  2. 通知Botを動かす。

    cd packages/notifier
    cp .env.example .env              # トークン・自分のユーザーID・duet-send のパス・判定モデルを書く
    bun run check                     # 設定を確認する
    DUET_DRY_RUN=true bun run start   # 試運転(Duet に送らずログに出す)
    bun run service:install           # 自動起動を入れる

    詳しくは docs/notifier/。

  3. MCP をデプロイする。 Access アプリを作り、シークレットを入れ、ホスト名と Access の値を環境変数で渡してデプロイする。wrangler.jsonc はプレースホルダーのままにする(手順と CI からのデプロイは docs/mcp/ の「デプロイ」)。

    cd packages/mcp
    bunx wrangler secret put DISCORD_BOT_TOKEN
    bunx wrangler secret put ALLOWED_EMAIL
    MCP_HOST=… ACCESS_TEAM_DOMAIN=… ACCESS_AUD=… bun run deploy
    bun run smoke
  4. claude.ai に追加する。 カスタムコネクタの URL に https://<ホスト名>/mcp を指定する。

フォークして Claude Code に任せるなら、人がやるのは API トークンの作成など外部の画面の作業だけで、3 の変数・シークレットの登録とデプロイは Claude Code が進められる(docs/fork-setup/)。

開発

bun run typecheck    # 3つのパッケージの型検査
bun test             # 全テスト(外部には繋がない)
cd packages/mcp && cp .dev.vars.example .dev.vars && bun run dev   # wrangler dev(ポート 8788)
  • packages/mcp と packages/discord は Workers でも動くので、Bun 固有の API(Bun.file など)を使わない。

  • シークレット・メールアドレス・ID はリポジトリに書かない。

ドキュメント

ライセンス

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables Claude Desktop to interact with Discord through a dedicated bot. It allows users to list channels, read message history, and send messages directly from the AI interface.
      2
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      A comprehensive MCP server with 206+ tools across 16 integrations that gives Claude access to real accounts (LinkedIn, Twitter, Slack, Gmail, WhatsApp, etc.) by extracting auth tokens straight from your browser, no API keys or OAuth needed.
      3
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables Claude or any MCP client to operate a Discord bot through 35 tools, covering reading channels, searching history, posting and replying, managing channels, threads and roles, moderating members, and reading the audit log. It runs locally as a stateless subprocess, making plain HTTPS calls to Discord's REST API with no gateway connection.
      35
      MIT