惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
Jina AI
Jina AI
The Cloudflare Blog
V
Visual Studio Blog
博客园_首页
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
博客园 - Franky

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - Jem-HR/pywa-mcp-server
rawdreeg · 2026-06-27 · via Hacker News: Show HN

A comprehensive Model Context Protocol (MCP) server that exposes full WhatsApp Business API functionality using the PyWA library.

Features

This MCP server provides 18 WhatsApp tools organized into four categories:

Messaging Tools (12)

  • Text & Media: send_message, send_image, send_video, send_document, send_audio, send_sticker
  • Location & Contacts: send_location, request_location, send_contact
  • Interactions: send_reaction, remove_reaction, upload_media

Interactive Tools (2)

  • Interactive Messages: send_message_with_buttons, send_message_with_list

Template Tools (2)

  • Template Messaging: send_template, get_templates

Status Tools (2)

  • Message Status: mark_message_as_read, indicate_typing

Setup

  1. Install dependencies:

  2. Configure WhatsApp credentials:

    cp .env.example .env
    # Edit .env with your WhatsApp Cloud API credentials
  3. Run the server:

    # Production mode
    uv run python server.py
    
    # Development mode with Web UI (recommended for testing)
    uv run fastmcp dev --ui-port 6275 server.py

Configuration

Set these environment variables:

  • WHATSAPP_PHONE_ID - Your WhatsApp Business phone number ID
  • WHATSAPP_TOKEN - Your WhatsApp Cloud API access token

Get these from your Meta Developer Console.

Development & Testing

Web UI (Recommended for Development)

Test your WhatsApp tools interactively with the FastMCP Inspector:

uv run fastmcp dev --ui-port 6275 server.py

Open http://localhost:6275 in your browser to:

  • View all 15+ WhatsApp tools
  • Test messaging, buttons, lists, templates
  • See real-time API calls and responses
  • Debug with comprehensive error messages

Testing with Real WhatsApp

  1. Get WhatsApp Business API credentials from Meta Developer Console
  2. Add test phone numbers in your Meta Developer Console
  3. Use the Web UI to send messages to test numbers
  4. Verify messages appear in WhatsApp

Claude Desktop Integration

Quick Setup (One Command)

Install directly in Claude Desktop config:

{
  "mcpServers": {
    "pywa-whatsapp": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/Jem-HR/pywa-mcp-server.git",
        "pywa-mcp-server"
      ],
      "env": {
        "WHATSAPP_PHONE_ID": "your_phone_id",
        "WHATSAPP_TOKEN": "your_token"
      }
    }
  }
}

This automatically downloads and runs the server without manual installation.

Manual Configuration

  1. Locate Claude Desktop config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add server configuration:

    {
      "mcpServers": {
        "pywa-whatsapp": {
          "command": "uv",
          "args": [
            "run",
            "python",
            "/path/to/pywa-mcp-server/server.py"
          ],
          "env": {
            "WHATSAPP_PHONE_ID": "your_phone_number_id",
            "WHATSAPP_TOKEN": "your_whatsapp_cloud_api_token"
          }
        }
      }
    }
  3. Restart Claude Desktop

  4. Verify connection: Look for the 🔨 hammer icon in Claude Desktop

Using WhatsApp Tools in Claude Desktop

Once connected, you can ask Claude to:

Send Messages:

Send a WhatsApp message to +1234567890 saying "Hello from Claude!"

Create Interactive Buttons:

Send a WhatsApp message with buttons asking "Are you available?" 
with Yes/No options to +1234567890

Build Menu Lists:

Create a WhatsApp menu for a restaurant with sections for Main Courses 
and Beverages, send to +1234567890

Show Typing Indicators:

Show typing indicator for WhatsApp message ID wamid.XXX to let the user 
know I'm preparing a response

Send Media:

Send an image from URL https://example.com/image.jpg with caption 
"Check this out!" to +1234567890

Use Templates:

Send the "welcome_message" template in English to +1234567890

Available WhatsApp Tools in Claude

Claude has access to these WhatsApp capabilities:

📝 Messaging (12 tools):

  • send_message - Text messages with headers/footers
  • send_image - Images with captions
  • send_video - Videos with captions
  • send_document - Files with custom names
  • send_audio - Audio messages
  • send_sticker - WebP stickers
  • send_location - GPS coordinates
  • request_location - Ask user for location
  • send_contact - Contact cards
  • send_reaction - Emoji reactions
  • remove_reaction - Remove reactions
  • upload_media - Upload files to WhatsApp

🎛️ Interactive (2 tools):

  • send_message_with_buttons - Up to 3 reply buttons
  • send_message_with_list - Selection lists with sections

📋 Templates (2 tools):

  • send_template - Pre-approved template messages
  • get_templates - List available templates

⚡ Status (2 tools):

  • mark_message_as_read - Mark messages as read
  • indicate_typing - Show typing indicator

Architecture

The server uses a modular architecture:

  • server.py - Main MCP server using FastMCP framework
  • tools/messaging.py - Text, media, location, contact, and reaction tools
  • tools/interactive.py - Button, list, catalog, and flow message tools
  • tools/templates.py - Template messaging and authentication tools

All tools follow consistent patterns:

  • Async implementation for optimal performance
  • Comprehensive error handling with success/error responses
  • Direct mapping to PyWA library methods
  • Full type safety and parameter validation

Tool Examples

send_message

Send a text message to a WhatsApp user.

{
  "to": "+1234567890",
  "text": "Hello from PyWA MCP Server!",
  "preview_url": true,
  "reply_to_message_id": "optional_message_id"
}

send_button_message

Send an interactive message with reply buttons.

{
  "to": "+1234567890",
  "text": "Choose an option:",
  "buttons": [
    {"id": "option1", "title": "Option 1"},
    {"id": "option2", "title": "Option 2"}
  ],
  "header": "Quick Actions",
  "footer": "Select one option"
}

send_template

Send a pre-approved template message.

{
  "to": "+1234567890",
  "template": "hello_world",
  "language": "en",
  "components": [
    {
      "type": "body",
      "parameters": [
        {"type": "text", "text": "John Doe"}
      ]
    }
  ]
}

Troubleshooting

Common Issues

❌ "Missing required environment variables"

  • Ensure .env file exists with WHATSAPP_PHONE_ID and WHATSAPP_TOKEN
  • Check values are correct from Meta Developer Console

❌ "Cannot import name 'X' from pywa.types"

  • Run uv sync to update dependencies
  • PyWA version must be >=3.0.0

❌ "401 Unauthorized" from WhatsApp API

  • Verify your WHATSAPP_TOKEN is current and has proper permissions
  • Check token hasn't expired in Meta Developer Console

❌ Claude Desktop doesn't show tools

  • Check claude_desktop_config.json syntax is valid JSON
  • Ensure file paths are absolute, not relative
  • Restart Claude Desktop after config changes
  • Look for 🔨 hammer icon to confirm connection

❌ "Typing indicator failed"

  • indicate_typing requires a valid message ID from an incoming message
  • Cannot use with arbitrary message IDs - must be from actual WhatsApp messages received

Debug Mode

Enable detailed logging by setting environment variable:

export PYTHONPATH=/path/to/pywa-mcp-server
LOGLEVEL=DEBUG uv run python server.py

Getting Help

License

MIT