VoiceOS Discord MCP Server
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_idCOMPOSIO_AUTH_CONFIG_ID は、DiscordクライアントID、クライアントシークレット、ボットトークン、権限整数を含むカスタムComposio DISCORDBOT 認証設定を指す必要があります。デフォルトのComposio管理OAuth接続は、サーバーチャンネル/メッセージエンドポイントに必要なボットトークンが不足していても ACTIVE と表示される場合があり、これがDiscordの 401 Unauthorized レスポンスを引き起こします。
チャンネル検出用のオプションのサーバーID:
DISCORD_GUILD_IDS=server_id_1,server_id_2DISCORD_GUILD_IDS は、現在のComposioバックエンドMCPがチャンネル一覧を DISCORDBOT_LIST_GUILD_CHANNELS にマッピングしており、これにはギルド/サーバーIDが必要なため便利です。
ローカルでの実行
npm run startVoiceOSへの接続
VoiceOSの設定を開きます。
Custom Integrations に移動します。
Add をクリックします。
統合に名前を付けます(例:
Discord)。起動コマンドを貼り付けます:
/Users/makslas/Desktop/Development-Repos/VoiceOS-Discord-MCP/run-discord-mcp.shConnect をクリックします。
認証フロー
VoiceOSでMCPが接続されたら、次のように尋ねます:
Connect DiscordVoiceOSは 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 Discordlist_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 toolsconnect_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
Scored across 6 tools
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.
All tools consistently follow verb_noun pattern (e.g., connect_discord_bot, list_discord_channels), with clear and predictable naming.
6 tools is reasonable for a Discord bot integration covering auth, listing, reading, and writing. Slightly narrow but not excessive.
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
Related MCP Connectors
Publish and schedule Discord server posts from your AI assistant.
Connect a Discord bot (bot token from the developer portal) to read/send messages, list guilds and c
Read Discord channels, threads and message history from an AI assistant via a read-only bot.
Control your Discord community: send/read messages, manage channels and forums, and handle webhook…
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to interact with a Discord account to read channels, send and manage messages, handle DMs and reactions, search messages, and update status.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables 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 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables 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 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables 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 npmMIT