WhatsApp MCP Server
WhatsApp MCP サーバー
概要
WhatsApp MCP(Model Context Protocol)サーバーは、macOS上のWhatsAppデスクトップアプリケーションとのプログラム的な連携を可能にするNode.jsアプリケーションです。AppleScriptの自動化機能を使用することで、WhatsApp UIを直接操作することなく、メッセージの送信やWhatsAppのステータス確認のためのシンプルなインターフェースを提供します。
Related MCP server: claude-whatsapp-mcp
特徴
1. 連絡先にメッセージを送信する
WhatsApp の連絡先リスト内の特定の連絡先にテキスト メッセージを送信します。
メッセージは接続されたWhatsAppデスクトップアプリケーションを通じて配信されます
改行を含むメッセージの適切なフォーマットをサポートします
AppleScriptを使用してWhatsAppデスクトップインターフェースを自動化します
2. WhatsAppのステータスを確認する(WIP)
WhatsApp アプリケーションが現在実行されているかどうかを確認します。
WhatsAppの現在の実行ステータスを返します
メッセージを送信する際のエラーを防ぐのに役立ちます
3. 最近の連絡先を一覧表示する(WIP)
WhatsApp のプライバシー保護のため、この機能は機能が制限されています。
WhatsAppのプライバシー制限についてユーザーに通知
メッセージには正確な連絡先名が必要です
技術的実装
構築済み
@modelcontextprotocol/sdk - MCP サーバーと stdio トランスポート
Zod - スキーマ検証
Node.js 組み込みモジュール (child_process、util、fs)
macOS自動化のためのAppleScript
建築
標準化されたツール通信にモデルコンテキストプロトコル(MCP)を使用します
通信にはstdioトランスポートを採用
WhatsAppデスクトップアプリケーションと対話するためのAppleScriptコマンドを実行します
デバッグのための包括的なエラーログを実装します
要件
macOSオペレーティングシステム
WhatsAppデスクトップアプリケーションがインストールされている
Node.js v14.0.0 以上
インターネット接続
インストール
# Clone the repository
git clone https://github.com/yourusername/whatsapp-mcp-server.git
# Navigate to the project directory
cd whatsapp-mcp-server
# Install dependencies
npm install使用法
サーバーの起動
node index.jsクロードとの統合
Claude が WhatsApp MCP サーバーを使用できるようにするには、次の手順に従います。
MCPサーバーをセットアップする
上記の説明に従ってWhatsApp MCPサーバーをインストールして構成します
ローカルマシン上でサーバーが正常に動作していることを確認します
MCPツールでClaude Desktopを構成する
claude_desktop_config.jsonファイルを変更して WhatsApp MCP ツールを追加します。このファイルは通常、Claude Desktopアプリケーションの構成ディレクトリにあります。
WhatsApp MCP ツールを登録するには、次の構成を追加します。
{
"mcpServers": [
{
"name": "whatsapp-mcp",
"transport": {
"command": "node",
"args": ["path/to/your/index.js"]
}
}
]
}統合をテストする
クロードとのテスト会話を作成する
クロードにテスト連絡先にWhatsAppメッセージを送信するよう依頼する
WhatsAppデスクトップアプリからメッセージが正常に送信されたことを確認します
利用可能なMCPツール
1. WhatsAppメッセージを送信する
指定された WhatsApp 連絡先にメッセージを送信します。
パラメータ:
contactName: WhatsAppに表示される連絡先のフルネームmessage: 送信するメッセージの内容
使用例(MCP クライアント経由):
const response = await client.invoke("send-whatsapp-message", {
contactName: "John Doe",
message: "Hello, how are you today?"
});2. WhatsAppのステータスを確認する
WhatsApp アプリケーションが現在実行されているかどうかを確認します。
パラメータは必要ありません。
使用例(MCP クライアント経由):
const response = await client.invoke("check-whatsapp-status", {});3. 最近の連絡先の一覧
WhatsApp の連絡先リストに関するプライバシー制限に関する情報を提供します。
パラメータは必要ありません。
使用例(MCP クライアント経由):
const response = await client.invoke("list-recent-contacts", {});実装の詳細
AppleScriptの自動化
サーバーは AppleScript を使用して WhatsApp デスクトップ アプリケーションを自動化します。
WhatsAppアプリケーションを起動します
キーボードショートカットを使用してインターフェースを操作します
名前で連絡先を検索します
下矢印ナビゲーションを使用して連絡先を選択します
メッセージを入力して送信する
エラー処理
包括的なエラー処理とログ記録:
コンソールエラー出力
~/Library/Logs/whatsapp-mcp/のファイルベースのログAppleScript実行エラーの適切な処理
プロセスレベルの例外処理
クロードとWhatsApp MCPツールを使用する
WhatsApp MCP ツールを Claude と統合すると、自然言語を使用して Claude に次の指示を出すことができます。
メッセージを送信
プロンプトの例:
「ジョンにWhatsAppメッセージを送って、会議に10分遅れる旨を伝えてください」
WhatsAppでサラに次のテキストを送信してください: これがあなたが要求した文書です。
「WhatsAppでお母さんに『お誕生日おめでとう!』と送ろう」
WhatsAppのステータスを確認する
プロンプトの例:
「私のコンピューターでWhatsAppは実行されていますか?」
「WhatsAppがアクティブかどうかを確認してください」
「メッセージを送信する前にWhatsAppのステータスを確認してください」
連絡先情報を取得する
プロンプトの例:
「最近のWhatsAppの連絡先をリストしてもらえますか?」
「WhatsAppで最近メッセージを送った相手を表示」
Claude はお客様のリクエストに基づいて適切な MCP ツールを使用して、結果に関するフィードバックを提供します。
制限事項
AppleScript に依存しているため、macOS でのみ動作します
WhatsAppデスクトップアプリケーションのインストールが必要です
WhatsApp UIの変更により連絡先の選択が影響を受ける可能性があります
プライバシー保護のため、WhatsAppの連絡先リストへのアクセスが制限される
ローカルの MCP ツールにアクセスするには、Claude を適切に構成する必要があります。
セキュリティに関する考慮事項
サーバーは個人のWhatsAppアカウントとやり取りします
メッセージはあなたのアカウントから送信され、あなたが送信したように表示されます
信頼できる環境でのみ使用してください
ライセンス
マサチューセッツ工科大学
免責事項
このプロジェクトは、WhatsApp Inc. または Meta Platforms, Inc. と提携していません。ご自身の判断で WhatsApp の利用規約に従って使用してください。
Available Tools
3 toolscheck-whatsapp-statusB
Check if WhatsApp is currently running
Inputs: no named parameters.
list-recent-contactsB
List recently contacted people on WhatsApp (simplified)
Inputs: no named parameters.
send-whatsapp-messageC
Send a message to a contact on WhatsApp
Inputs: contactName (required), message (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: checking WhatsApp status, listing recent contacts, and sending messages. There is no overlap in functionality, making it easy for an agent to select the correct tool without confusion.
The tools follow a consistent verb-noun pattern with hyphens (e.g., check-whatsapp-status, list-recent-contacts, send-whatsapp-message). However, the use of hyphens instead of underscores is a minor deviation from common snake_case conventions, but it remains readable and predictable.
With only 3 tools, the server feels thin for managing WhatsApp interactions, as it lacks operations like reading messages, managing groups, or handling media. While the tools cover basic actions, the scope is limited, making it borderline appropriate for a comprehensive WhatsApp integration.
The toolset is significantly incomplete for a WhatsApp server, missing essential CRUD operations such as reading incoming messages, replying to messages, managing contacts or groups, and handling attachments. This will likely cause agent failures when trying to perform common WhatsApp tasks beyond the basic ones provided.
Maintenance
Related MCP Connectors
WhatsApp for Claude, ChatGPT or any AI agent: search, reply and send. Personal or Business API.
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
Send WhatsApp messages from your own number, read the replies and send login codes.
I send and manage WhatsApp Web messages through your linked session
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Node.js application that connects WhatsApp Web with AI models through the Model Context Protocol, enabling automated messaging, contact management, and group chat functionality through AI-driven workflows.23 npm46MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to interact with WhatsApp for reading messages, sending replies, and searching contacts through the Model Context Protocol. It uses whatsapp-web.js to facilitate local connection management with QR code authentication and session persistence.4MIT
- AlicenseAqualityDmaintenanceEnables sending iMessages or SMS messages via the macOS Messages app using osascript. No Full Disk Access required, and never reads your message history.1MIT
- AlicenseAqualityCmaintenanceMCP server that gives AI agents read and write access to WhatsApp on macOS, reading local chat history offline and sending messages via pre-filled drafts with explicit user confirmation.8MIT