Skip to main content
Glama
gfb-47

WhatsApp MCP Server

by gfb-47

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 サーバーを使用できるようにするには、次の手順に従います。

  1. MCPサーバーをセットアップする

    • 上記の説明に従ってWhatsApp MCPサーバーをインストールして構成します

    • ローカルマシン上でサーバーが正常に動作していることを確認します

  2. 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"]
      }
    }
  ]
}
  1. 統合をテストする

    • クロードとのテスト会話を作成する

    • クロードにテスト連絡先に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 tools
check-whatsapp-statusB

Check if WhatsApp is currently running

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool checks if WhatsApp is 'currently running,' which implies a read-only operation, but doesn't disclose behavioral traits like what 'running' means (e.g., process active, logged in), error handling, or performance characteristics. The description is minimal and lacks context beyond the basic purpose.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no annotations, no output schema), the description is minimally adequate. It covers the basic purpose but lacks details on behavior, output format, or usage context, which could be helpful for an agent to understand what 'running' entails or how to interpret results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here, and it doesn't contradict the schema. Baseline is 4 for tools with no parameters, as there's nothing to compensate for.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Check if') and resource ('WhatsApp'), specifying what the tool does. It distinguishes from siblings like 'send-whatsapp-message' by focusing on status checking rather than messaging, though it doesn't explicitly mention the sibling 'list-recent-contacts'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description implies usage for checking WhatsApp's operational status, but it doesn't specify scenarios, prerequisites, or exclusions, such as whether it requires WhatsApp to be installed or configured.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list-recent-contactsB

List recently contacted people on WhatsApp (simplified)

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states it lists contacts but doesn't explain what 'recently contacted' means (timeframe, criteria), how results are ordered, or any limitations (e.g., pagination, rate limits). The 'simplified' hint is insufficient to convey operational behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core purpose ('List recently contacted people on WhatsApp') and uses a brief qualifier ('simplified') that, while vague, doesn't detract from clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It lacks details on what 'recently contacted' entails, how results are returned, or any behavioral constraints. For a tool that presumably returns data, more context on output format or limitations is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing instead on the tool's purpose. Baseline is 4 for zero-parameter tools when schema coverage is complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and target resource ('recently contacted people on WhatsApp'), making the purpose understandable. It distinguishes from siblings by focusing on listing contacts rather than checking status or sending messages. However, the qualifier 'simplified' is vague and doesn't specify what makes it simplified.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context (WhatsApp contacts) but provides no explicit guidance on when to use this tool versus alternatives. No prerequisites, exclusions, or comparisons to sibling tools are mentioned, leaving the agent to infer usage from the purpose alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

send-whatsapp-messageC

Send a message to a contact on WhatsApp

ParametersJSON Schema
NameRequiredDescriptionDefault
contactNameYesFull name of the contact as it appears in WhatsApp
messageYesMessage content to send

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but fails to mention critical traits like authentication needs, rate limits, error handling, or whether the message is sent immediately or queued. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without any unnecessary words. It is front-loaded and appropriately sized for a simple tool, making it easy to grasp quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like success/error responses, side effects, or integration with sibling tools. For a messaging tool with potential complexities, more context is needed to ensure proper usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with clear descriptions for both parameters ('contactName' and 'message'). The description adds no additional meaning beyond the schema, such as formatting details or examples, but the schema adequately documents the parameters, meeting the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Send a message') and target ('to a contact on WhatsApp'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'check-whatsapp-status' or 'list-recent-contacts' beyond the obvious functional difference, missing explicit distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives or any prerequisites. The description lacks context about usage scenarios, such as when to choose this over other messaging methods or if there are limitations like contact availability.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 2 tool updatesv1.0.0
    • Changedcheck-whatsapp-status1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
    • Changedlist-recent-contacts1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
  2. 3 tool updates
    • First observedcheck-whatsapp-status
    • First observedlist-recent-contacts
    • First observedsend-whatsapp-message

TDQS

B3.1/5.0

Scored across 3 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count3/5

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.

Completeness2/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A 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.
    34 npm
    46
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
    4
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables sending iMessages or SMS messages via the macOS Messages app using osascript. No Full Disk Access required, and never reads your message history.
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    MCP 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.
    8
    MIT