Skip to main content
Glama
hevji

Discord MCP Server

by hevji

Discord MCP Server

AIコーディングアシスタントから直接Discordサーバーを管理できます。チャンネル、カテゴリ、ロールの作成、権限の設定、ロールの割り当てなど、すべて自然言語で行えます。

virustotal: https://www.virustotal.com/gui/file/56fafed35e2734debed600e585741c53f456148da257065e9ea8c9fcb62c798d

ツール

ツール

説明

create_category

新しいカテゴリチャンネルを作成

create_channel

カテゴリ内にテキストまたはボイスチャンネルを作成

create_role

色、ホイスト、メンション可否を指定して新しいロールを作成

edit_role

ロールの名前、色、ホイスト、メンション可否を編集

delete_role

ロールを削除(管理対象外、ボットの階層より下)

assign_role

ユーザー名でメンバーにロールを割り当て

remove_role

ユーザー名でメンバーからロールを解除

restrict_channel

チャンネルの権限を設定(ロールの許可/拒否、読み取り専用モード、スレッド制御)

create_role_restricted_channel

チャンネルを作成し、一度の呼び出しで権限を制限

rename_channel

テキストまたはボイスチャンネルの名前を変更

delete_category

カテゴリチャンネルを削除

delete_channel

テキストまたはボイスチャンネルを削除

list_channels

すべてのチャンネルの名前、タイプ、カテゴリを一覧表示

list_roles

すべてのロールの名前、色、メンバー数を一覧表示

create_webhook

テキストチャンネルにウェブフックを作成

send_webhook_message

既存のウェブフックを使用してメッセージを送信

set_slowmode

テキストチャンネルのスローモード遅延(秒)を設定

Related MCP server: discord-mcp

セットアップ

1. Discord ボットを作成

  1. https://discord.com/developers/applications にアクセス

  2. New Application をクリック → 名前を入力 → Create

  3. Bot → Add Bot の順に移動

  4. Privileged Gateway Intents の下で、以下を有効にします:

    • Server Members Intent

    • Message Content Intent

  5. Token をコピー

  6. OAuth2 → URL Generator に移動

    • スコープ: bot

    • ボットの権限: Administrator(または手動で選択: チャンネルの管理、ロールの管理、メンバーをキック、ウェブフックの管理、メッセージを送信、メッセージを読む、チャンネルを見る)

  7. 生成された URL をブラウザで開き、ボットをサーバーに招待します

2. 環境の設定

cp .env.example .env

.env を編集し、ボットのトークンを貼り付けます:

DISCORD_TOKEN=your_token_here

任意: 名前を指定してボットを特定のサーバーに固定します(デフォルトは Monolith)。すべてのツールはこのギルドのみで動作します:

DISCORD_GUILD_NAME=Monolith

3. 依存関係のインストール

pip install -r requirements.txt

MCPホストの設定

opencode

プロジェクトルートの opencode.json に追加:

{
  "mcp": {
    "discord": {
      "type": "local",
      "command": ["python", "/absolute/path/to/discord_mcp_server.py"]
    }
  }
}

サーバーを読み込むために opencode を再起動します。

Claude Desktop

claude_desktop_config.json を編集(File → Settings → Developer → Edit Config):

{
  "mcpServers": {
    "discord": {
      "command": "python",
      "args": ["/absolute/path/to/discord_mcp_server.py"],
      "env": {
        "DISCORD_TOKEN": "your_token_here"
      }
    }
  }
}

Claude Code

プロジェクトの ~/.claude.json または .mcp.json に追加:

{
  "mcpServers": {
    "discord": {
      "command": "python",
      "args": ["/absolute/path/to/discord_mcp_server.py"],
      "env": {
        "DISCORD_TOKEN": "your_token_here"
      }
    }
  }
}

Cursor

プロジェクトルートに .cursor/mcp.json を作成(グローバルにする場合は ~/.cursor/mcp.json):

{
  "mcpServers": {
    "discord": {
      "command": "python",
      "args": ["/absolute/path/to/discord_mcp_server.py"],
      "env": {
        "DISCORD_TOKEN": "your_token_here"
      }
    }
  }
}

Windsurf

~/.codeium/windsurf/mcp_config.json に追加:

{
  "mcpServers": {
    "discord": {
      "command": "python",
      "args": ["/absolute/path/to/discord_mcp_server.py"],
      "env": {
        "DISCORD_TOKEN": "your_token_here"
      }
    }
  }
}

Codex CLI

~/.codex/config.toml に追加:

[mcp_servers.discord]
command = "python"
args = ["/absolute/path/to/discord_mcp_server.py"]

[mcp_servers.discord.env]
DISCORD_TOKEN = "your_token_here"

またはCLIで追加:

codex mcp add discord -- python /absolute/path/to/discord_mcp_server.py

Antigravity (Google)

~/.gemini/config/mcp_config.json に追加:

{
  "mcpServers": {
    "discord": {
      "command": "python",
      "args": ["C:\\path\\to\\discord_mcp_server.py"],
      "env": {
        "DISCORD_TOKEN": "your_token_here"
      }
    }
  }
}

Antigravity → Agent panel → ... → MCP Servers → Manage MCP Servers → View raw config を開きます。

注意: .env ファイルをインラインの env の代わりに使用する場合は、env ブロックを省略し、スクリプト内の load_dotenv() が .env を見つけられるようにしてください(作業ディレクトリはホストによって異なります)。

仕組み

スクリプトは stdio 上で MCP サーバーを実行し、ボットトークンを介して Discord に接続します。起動時にすべてのツールを登録し、AI アシスタントが必要に応じてそれらを呼び出します。Discord ボットは1つのサーバーにのみ存在すればよく、ログイン時に最初のギルドを自動選択します。

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    Control your Discord server with AI. Lets you manage channels, roles, members, messages, and more through natural language.
    96 npm
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables AI clients to manage Discord servers, including channels, messages, roles, members, permissions, threads, invites, events, webhooks, and emoji, through natural language commands.
    55
    96 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI assistants to interact with Discord by managing servers, channels, roles, members, messages, forum posts, reactions, webhooks, and permissions.
    733 npm
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI assistants to interact with the Discord platform for managing servers, channels, messages, roles, members, forums, and webhooks through natural language.
    733 npm
    MIT