Green API WhatsApp

com.green-apiPublished by green-api.comOfficial publisherv0.1.2Updated Oct 26, 2026

MCP gateway for WhatsApp via Green API: messaging, contacts, groups and instance management.

VerifiedStreamable HTTPWeb executableProductivity & WorkflowCommunication & Collaboration

Overview

AI-generated overview

Green API WhatsApp gateway that lets an assistant send and manage WhatsApp messages, contacts, groups and instances through a hosted endpoint.

What you can do
  • Send, forward, edit and delete WhatsApp messages, files by URL or upload, locations, contacts and polls
  • Read chat history, recent incoming and outgoing messages, and mark chats as read
  • Look up contacts, avatars, contact and group info, and check whether a number has WhatsApp
  • Create groups, fetch group data, add or remove participants, and manage admins
  • Manage instances: state, settings, QR authorization, connect, disconnect, reboot, logout, and partner-level create, list and delete
  • Poll or acknowledge incoming notifications from the queue
When to use it
Useful when an assistant should operate a WhatsApp account through Green API, for example answering or sending customer messages, running group administration, or monitoring incoming notifications from a chat client.
Requirements
Remote endpoint at mcp.green-api.com over streamable HTTP. Requires a Green API instance ID and API token, sent as the X-Instance-Id and X-Api-Token headers. The project also offers a self-hosted Go binary with YAML or environment configuration and stdio, SSE or HTTP transports.
Before you install
The instance ID and token grant control of a real WhatsApp account, so treat both headers as secrets. Many tools send, edit, delete, forward or mark messages as read, and group and instance tools change or remove data, including deleting instances. Message content and contacts pass through Green API as a third party. Settings tools can change webhooks and proxy configuration.

Installation

In SourceWeft

  1. Open Green API WhatsApp in the dashboard and add it to a workspace.
  2. Connect Custom headers credentials. They are stored privately and never shown on public pages.
  3. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/com.green-api%2Fwhatsapp/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "green-api-whatsapp": {
      "type": "http",
      "url": "https://mcp.green-api.com/mcp",
      "headers": {
        "X-Instance-Id": "<VALUE>",
        "X-Api-Token": "<VALUE>"
      }
    }
  }
}

README

green-api-mcp-gateway

[License: MIT] [Go Version] [release] [Protocol: MCP] [Go Report Card]

Support Links

[Support] [Support] [Support]

Guides & News

[Guides] [News] [News]


MCP gateway for GREEN-API WhatsApp. Lets AI agents (Claude Desktop, OpenClaw, Cursor, and others) send messages, manage instances, and receive notifications via WhatsApp using the Model Context Protocol.

What it does

Send text messages, files by URL, locations, contacts, polls. Forward and edit messages. Manage groups (create, fetch data, add/remove participants). Check phone numbers for WhatsApp, fetch contacts and their info. Get instance state and settings, QR code for authorization. Receive incoming notifications via polling or an HTTP receiver. Partner API for creating/deleting instances. Multi-instance support in a single gateway. Prompt templates for common scenarios (customer support, broadcasts). Prometheus metrics and OpenTelemetry.

Instructions for connecting the MCP server can be found on our website

Architecture

Clean Architecture (Ports & Adapters):

cmd/server/main.go                    — entry point, DI wiringinternal/  domain/                             — business entities, errors, constants (zero dependencies)  application/                        — ports (interfaces)  infrastructure/    auth.go                           — CredentialManager (in-memory credential store)    config/config.go                  — YAML + env configuration    greenapi/client.go                — WhatsApp client via Go SDK    mcp/      server.go                       — MCP server (stdio/sse)      tools.go                        — MCP tools registration      resources.go                    — MCP resources      prompts.go                      — MCP prompts    webhook/      bridge.go                       — polling bridge      receiver.go                     — HTTP receiver

Build

bash
go build -o green-api-mcp-gateway ./cmd/server

Requires Go 1.25+.

Transports & endpoints

The server supports four transports, selected via server.transport (or the GREEN_API_TRANSPORT env var):

