loading…
Search for a command to run...
loading…
MCP server for the WhatsApp Cloud API via pywa. Auto-discovers ~100 tools — send messages, manage templates, flows, QR codes, media, and business profile.
MCP server for the WhatsApp Cloud API via pywa. Auto-discovers ~100 tools — send messages, manage templates, flows, QR codes, media, and business profile.
Python MCP pywa License: MIT Tests
Unofficial Model Context Protocol (MCP) server that exposes the pywa WhatsApp Cloud API client as MCP tools.
⚠️ Disclaimer: Unofficial, third-party integration. Not affiliated with, endorsed by, or sponsored by WhatsApp, Meta, or the pywa project.
WhatsApp clientPYWA_MCP_TOOLS env*args exposed via an _args fieldFrom the Meta Business dashboard:
claude mcp add (recommended, zero-install)Runs the server directly from PyPI via uvx — no clone required.
Basic syntax:
claude mcp add [options] <name> -- <command> [args...]
Real example:
claude mcp add --transport stdio --scope user \
--env WHATSAPP_PHONE_ID=<phone-id> \
--env WHATSAPP_TOKEN=<token> \
--env WHATSAPP_WABA_ID=<waba-id> \
--env WHATSAPP_APP_ID=<app-id> \
--env WHATSAPP_APP_SECRET=<app-secret> \
pywa \
-- uvx --from pywa-mcp-server pywa-mcp-server
Scope (--scope / -s):
local (default) — private to this projectuser — across all your projectsproject — committed via .mcp.jsonOther useful commands:
claude mcp list # list all configured servers
claude mcp get pywa # show details + health-check pywa
claude mcp remove pywa # remove from config
claude mcp add-json pywa '<json>' # add via raw JSON string
claude mcp add-from-claude-desktop # import servers from Claude Desktop (Mac/WSL)
claude mcp reset-project-choices # reset approved/rejected project-scoped servers
claude mcp serve # run Claude Code itself as an MCP server
To run from latest git (unreleased changes) instead of PyPI:
... -- uvx --from git+https://github.com/ianaleck/pywa-mcp-server pywa-mcp-server
.mcp.json in the projectcp .mcp.json.example .mcp.json
# edit credentials; .mcp.json is gitignored
Any MCP client that supports stdio works. Add:
{
"mcpServers": {
"pywa": {
"command": "uvx",
"args": ["--from", "pywa-mcp-server", "pywa-mcp-server"],
"env": {
"WHATSAPP_PHONE_ID": "...",
"WHATSAPP_TOKEN": "...",
"WHATSAPP_WABA_ID": "...",
"WHATSAPP_APP_ID": "...",
"WHATSAPP_APP_SECRET": "..."
}
}
}
}
If you're modifying the server, clone and run from source:
git clone https://github.com/ianaleck/pywa-mcp-server.git
cd pywa-mcp-server
uv sync
# then point claude mcp add at:
# uv --directory /absolute/path/to/pywa-mcp-server run pywa-mcp-server
Once connected, you can ask Claude to:
Auto-discovered from pywa.WhatsApp. Full pywa docs at pywa.readthedocs.io.
send_text / send_messagesend_image / send_video / send_audio / send_voicesend_document / send_stickersend_location / send_contactsend_reaction / remove_reactionsend_templatesend_catalog / send_product / send_productsrequest_locationget_template / get_templatescreate_template / update_template / delete_templatecompare_templates (uses _args for second template ID)unpause_templateupsert_authentication_templatemigrate_templatesget_flow / get_flows / get_flow_assets / get_flow_metricscreate_flow / update_flow_json / update_flow_metadatapublish_flow / deprecate_flow / delete_flowmigrate_flowsupload_media / download_mediaget_media_url / get_media_bytes (returns base64-wrapped bytes)delete_mediastream_media returns a Python generator — unusable via MCP. Use get_media_bytes or download_media instead.create_qr_codeget_qr_code / get_qr_codesupdate_qr_codedelete_qr_codeget_business_profile / update_business_profileget_business_accountget_commerce_settings / update_commerce_settingsget_business_phone_number / get_business_phone_numbersget_business_phone_number_settings / update_business_phone_number_settingsupdate_display_nameregister_phone_number / deregister_phone_numberRequires SIP configuration; may be blocked if not enabled.
initiate_call / terminate_callpre_accept_call / accept_call / reject_callget_call_permissionsNote: this server doesn't run a webhook receiver — registration only.
set_app_callback_urloverride_phone_callback_url / override_waba_callback_urldelete_phone_callback_url / delete_waba_callback_urlset_business_public_keyblock_users / unblock_usersget_blocked_usersmark_message_as_readindicate_typingupdate_conversational_automationget_app_access_token| Variable | Required | Notes |
|---|---|---|
WHATSAPP_PHONE_ID / WA_PHONE_ID |
✅ | Phone Number ID |
WHATSAPP_TOKEN / WA_TOKEN |
✅ | System-user or business access token |
WHATSAPP_WABA_ID / WA_BUSINESS_ACCOUNT_ID |
⚠️ | WABA-scoped methods (templates, flows, QR codes) |
WHATSAPP_APP_ID / WA_APP_ID |
⚠️ | Callback registration with APP scope |
WHATSAPP_APP_SECRET / WA_APP_SECRET |
⚠️ | Update validation + APP-scoped callbacks |
PYWA_MCP_TOOLS |
❌ | Comma-separated allowlist. Unset = all minus DEFAULT_SKIP. |
Default: every public pywa method except listen (which blocks indefinitely).
Allowlist: set PYWA_MCP_TOOLS=send_text,get_templates,send_template to expose only those.
listen, on_*, webhook_* register handlers / wait for inbound updates, but no FastAPI/Flask is run. For inbound support, run pywa's webhook in a separate process.stream_media returns a Python generator — unusable via MCP JSON transport. Use get_media_bytes (base64) or download_media (writes to disk, returns path).get_business_account / get_business_phone_number — payment, calling SIP, and other issues cause silent send failures (can_send_message=BLOCKED).| Input | Output |
|---|---|
bytes |
{"_bytes_b64": "...", "size": N} |
pathlib.Path |
string |
datetime / date / time |
ISO 8601 |
timedelta |
seconds (float) |
enum.Enum |
.value |
| dataclass | recursive dict |
pydantic BaseModel |
model_dump(mode="json") |
| other | JSON if serializable, else repr() |
git clone https://github.com/ianaleck/pywa-mcp-server.git
cd pywa-mcp-server
uv sync
# Run tests
uv run pytest tests/
# With coverage
uv run pytest tests/ --cov=main --cov-report=term-missing
37 unit tests, ~70% coverage. Remainder is async server boot (not unit-testable).
This server requires a WhatsApp Cloud API account. You must comply with:
git checkout -b feature/amazing-feature)uv run pytest tests/)MIT — see LICENSE.
Made with ❤️ for the MCP community
⭐ Star this project if you find it useful!
Выполни в терминале:
claude mcp add pywa-mcp-server -- npx Transcripts, channel stats, search
автор: YouTubeAI image generation using various models.
автор: modelcontextprotocolUnified GPU inference API with 30 AI services (LLM, image gen, video, TTS, whisper, embeddings, reranking, OCR) as MCP tools. Pay-per-use via x402 USDC or API k
автор: gpu-bridgeA powerful image generation tool using Google's Imagen 3.0 API through MCP. Generate high-quality images from text prompts with advanced photography, artistic,
автор: hamflxНе уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории media