Skip to main content
Glama
discord-mcp

discord-mcp

by yone-k

Discord MCP Server

English README

Discord API MCP (Model Context Protocol) Server - Discord機能をMCP対応クライアントと統合するためのTypeScript実装です。

機能

  • Zodバリデーションを使用したTypeScript実装

  • 簡単なデプロイのためのDockerサポート

  • MCPプロトコル準拠

  • Discord API統合

Related MCP server: discord-mcp-server

利用可能なツール

利用可能なツールの詳細については、ツール一覧を参照してください。

要件

  • Docker

  • Docker Compose(オプション)

インストール

# リポジトリをクローン
git clone https://github.com/yourusername/discord-mcp.git
cd discord-mcp

# Dockerイメージをビルド
docker build -t discord-mcp .

MCP設定

Claude Desktop

  1. Claude Desktopの設定ファイルを編集します:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

  1. 以下の設定を追加します:

Dockerを使用する場合(推奨)

{
  "mcpServers": {
    "discord-mcp": {
      "command": "docker",
      "args": [
        "run", 
        "--rm", 
        "-e", "DISCORD_TOKEN=your_discord_bot_token",
        "discord-mcp"
      ]
    }
  }
}

ローカルビルドを使用する場合

{
  "mcpServers": {
    "discord-mcp": {
      "command": "node",
      "args": ["/path/to/discord-mcp/dist/index.js"],
      "env": {
        "DISCORD_TOKEN": "your_discord_bot_token"
      }
    }
  }
}

開発環境での設定

{
  "mcpServers": {
    "discord-mcp-dev": {
      "command": "npx",
      "args": ["ts-node", "/path/to/discord-mcp/src/index.ts"],
      "cwd": "/path/to/discord-mcp",
      "env": {
        "DISCORD_TOKEN": "your_discord_bot_token",
        "LOG_LEVEL": "debug"
      }
    }
  }
}

その他のMCPクライアント

stdio方式で接続できる任意のMCPクライアントから利用できます:

# Dockerで直接実行
docker run --rm -e DISCORD_TOKEN=your_discord_bot_token discord-mcp

使用方法

Docker(推奨)

# 基本実行
docker run --rm -e DISCORD_TOKEN=your_discord_bot_token discord-mcp

# Docker Composeを使用
docker-compose up --build

開発環境(ローカル開発用)

# 依存関係をインストール
npm install

# 開発モードで開始
npm run dev

スクリプト

  • npm run build - TypeScriptをJavaScriptにコンパイル

  • npm run start - 本番サーバーを開始

  • npm run dev - ts-nodeを使用して開発モードで開始

  • npm run lint - ESLintを実行

  • npm run typecheck - TypeScriptの型チェックを実行

  • npm run docker:build - Dockerイメージをビルド

プロジェクト構造

discord-mcp/
├── src/
│   └── index.ts          # メインサーバー実装
├── dist/                 # コンパイル済みJavaScript出力
├── Dockerfile            # Docker設定
├── docker-compose.yml    # Docker Compose設定
├── package.json          # プロジェクト依存関係とスクリプト
├── tsconfig.json         # TypeScript設定
└── README.md             # このファイル

設定ガイド

Discord Bot の設定

  1. Discord Developer Portalにアクセス

  2. 新しいApplicationを作成

  3. Bot タブでBot トークンを取得

  4. OAuth2 → URL Generatorで以下の権限を設定:

    • bot スコープ

    • Send Messages 権限

    • Read Message History 権限

  5. 生成されたURLでDiscordサーバーに招待

環境変数の設定

# Discord Bot トークンを設定
export DISCORD_TOKEN="your_discord_bot_token_here"

# ログレベルの設定(オプション)
export LOG_LEVEL="info"  # debug, info, warn, error

設定確認のコマンド

# Claude Desktop設定ファイルの確認 (macOS)
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json

# JSON形式の検証
python -m json.tool ~/Library/Application\ Support/Claude/claude_desktop_config.json

# Dockerイメージの確認
docker images | grep discord-mcp

ライセンス

MIT License - 詳細はLICENSEファイルを参照してください。

Available Tools

23 tools
create_webhookB

Discordチャンネルに新しいWebhookを作成します

Inputs: name (required), channelId (required), avatar.