TransportEndpoints (relative to host:port)Use case
stdiostdin/stdoutLocal CLIs (Claude Desktop, Cursor) launching the binary.
sseGET / (stream) + POST /messageLegacy MCP clients (SSE only).
httpPOST/GET /mcpStreamable HTTP (MCP 2025-03-26+) — preferred for new clients.
hybrid/sse + /message and /mcp on one portPublic server: serves both legacy SSE and Streamable HTTP.

All HTTP-based transports also expose:

  • GET /health, GET /healthz — health probes (no auth)
  • GET /favicon.ico, GET /favicon.png — GREEN-API icon

When auth.mode: proxy is enabled, the OAuth 2.0 PKCE endpoints are added too:

  • GET /.well-known/oauth-authorization-server — RFC 8414 metadata
  • GET /.well-known/oauth-protected-resource — RFC 9728 metadata
  • GET /authorize — browser-facing authorization form
  • POST /token — token exchange

Configuration

Via YAML

yaml
server:  transport: stdio   # stdio | sse | http | hybrid  port: 8090
auth:  mode: config       # config | proxy  cache_ttl: 300     # seconds (proxy mode only)
green_api:  instances:    - id: 1101000001      api_token: "YOUR_TOKEN"      api_url: "https://api.green-api.com"
webhook:  mode: polling  polling_timeout: 20
rate_limit:  requests_per_second: 10  burst: 20
logging:  level: info  format: text

Via environment variables

Environment variables take precedence over the YAML config:

