streamable-httpMITupdated 1mo ago
--------|--------------------------------------------------|------------------------------------------------------------| | stdio | stdin/stdout | Local CLIs (Claude Desktop, Cursor) launching the binary. | | sse | GET / (stream) + POST /message | Legacy MCP clients (SSE only). | | http | POST/GET /mcp | Streamable HTTP (MCP 2025-03-26+) β preferred for new clients. | | hybrid | /sse + /message and /mcp on one port | Public server: serves both legacy SSE and Streamable HTTP. |
What can you do with Green API WhatsApp?
green-api-mcp-gateway
Support Links
Guides & 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 wiring
internal/
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
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):
| Transport | Endpoints (relative to host:port) |
Use case |
|---|---|---|
stdio |
stdin/stdout | Local CLIs (Claude Desktop, Cursor) launching the binary. |
sse |
GET / (stream) + POST /message |
Legacy MCP clients (SSE only). |
http |
POST/GET /mcp |
Streamable HTTP (MCP 2025-03-26+) β preferred for new clients. |
hybrid |
/sse + /message and /mcp on one port |
Public 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 metadataGET /.well-known/oauth-protected-resourceβ RFC 9728 metadataGET /authorizeβ browser-facing authorization formPOST /tokenβ token exchange
Configuration
Via 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 IDGREEN_API_TOKENβ API tokenGREEN_API_URLβ API base URL (defaults tohttps://api.green-api.com)GREEN_API_TRANSPORTβ transport:stdio,sse,http, orhybridGREEN_API_PORTβ HTTP port (defaults to8090)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 toGREEN_API_BASE_URL, thenhttps://mcp.green-api.com)GREEN_API_AUTH_MODEβconfigorproxyGREEN_API_AUTH_CACHE_TTLβ proxy-auth credential cache TTL (seconds)GREEN_API_WEBHOOK_MODEβpollingorreceiverLOG_LEVELβ log levelLOG_FORMATβtextorjson
Run
# With environment variables
export GREEN_API_INSTANCE_ID=1101000001
export 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:
{
"mcpServers": {
"whatsapp": {
"command": "/path/to/green-api-mcp-gateway",
"args": ["--config", "/path/to/config.yaml"]
}
}
}
OpenClaw
mcp:
servers:
- name: whatsapp
command: /path/to/green-api-mcp-gateway
args: ["--config", "/path/to/config.yaml"]
Docker
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
whatsapp_send_messageβ text messagewhatsapp_send_fileβ file by URLwhatsapp_send_locationβ locationwhatsapp_send_contactβ contact (vCard)whatsapp_send_pollβ pollwhatsapp_forward_messagesβ forwardwhatsapp_edit_messageβ editwhatsapp_delete_messageβ delete
Instance
whatsapp_get_stateβ authorization statewhatsapp_get_settingsβ current settingswhatsapp_set_settingsβ update settingswhatsapp_get_qrβ authorization QR codewhatsapp_connectβ connect instancewhatsapp_disconnectβ disconnect instance
Contacts
whatsapp_get_contactsβ contact listwhatsapp_get_contact_infoβ contact informationwhatsapp_check_whatsappβ phone number check
Groups
whatsapp_create_groupβ create a groupwhatsapp_get_group_dataβ group datawhatsapp_add_group_participantβ add a participantwhatsapp_remove_group_participantβ remove a participantwhatsapp_leave_groupβ leave a group
Notifications
whatsapp_receive_notificationβ receive an incoming notification (long-poll)
Partner API
whatsapp_create_instanceβ create an instancewhatsapp_delete_instanceβ delete an instancewhatsapp_get_instancesβ list instances
MCP Resources
whatsapp://instance/{id}/stateβ instance statewhatsapp://instance/{id}/settingsβ instance settings
MCP Prompts
whatsapp_customer_supportβ template for customer supportwhatsapp_broadcastβ template for broadcast messaging
Dependencies
- mcp-go β MCP SDK
- whatsapp-api-client-golang β GREEN-API Go SDK
Development
go test ./...
gofmt -w .
GOOS=linux GOARCH=amd64 go build -o green-api-mcp-gateway-linux ./cmd/server
License
MIT β see LICENSE.
Install
Add Green API WhatsApp to your client. Pick the one you use.
claude mcp add --transport http green-api-whatsapp https://mcp.green-api.com/mcpcodex mcp add green-api-whatsapp --url https://mcp.green-api.com/mcp{
"mcpServers": {
"green-api-whatsapp": {
"url": "https://mcp.green-api.com/mcp"
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
{
"servers": {
"green-api-whatsapp": {
"type": "http",
"url": "https://mcp.green-api.com/mcp"
}
}
}Add to `.vscode/mcp.json` in your workspace.
{
"mcpServers": {
"green-api-whatsapp": {
"url": "https://mcp.green-api.com/mcp"
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"green-api-whatsapp": {
"serverUrl": "https://mcp.green-api.com/mcp"
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance16/25
- Trust16/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 46 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 6 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint β no local install
Version history
| Versions | Published |
|---|---|
| 0.1.2Latest | Jul 17, 2026 |