Skip to main content
Glama
VoiceOS Discord MCP Server

VoiceOS Discord MCP Server

by CharityDEX

VoiceOS Discord MCP サーバー

これは、VoiceOSがComposioの DISCORDBOT ツールキットを通じてDiscordメッセージの読み書きを行えるようにする、スタンドアロンのTypeScript MCPサーバーです。

VoiceOSは引き続きこれをローカルのstdio MCPサーバーとして起動しますが、Discordの認証とトークンの処理はComposioに委任されます。

機能

  • connect_discord_bot: Discordボット/アカウント認証用のComposio Connectリンクを返します。

  • list_discord_servers: Composioバックエンドのボットフローにおけるギルド/サーバー検出について説明します。

  • list_discord_channels: 既知のDiscordギルド/サーバーIDのチャンネルを一覧表示します。

  • read_discord_messages: DiscordチャンネルIDから最近のメッセージを取得します。

  • send_discord_message: DiscordチャンネルIDにメッセージを送信します。

  • reply_discord_message: 特定のDiscordメッセージIDに返信します。

書き込みアクションはMCPツール定義内で明確に記述されているため、VoiceOSはDiscordに何かを送信する前に確認用のピルを表示できます。

Related MCP server: MCP-Discord

要件

  • Node.js 20以上

  • Composio APIキー

  • ローカルテスト用の安定したユーザーID

本番環境のVoiceOSでは、ユーザーIDはログイン中のVoiceOSアカウントから自動的に注入される必要があります。ユーザーが手動で決定したり入力したりすべきではありません。

インストール

npm install

環境設定

ローカルの .env ファイルを作成します:

COMPOSIO_API_KEY=your_composio_api_key
VOICEOS_USER_ID=local-test-user
COMPOSIO_TOOLKIT=DISCORDBOT
# Recommended/required for reliable DISCORDBOT channel and message tools.
COMPOSIO_AUTH_CONFIG_ID=your_discordbot_auth_config_id

COMPOSIO_AUTH_CONFIG_ID は、DiscordクライアントID、クライアントシークレット、ボットトークン、権限整数を含むカスタムComposio DISCORDBOT 認証設定を指す必要があります。デフォルトのComposio管理OAuth接続は、サーバーチャンネル/メッセージエンドポイントに必要なボットトークンが不足していても ACTIVE と表示される場合があり、これがDiscordの 401 Unauthorized レスポンスを引き起こします。

チャンネル検出用のオプションのサーバーID:

DISCORD_GUILD_IDS=server_id_1,server_id_2

DISCORD_GUILD_IDS は、現在のComposioバックエンドMCPがチャンネル一覧を DISCORDBOT_LIST_GUILD_CHANNELS にマッピングしており、これにはギルド/サーバーIDが必要なため便利です。

ローカルでの実行

npm run start

VoiceOSへの接続

  1. VoiceOSの設定を開きます。

  2. Custom Integrations に移動します。

  3. Add をクリックします。

  4. 統合に名前を付けます(例:Discord)。

  5. 起動コマンドを貼り付けます:

/Users/makslas/Desktop/Development-Repos/VoiceOS-Discord-MCP/run-discord-mcp.sh
  1. Connect をクリックします。

認証フロー

VoiceOSでMCPが接続されたら、次のように尋ねます:

Connect Discord

VoiceOSは connect_discord_bot を呼び出し、Composio Connectリンクを開くはずです。COMPOSIO_AUTH_CONFIG_ID が設定されている場合、リンクはComposioのデフォルトの管理OAuth設定ではなく、その特定の認証設定に対して作成されます。

認証前にユーザーがDiscordアクションを試みた場合、MCPは認証が必要である旨のメッセージを返します。通常のDiscordアクションは自動的にComposioを開かないように設計されており、これにより認証の再試行ループを防ぎます。

Discord Bot authentication is required before I can access Discord.

Please explicitly ask: `Connect Discord` when you want me to open the Composio connection page.

ツールの詳細

connect_discord_bot

DISCORDBOT 用のComposio Connectリンクを作成します。

VoiceOSに尋ねる際にこれを使用します:

Connect Discord

list_discord_servers

DISCORD_GUILD_IDS が設定されている場合、それらのギルドの詳細を取得します。設定されていない場合は、Composio DISCORDBOT のチャンネル一覧表示にはギルド/サーバーIDが必要であることを説明します。

list_discord_channels

サーバー/ギルドのDiscordチャンネルを一覧表示します。

パラメータ:

  • guild_id: オプションのDiscordサーバー/ギルドID。省略された場合、ツールは DISCORD_GUILD_IDS を使用します。

  • text_only: デフォルトは true で、メッセージの読み取り/送信ワークフローに適したテキスト形式のチャンネルのみを返します。

VoiceOSに尋ねる際にこれを使用します:

What Discord channels do you have access to in server GUILD_ID?

read_discord_messages

DISCORDBOT_LIST_MESSAGES を介してチャンネルから最近のメッセージを読み取ります。

パラメータ:

  • channel_id: DiscordチャンネルID。

  • channel_name: general などのDiscordチャンネル名。channel_id が省略された場合に使用されます。

  • guild_id: channel_name を解決するために使用されるオプションのDiscordサーバー/ギルドID。省略された場合、ツールは DISCORD_GUILD_IDS を使用します。

  • limit: 取得するメッセージ数(1〜100)。デフォルトは10。

  • before: ページネーション用のオプションのメッセージID。このメッセージより前のメッセージを取得します。

  • after: ページネーション用のオプションのメッセージID。このメッセージより後のメッセージを取得します。

  • around: ページネーション用のオプションのメッセージID。このメッセージ周辺のメッセージを取得します。

  • author_filter: オプションのユーザーID、ユーザー名、または表示名フィルター。