delete_messageA

Discordメッセージを削除します(自分が送信したメッセージまたは適切な権限がある場合)

Inputs: channelId (required), messageId (required), reason.

delete_webhookA

Discord Webhookを削除します(自分が作成したWebhookまたは適切な権限がある場合)

Inputs: webhookId (required), reason.

edit_messageA

Discordの既存メッセージを編集します(自分が送信したメッセージのみ)

Inputs: content (required), channelId (required), messageId (required), embeds.

execute_webhookC

Discord Webhookを実行してメッセージを送信します

Inputs: webhookId (required), webhookToken (required), content.

get_channel_invitesB

特定のDiscordチャンネルの招待リンク一覧を取得します

Inputs: channelId (required).

get_channel_listB

特定のDiscordサーバーのチャンネル一覧を取得します

Inputs: serverId (required), channelType, includeDetails.

get_channel_messagesB

特定のDiscordチャンネルのメッセージ履歴を取得します

Inputs: channelId (required), after, limit, around, +1 more.

get_channel_webhooksB

特定のDiscordチャンネルのWebhook一覧を取得します

Inputs: channelId (required).

get_guild_invitesA

特定のDiscordサーバーの招待リンク一覧を取得します

Inputs: guildId (required).

get_guild_rolesB

特定のDiscordサーバーのロール一覧を取得します

Inputs: guildId (required), adminOnly, excludeManaged, includeDetails.

get_guild_webhooksA

特定のDiscordサーバーのWebhook一覧を取得します

Inputs: guildId (required).

get_member_rolesB

特定のDiscordサーバーメンバーのロール一覧を取得します

Inputs: userId (required), guildId (required), adminOnly, excludeManaged, +1 more.

get_messageB

特定のDiscordメッセージの詳細情報を取得します

Inputs: channelId (required), messageId (required).

get_pinned_messagesA

特定のDiscordチャンネルのピン留めメッセージ一覧を取得します

Inputs: channelId (required).

get_server_detailsA

特定のDiscordサーバーの詳細情報を取得します

Inputs: serverId (required).

get_server_listA

Botが参加しているDiscordサーバーの一覧を取得します

Inputs: includeDetails.

get_user_listB

特定のDiscordサーバーのユーザー一覧を取得します

Inputs: serverId (required), after, limit, roleId, +1 more.

get_voice_regionsA

利用可能なDiscordボイスリージョン一覧を取得します

Inputs: no named parameters.

get_webhookA

特定のDiscord Webhookの詳細情報を取得します

Inputs: webhookId (required).

send_fileB

Discordチャンネルにファイルを送信します

Inputs: file (required), channelId (required), content, spoiler.

send_messageC

Discordチャンネルにメッセージを送信します

Inputs: content (required), channelId (required), tts, embeds.

update_webhookC

既存のDiscord Webhookを更新します

Inputs: webhookId (required), name, avatar.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 23 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action, such as listing vs. fetching details, or guild vs. channel webhooks. Descriptions clearly separate overlapping concepts like sending a message vs. executing a webhook.

    Naming Consistency3/5

    Tool names follow a consistent verb_noun pattern, but there is notable inconsistency between 'server' and 'guild' for the same concept (e.g., get_server_list vs. get_guild_roles). Also, 'user' and 'member' are used interchangeably, which could confuse agents.

    Tool Count3/5

    23 tools is on the higher end of typical MCP servers. While each tool is distinct and serves a specific purpose, the count feels heavy for the scope, which is primarily read-only operations with some message and webhook management.

    Completeness3/5

    The tool set covers essential read operations for servers, channels, messages, and webhooks, plus message and webhook CRUD. However, it lacks common Discord operations like creating channels, invites, or role management, leaving notable gaps for a tool named 'discord-mcp'.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables comprehensive Discord bot management and server operations through MCP, including channel management, message handling, member moderation, role management, and voice operations. Provides secure Discord API integration with built-in permission controls and audit logging capabilities.
      19
      141 npm
      19
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Discord integration through MCP, allowing server management, messaging, channel/role management, and automatic issue capture to PostgreSQL.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables managing Discord servers through a bot, including channel and role administration, messaging, and direct Discord API calls via MCP tools.
      2
      MIT