Skip to main content
Glama

whatsmcp

Un servidor MCP sin estado en Cloudflare Workers que expone la Z-API WhatsApp REST API como herramientas, servido a través de Streamable HTTP en https://whatsmcp.unfld.dev/mcp.

Las herramientas se generan en tiempo de compilación a partir de postman.json, por lo que la superficie de herramientas sigue la colección en lugar de mantenerse manualmente. Tres meta-herramientas (zapi_list_endpoints, zapi_describe_endpoint, zapi_request) están siempre registradas, por lo que ningún endpoint queda inalcanzable incluso cuando el filtro del conjunto de herramientas reduce lo que se expone.

Configuración inicial

bun install

Crea .dev.vars en la raíz del repositorio (ignorado por git) con tus credenciales de Z-API:

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

ZAPI_INSTANCE_ID y ZAPI_INSTANCE_TOKEN construyen la URL base de la instancia; ZAPI_CLIENT_TOKEN se envía como encabezado Client-Token. MCP_AUTH_TOKEN es el token de portador estático que los clientes deben presentar.

Related MCP server: WA MCP

Ejecución local

bun run dev

Wrangler sirve el Worker en http://localhost:8787. El endpoint de MCP es http://127.0.0.1:8787/mcp. Los clientes deben enviar uno de:

Authorization: Bearer <MCP_AUTH_TOKEN>
Authorization: <MCP_AUTH_TOKEN>

GET /health es público y devuelve { "ok": true, "name": "whatsmcp" }.

Scripts

Script

Qué hace

bun run generate

Regenera src/generated/endpoints.ts a partir de la colección de Postman

bun run dev

Ejecuta el Worker localmente con wrangler dev

bun run deploy

Despliega en Cloudflare

bun run typecheck

tsc --noEmit

bun test

Ejecuta la suite de pruebas

bun run cf-typegen

Regenera worker-configuration.d.ts a partir de wrangler.jsonc + .dev.vars

Vuelve a ejecutar bun run cf-typegen después de cambiar los bindings o las variables en wrangler.jsonc.

Configuración

ZAPI_TOOLSETS (una variable simple en wrangler.jsonc, valor predeterminado *) selecciona qué categorías de Z-API se registran como herramientas, por ejemplo instance,messages,groups. Las meta-herramientas ignoran este filtro.

Despliegue

Los secretos no se almacenan en wrangler.jsonc. Configúralos una vez por entorno:

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

El dominio personalizado whatsmcp.unfld.dev está declarado en wrangler.jsonc y Cloudflare lo aprovisiona en el primer despliegue.

Conexión de un cliente

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

Se aceptan tanto Authorization: Bearer <MCP_AUTH_TOKEN> como la forma sin prefijo Authorization: <MCP_AUTH_TOKEN>. GET /health es público y no requiere autenticación para comprobaciones de disponibilidad.

Related MCP Connectors

  • Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.

  • 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.

  • Hosted MCP server for your own WhatsApp accounts: messages, contacts, groups, channels, calls.

  • Your own WhatsApp as an MCP server: read, search and send from any MCP client.

Related MCP Servers

  • F
    license
    Not graded
    quality
    Not graded
    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.
    12 npm
    -
  • F
    license
    Not graded
    quality
    B
    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.
    23
    -
  • A
    license
    Not graded
    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.
    11 npm
    MIT