send_discord_message

DISCORDBOT_CREATE_MESSAGE を介してチャンネルにメッセージを送信します。

パラメータ:

  • channel_id: DiscordチャンネルID。

  • channel_name: general などのDiscordチャンネル名。channel_id が省略された場合に使用されます。

  • guild_id: channel_name を解決するために使用されるオプションのDiscordサーバー/ギルドID。省略された場合、ツールは DISCORD_GUILD_IDS を使用します。

  • content: 正確なメッセージ内容。最大2000文字。

  • tts: テキスト読み上げとして送信するかどうか。デフォルトは false。

  • allowed_mentions: メンション解析ポリシー。none、users、users_and_roles、everyone のいずれか。デフォルトは none。

reply_discord_message

message_reference を指定して DISCORDBOT_CREATE_MESSAGE を介し、特定のメッセージに返信します。

パラメータ:

  • channel_id: 元のメッセージを含むDiscordチャンネルID。

  • channel_name: general などのDiscordチャンネル名。channel_id が省略された場合に使用されます。

  • guild_id: channel_name を解決するために使用されるオプションのDiscordサーバー/ギルドID。省略された場合、ツールは DISCORD_GUILD_IDS を使用します。

  • message_id: 返信先のDiscordメッセージID。

  • content: 正確な返信内容。最大2000文字。

  • allowed_mentions: メンション解析ポリシー。none、users、users_and_roles、everyone のいずれか。デフォルトは none。

Discord DMの制限

Composio DISCORDBOT は、ボットがアクセス可能なチャンネルメッセージング、メッセージの読み取り、返信、ギルドチャンネルの一覧表示、およびボットが作成したDMをサポートしています。

ユーザーの既存の個人的なDMへの広範なアクセス権は付与されません。グループDM操作には gdm.join を含むユーザーOAuth2アクセストークンが必要であり、Discord APIの制限を受け続けます。

本番環境のVoiceOSユーザーID

本番環境では、VoiceOSは内部のログイン済みユーザーIDをComposioに自動的に渡す必要があります。ユーザーが手動でユーザーIDを入力することは決してあってはなりません。

Discordのメールアドレスを主要なComposio user_id として使用しないでください:

  • 接続リンクは、Discord OAuthが完了する前にユーザーIDを必要とします。

  • Discordのメールアドレスは、スコープによっては利用できない場合があります。

  • メールアドレスは変更される可能性があります。

  • 1人のVoiceOSユーザーが将来的に複数のDiscordアカウントを接続する可能性があります。

セキュリティ上の注意

  • .env をコミットしないでください。

  • COMPOSIO_API_KEY をコミットしないでください。

  • Discordボットトークンや接続済みアカウントの資格情報をコミットしないでください。

  • allowed_mentions はデフォルトで none に設定されているため、生成されたメッセージが誤ってユーザー、ロール、@everyone、または @here に通知を送ることはありません。

Available Tools

6 tools
connect_discord_botA

Create a Composio Connect Link for authenticating the Discord bot/account connection. Use this whenever the user asks to connect Discord, or whenever another Discord tool reports that authentication is required.

Inputs: no named parameters.

list_discord_channelsA

List Discord channels that the Composio DISCORDBOT connection can discover. Provide a server/guild ID when known. If authentication is missing, return a Composio Connect Link. Use this when the user asks what Discord channels or chats are available.

Inputs: guild_id, text_only.

list_discord_serversC

Explain how to list Discord servers/guilds for this Composio DISCORDBOT integration. DISCORDBOT channel discovery requires a guild/server ID; if authentication is missing, this returns a Composio Connect Link.

Inputs: no named parameters.

read_discord_messagesA

Read recent messages from a specific Discord channel by channel ID. Use this when the user asks what is happening in a Discord channel or wants context from recent Discord messages. This is a read-only action.

Inputs: channel_id, channel_name, guild_id, limit, +4 more.

reply_discord_messageA

Reply to a specific Discord message ID in a channel. This is a write action and should be shown to the user as a VoiceOS confirmation pill before execution. Confirm the channel ID, message ID, and exact reply content with the user before calling this tool.

Inputs: message_id (required), content (required), channel_id, channel_name, +2 more.

send_discord_messageA

Send a new message to a specific Discord channel by channel ID. This is a write action and should be shown to the user as a VoiceOS confirmation pill before execution. Confirm the channel ID and exact message content with the user before calling this tool.

Inputs: content (required), channel_id, channel_name, guild_id, +2 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 6 tools

    Disambiguation4/5

    Most tools have distinct purposes (connect, list channels, read, send, reply), but list_discord_servers is ambiguous as it 'explains how to list' rather than listing, potentially overlapping with list_discord_channels.

    Naming Consistency5/5

    All tools consistently follow verb_noun pattern (e.g., connect_discord_bot, list_discord_channels), with clear and predictable naming.

    Tool Count4/5

    6 tools is reasonable for a Discord bot integration covering auth, listing, reading, and writing. Slightly narrow but not excessive.

    Completeness3/5

    Covers core operations but list_discord_servers only explains rather than actually retrieving servers, creating a functional gap. Missing update/delete message and server management tools.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to interact with a Discord account to read channels, send and manage messages, handle DMs and reactions, search messages, and update status.
      1
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to interact with the Discord platform, including managing servers, channels, roles, members, messages, forums, reactions, and webhooks through Discord bot capabilities.
      3,822 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to interact with the Discord platform, including servers, members, roles, channels, categories, forum posts, messages, reactions, and webhooks. It supports logging in a bot, reading and searching messages, and creating, editing, or deleting Discord resources through natural language.
      3,822 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to interact with the Discord platform by managing servers, channels, roles, forum posts, messages, reactions, and webhooks through a Discord bot.
      3,822 npm
      MIT