Skip to main content
Glama

whatsmcp

一个无状态的 MCP 服务器,运行在 Cloudflare Workers 上,将 Z-API WhatsApp REST API 作为工具暴露,通过 Streamable HTTP 在 https://whatsmcp.unfld.dev/mcp 提供服务。

工具在构建时从 postman.json 生成,因此工具集跟随集合更新,而非手动维护。三个元工具(zapi_list_endpointszapi_describe_endpointzapi_request)始终注册,因此即使工具集过滤缩小了暴露范围,也永远不会出现无法访问的端点。

设置

bun install

在仓库根目录下创建 .dev.vars(已加入 gitignore),填入你的 Z-API 凭据:

MCP_AUTH_TOKEN=...
ZAPI_INSTANCE_ID=...
ZAPI_INSTANCE_TOKEN=...
ZAPI_CLIENT_TOKEN=...

ZAPI_INSTANCE_IDZAPI_INSTANCE_TOKEN 用于构建实例基础 URL;ZAPI_CLIENT_TOKEN 作为 Client-Token 头发送。MCP_AUTH_TOKEN 是客户端必须提供的静态 Bearer 令牌。

Related MCP server: WA MCP

本地运行

bun run dev

Wrangler 在 http://localhost:8787 上提供 Worker 服务。MCP 端点为 http://127.0.0.1:8787/mcp。客户端必须发送以下之一:

Authorization: Bearer <MCP_AUTH_TOKEN>
Authorization: <MCP_AUTH_TOKEN>

GET /health 是公开的,返回 { "ok": true, "name": "whatsmcp" }

脚本

脚本

功能说明

bun run generate

从 Postman 集合重新生成 src/generated/endpoints.ts

bun run dev

使用 wrangler dev 在本地运行 Worker

bun run deploy

部署到 Cloudflare

bun run typecheck

tsc --noEmit

bun test

运行测试套件

bun run cf-typegen

wrangler.jsonc + .dev.vars 重新生成 worker-configuration.d.ts

修改 wrangler.jsonc 中的绑定或变量后,重新运行 bun run cf-typegen

配置

ZAPI_TOOLSETSwrangler.jsonc 中的普通变量,默认值为 *)选择哪些 Z-API 类别注册为工具——例如 instance,messages,groups。元工具忽略此过滤器。

部署

密钥不存储在 wrangler.jsonc 中。每个环境设置一次:

wrangler secret put MCP_AUTH_TOKEN
wrangler secret put ZAPI_INSTANCE_ID
wrangler secret put ZAPI_INSTANCE_TOKEN
wrangler secret put ZAPI_CLIENT_TOKEN
wrangler deploy

whatsmcp.unfld.dev 自定义域名在 wrangler.jsonc 中声明,首次部署时由 Cloudflare 配置。

连接客户端

{
  "mcpServers": {
    "whatsmcp": {
      "url": "https://whatsmcp.unfld.dev/mcp",
      "headers": { "Authorization": "Bearer <MCP_AUTH_TOKEN>" }
    }
  }
}

Authorization: Bearer <MCP_AUTH_TOKEN> 和裸的 Authorization: <MCP_AUTH_TOKEN> 格式均被接受。GET /health 是公开且无需认证的,用于健康检查。

F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    -
    maintenance
    A self-hosted MCP server that connects AI clients to WhatsApp via the WAHA HTTP API. It enables users to manage sessions, search contacts, and send or receive messages and media directly through natural language interfaces.
    21
  • F
    license
    -
    quality
    C
    maintenance
    WhatsApp MCP server that exposes messaging, groups, contacts, and profile management as tools and resources for AI agents, supporting Baileys and Meta Cloud API.
    19
  • A
    license
    -
    quality
    C
    maintenance
    MCP server that connects AI agents to WhatsApp using the multi-device API, enabling messaging, group management, and more as a regular user.
    15
    MIT

View all related MCP servers

Related MCP Connectors

  • Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.

  • MCP server for Gainium — manage trading bots, deals, and balances via AI assistants

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pedrogmbh/whatsmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server