The variables below cover both deployment modes. Credentials variables (GREEN_API_INSTANCE_ID, GREEN_API_TOKEN, GREEN_API_URL) apply only to local stdio runs with auth.mode: config. For HTTP transports (sse on /sse + /message, http on /mcp, or hybrid) use auth.mode: proxy instead — credentials arrive in HTTP headers or via the built-in OAuth flow and the env credentials are ignored.

  • GREEN_API_INSTANCE_ID — instance ID
  • GREEN_API_TOKEN — API token
  • GREEN_API_URL — API base URL (defaults to https://api.green-api.com)
  • GREEN_API_TRANSPORT — transport: stdio, sse, http, or hybrid
  • GREEN_API_PORT — HTTP port (defaults to 8090)
  • GREEN_API_BASE_URL — public base URL (used for OAuth issuer/redirects, e.g. https://mcp.example.com)
  • GREEN_API_WIDGET_DOMAIN — unique widget origin for ChatGPT Apps submission metadata (defaults to GREEN_API_BASE_URL, then https://mcp.green-api.com)
  • GREEN_API_AUTH_MODE — config or proxy
  • GREEN_API_AUTH_CACHE_TTL — proxy-auth credential cache TTL (seconds)
  • GREEN_API_WEBHOOK_MODE — polling or receiver
  • LOG_LEVEL — log level
  • LOG_FORMAT — text or json

Run

bash
# With environment variablesexport GREEN_API_INSTANCE_ID=1101000001export GREEN_API_TOKEN=your_token./green-api-mcp-gateway
# With a config file./green-api-mcp-gateway --config config.yaml

Integration

Claude Desktop (local stdio)

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "whatsapp": {      "command": "/path/to/green-api-mcp-gateway",      "args": ["--config", "/path/to/config.yaml"]    }  }}

OpenClaw

yaml
mcp:  servers:    - name: whatsapp      command: /path/to/green-api-mcp-gateway      args: ["--config", "/path/to/config.yaml"]

Docker

bash
docker build -t green-api-mcp-gateway .
docker run --rm -i \  -e GREEN_API_INSTANCE_ID=1101000001 \  -e GREEN_API_TOKEN=your_token \  green-api-mcp-gateway

MCP Tools

Messaging

Link to documentation

  • whatsapp_send_message — text message
  • whatsapp_send_file — file by URL
  • whatsapp_send_location — location
  • whatsapp_send_contact — contact (vCard)
  • whatsapp_send_poll — poll
  • whatsapp_forward_messages — forward
  • whatsapp_edit_message — edit
  • whatsapp_delete_message — delete

Instance

Link to documentation

  • whatsapp_get_state — authorization state
  • whatsapp_get_settings — current settings
  • whatsapp_set_settings — update settings
  • whatsapp_get_qr — authorization QR code
  • whatsapp_connect — connect instance
  • whatsapp_disconnect — disconnect instance

Contacts

Link to documentation

  • whatsapp_get_contacts — contact list
  • whatsapp_get_contact_info — contact information
  • whatsapp_check_whatsapp — phone number check

Groups

Link to documentation

  • whatsapp_create_group — create a group
  • whatsapp_get_group_data — group data
  • whatsapp_add_group_participant — add a participant
  • whatsapp_remove_group_participant — remove a participant
  • whatsapp_leave_group — leave a group

Notifications

Link to documentation

  • whatsapp_receive_notification — receive an incoming notification (long-poll)

Partner API

Link to documentation

  • whatsapp_create_instance — create an instance
  • whatsapp_delete_instance — delete an instance
  • whatsapp_get_instances — list instances

MCP Resources

  • whatsapp://instance/{id}/state — instance state
  • whatsapp://instance/{id}/settings — instance settings

MCP Prompts

  • whatsapp_customer_support — template for customer support
  • whatsapp_broadcast — template for broadcast messaging

Dependencies

Development

bash
go test ./...gofmt -w .GOOS=linux GOARCH=amd64 go build -o green-api-mcp-gateway-linux ./cmd/server

License

MIT — see LICENSE.

Source: README.md at commit 23ceece

Tools

41

whatsapp_add_group_participant

Add Group Participant

Add a participant to a WhatsApp group

Parametersgroup_idrequiredinstance_idrequiredparticipant_chat_idrequired

whatsapp_check_whatsapp

Check WhatsApp Number

Check whether a phone number has a WhatsApp account

Parametersinstance_idrequiredphone_numberrequired

whatsapp_connect

Connect Instance

Connect a WhatsApp instance. Call this before using other tools. Validates credentials via getStateInstance.

Parametersapi_urlapi_tokenrequiredinstance_idrequired

whatsapp_create_group

Create Group

Create a WhatsApp group

Parameterschat_idsrequiredgroup_namerequiredinstance_idrequired

whatsapp_create_instance

Create Partner Instance

Create a new WhatsApp instance via the GREEN-API Partner API

Parameterspartner_tokenrequired

whatsapp_delete_instance

Delete Partner Instance

Delete a WhatsApp instance via the GREEN-API Partner API

Parametersinstance_idrequiredpartner_tokenrequired

whatsapp_delete_message

Delete Message

Delete a message

Parameterschat_idrequiredid_messagerequiredinstance_idrequired

whatsapp_delete_notification

Delete Notification

Delete a notification from the queue (acknowledge receipt)

Parametersreceipt_idrequiredinstance_idrequired

whatsapp_disconnect

Disconnect Instance

Disconnect a WhatsApp instance and remove credentials from the session

Parametersinstance_idrequired

whatsapp_edit_message

Edit Message

Edit a previously sent message

Parameterschat_idrequiredmessagerequiredid_messagerequiredinstance_idrequired

whatsapp_forward_messages

Forward Messages

Forward messages to another chat

Parameterschat_idrequiredmessagesrequiredinstance_idrequiredchat_id_fromrequired

whatsapp_get_authorization_code

Get Authorization Code

Get an authorization code for sign-in by phone number

Parametersinstance_idrequiredphone_numberrequired

whatsapp_get_chat_history

Get Chat History

Get chat message history. Use a small 'count' (default 50, max 100) to keep responses focused.

Parameterscountchat_idrequiredinstance_idrequired

whatsapp_get_contact_avatar

Get Contact Avatar

Get the avatar of a contact or group

Parameterschat_idrequiredinstance_idrequired

whatsapp_get_contact_info

Get Contact Info

Get information about a contact or group

Parameterschat_idrequiredinstance_idrequired

whatsapp_get_contacts

Get Contacts

Get the contact list

Parametersinstance_idrequired

whatsapp_get_group_data

Get Group Data

Get group data (members, name, invite link)

Parametersgroup_idrequiredinstance_idrequired

whatsapp_get_instances

List Partner Instances

List all partner instances via the GREEN-API Partner API

Parameterspartner_tokenrequired

whatsapp_get_message

Get Message

Get a message by ID

Parameterschat_idrequiredid_messagerequiredinstance_idrequired

whatsapp_get_qr

Get QR Code

Get the QR code for instance authorization. The result contains the QR as an image and a qrLink URL to an official GREEN-API page with a full-size auto-refreshing QR code. Always include the qrLink in your response as a clickable markdown link so the user can open it in the browser and scan comfortably.

Parametersinstance_idrequired

whatsapp_get_settings

Get Instance Settings

Get instance settings

Parametersinstance_idrequired

whatsapp_get_state

Get Instance State

Get instance state (authorized, notAuthorized, blocked, sleepMode)

Parametersinstance_idrequired

whatsapp_get_wa_settings

Get WhatsApp Account Settings

Get WhatsApp account settings (name, description, etc.)

Parametersinstance_idrequired

whatsapp_last_incoming_messages

Get Recent Incoming Messages

Get recent incoming messages from the last N minutes (default 60, max 1440 = 24 hours).

Parametersminutesinstance_idrequired

whatsapp_last_outgoing_messages

Get Recent Outgoing Messages

Get recent outgoing messages from the last N minutes (default 60, max 1440 = 24 hours).

Parametersminutesinstance_idrequired

whatsapp_leave_group

Leave Group

Leave a WhatsApp group

Parametersgroup_idrequiredinstance_idrequired

whatsapp_logout

Logout Instance

Log out the WhatsApp instance

Parametersinstance_idrequired

whatsapp_read_chat

Mark Chat as Read

Mark chat messages as read

Parameterschat_idrequiredid_messageinstance_idrequired

whatsapp_reboot

Reboot Instance

Reboot the WhatsApp instance

Parametersinstance_idrequired

whatsapp_receive_notification

Receive Notification

Get one notification from the queue (manual polling)

Parametersinstance_idrequired

whatsapp_remove_group_admin

Demote Group Admin

Revoke admin rights from a group member

Parametersgroup_idrequiredinstance_idrequiredparticipant_chat_idrequired

whatsapp_remove_group_participant

Remove Group Participant

Remove a participant from a WhatsApp group

Parametersgroup_idrequiredinstance_idrequiredparticipant_chat_idrequired

whatsapp_send_contact

Send Contact

Send a contact card via WhatsApp

Parameterschat_idrequiredcompanylast_namefirst_nameinstance_idrequiredphone_numberrequired

whatsapp_send_file

Send File by URL

Send a file by URL

Parametersurlrequiredcaptionchat_idrequiredfile_nameinstance_idrequired

whatsapp_send_file_by_upload

Send File

Send a file directly to a chat via multipart upload (no separate URL step)

Parameterscaptionchat_idrequiredfilenamerequiredfile_base64requiredinstance_idrequired

whatsapp_send_location

Send Location

Send a location

Parametersnameaddresschat_idrequiredlatituderequiredlongituderequiredinstance_idrequired

whatsapp_send_message

Send Message

Send a text message via WhatsApp

Parameterschat_idrequiredmessagerequiredinstance_idrequiredlink_previewquoted_message_id

whatsapp_send_poll

Send Poll

Send a poll via WhatsApp

Parameterschat_idrequiredmessagerequiredoptionsrequiredinstance_idrequiredmultiple_answers

whatsapp_set_group_admin

Promote Group Admin

Promote a group member to admin

Parametersgroup_idrequiredinstance_idrequiredparticipant_chat_idrequired

whatsapp_set_settings

Update Instance Settings

Update instance settings (webhooks, proxy, etc.)

Parametersinstance_idrequiredwebhook_urldelay_messagestate_webhookdevice_webhookincoming_webhookoutgoing_webhookwebhook_url_tokenstatus_instance_webhookmark_incoming_messages_readed

whatsapp_upload_file

Upload File

Upload a file to GREEN-API storage and return its URL. Use the returned URL with whatsapp_send_file.

Parametersfilenamerequiredfile_base64requiredinstance_idrequired

Version history

1
  1. v0.1.2LatestSep 16, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts