waha-langchain-mcp
Enables AI agents to interact with a WhatsApp account through a local WAHA (WhatsApp HTTP API) instance, providing tools to manage sessions, list and inspect chats and messages, mark chats read, set typing indicators, take screenshots, send text, images, and files, and check whether phone numbers exist or retrieve profile pictures.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@waha-langchain-mcpsend a WhatsApp message to +15551234567 saying I'm on my way"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
waha-langchain-mcp
MCP server that exposes a local WAHA (WhatsApp HTTP API) instance as tools for LangChain ReAct agents and deep agents.
flowchart LR
subgraph Agent["LangChain process"]
A["ReAct agent"]
D["Deep agent"]
C["MCP client"]
A --> C
D --> C
end
subgraph Server["waha-langchain-mcp (stdio)"]
T["MCP tools"]
W["WahaClient"]
T --> W
end
C -->|"JSON-RPC / stdio"| T
W -->|"HTTP + X-Api-Key"| WAHA["WAHA :3000"]
WAHA <--> WhatsAppFull diagram: docs/architecture/waha-mcp.mmd.
Design decision: docs/decisions/0001-mcp-server-for-waha.md.
Tools
Sessions: waha_status, waha_list_sessions, waha_get_session, waha_get_me,
waha_start_session, waha_stop_session, waha_create_session.
Chats and messages: waha_list_chats, waha_get_chat,
waha_get_chat_messages, waha_mark_chat_read, waha_set_typing,
waha_take_screenshot.
Sending: waha_send_text, waha_send_image, waha_send_file.
Contacts: waha_check_number_exists, waha_get_profile_picture.
Inbound messages are not pushed over MCP. For that, point a WAHA webhook at your application; MCP is request/response only.
Related MCP server: WA MCP
Setup
cd /home/user/Projects/aegra-content/waha-langchain-mcp
uv venv
uv pip install -e ".[examples]"
cp .env.example .envSet WAHA_API_KEY in .env.
The running container was started without --env-file, so WAHA generated a
random key at startup. Read it with:
docker logs waha 2>&1 | grep -A2 "WAHA_API_KEY"To stop rotating keys on restart, run the container with your env file:
docker run --rm -p 3000:3000 --name waha \
--env-file /home/user/Projects/aegra-content/services-waha/.env \
-v /home/user/Projects/aegra-content/services-waha/sessions:/app/.sessions \
devlikeapro/wahaThe dashboard username/password (WAHA_DASHBOARD_*) are basic-auth
credentials for the UI; the MCP server uses WAHA_API_KEY / X-Api-Key.
Verify the server and the live WAHA connection:
uv run python examples/list_tools.pyUse with LangChain
The same MCP tool list feeds both agent types.
ReAct agent:
uv run python examples/react_agent.py "Show my 5 most recent chats"Deep agent:
uv run python examples/deep_agent.py "Summarize my unread chats"mcp is pinned below 2.0 because langchain-mcp-adapters still requires the
1.x SDK.
Both examples spawn python -m waha_mcp over stdio via
langchain_mcp_adapters.client.MultiServerMCPClient. The API key is passed in
the child process environment, never to the model.
Minimal wiring:
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({
"waha": {
"command": "python",
"args": ["-m", "waha_mcp"],
"transport": "stdio",
"env": {"WAHA_BASE_URL": "http://localhost:3000", "WAHA_API_KEY": "..."},
}
})
tools = await client.get_tools()Then create_agent(model, tools) or
create_deep_agent(model=model, tools=tools).
Use with other MCP hosts
Claude Desktop / Cursor style config:
{
"mcpServers": {
"waha": {
"command": "uv",
"args": ["run", "--directory", "/home/user/Projects/aegra-content/waha-langchain-mcp", "waha-mcp"],
"env": {
"WAHA_BASE_URL": "http://localhost:3000",
"WAHA_API_KEY": "<your-key>"
}
}
}
}Streamable HTTP (optional):
WAHA_MCP_TRANSPORT=streamable-http python -m waha_mcpPrint the tool catalog without starting the server:
python -m waha_mcp --prettySecurity
Keep
WAHA_API_KEYin the environment or.env; it is never exposed as a tool.Sending messages is a real side effect. Keep explicit user intent in the agent system prompt and add human approval where the host supports it.
The stdio server has the same filesystem access as the agent process because
waha_send_file/waha_send_imageaccept local paths.
License
MIT. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
WhatsMCP connects Claude and other MCP-compatible AI agents directly to WhatsApp. Send and receive text, images, documents, and voice notes; manage groups (create, add/remove members, promote admins); look up contacts and profiles; follow channels; and read call and message history — all through a standard MCP interface. For voice use cases, WhatsMCP offers SIP-based calling plans (inbound-only, or full inbound/outbound) so AI voice agents can answer and place WhatsApp calls, plus low-latency WebSocket integrations with voice agent providers like ElevenLabs. Multiple WhatsApp accounts can be paired and managed per workspace, with webhook support for real-time inbound message delivery to your own infrastructure.
Drive WhatsApp from any MCP client: pair devices, send text and media, manage contacts and groups.
Read-only WhatsApp MCP for your AI agent: it reads the chats you choose. Try the public demo.
- WhatSyncOAuthapp.whatsync
WhatsApp for Claude, ChatGPT or any AI agent: search, reply and send. Personal or Business API.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables WhatsApp automation through MCP protocol, allowing users to manage sessions, send messages, handle groups/communities, and access contacts through natural language interactions with AI agents.7 npm-
- AlicenseNot gradedqualityCmaintenanceWhatsApp MCP server that exposes messaging, groups, contacts, and profile management as tools and resources for AI agents, supporting Baileys and Meta Cloud API.547 npm26MIT
- AlicenseBqualityBmaintenanceEnables sending messages, images, documents and more on WhatsApp directly from any MCP-compatible AI, with tools for chat management, groups, and webhooks.371MIT
- FlicenseNot gradedqualityDmaintenanceOpenWA MCP server that bridges AI agents to the OpenWA WhatsApp API, exposing 40 tools for sessions, messages, contacts, groups, and webhooks so agents can read and send WhatsApp messages through a self-hosted OpenWA gateway.-