whatsapp_add_group_participant
Add Group Participant
Add a participant to a WhatsApp group
group_id必填instance_id必填participant_chat_id必填
com.green-api由 green-api.com 发布官方发布者v0.1.2更新于 Oct 26, 2026
MCP gateway for WhatsApp via Green API: messaging, contacts, groups and instance management.
Green API 的 WhatsApp 网关,让助手通过托管端点收发和管理 WhatsApp 消息、联系人、群组与实例。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/com.green-api%2Fwhatsapp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。把它添加到你客户端的 mcpServers 配置中。
{
"mcpServers": {
"green-api-whatsapp": {
"type": "http",
"url": "https://mcp.green-api.com/mcp",
"headers": {
"X-Instance-Id": "<VALUE>",
"X-Api-Token": "<VALUE>"
}
}
}
}[License: MIT] [Go Version] [release] [Protocol: MCP] [Go Report Card]
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.
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
Clean Architecture (Ports & Adapters):
Requires Go 1.25+.
The server supports four transports, selected via server.transport (or the GREEN_API_TRANSPORT env var):
All HTTP-based transports also expose:
GET /health, GET /healthz — health probes (no auth)GET /favicon.ico, GET /favicon.png — GREEN-API iconWhen 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 exchangeEnvironment 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 to https://api.green-api.com)GREEN_API_TRANSPORT — transport: stdio, sse, http, or hybridGREEN_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 proxyGREEN_API_AUTH_CACHE_TTL — proxy-auth credential cache TTL (seconds)GREEN_API_WEBHOOK_MODE — polling or receiverLOG_LEVEL — log levelLOG_FORMAT — text or jsonAdd to claude_desktop_config.json:
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 — deletewhatsapp_get_state — authorization statewhatsapp_get_settings — current settingswhatsapp_set_settings — update settingswhatsapp_get_qr — authorization QR codewhatsapp_connect — connect instancewhatsapp_disconnect — disconnect instancewhatsapp_get_contacts — contact listwhatsapp_get_contact_info — contact informationwhatsapp_check_whatsapp — phone number checkwhatsapp_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 groupwhatsapp_receive_notification — receive an incoming notification (long-poll)whatsapp_create_instance — create an instancewhatsapp_delete_instance — delete an instancewhatsapp_get_instances — list instanceswhatsapp://instance/{id}/state — instance statewhatsapp://instance/{id}/settings — instance settingswhatsapp_customer_support — template for customer supportwhatsapp_broadcast — template for broadcast messagingMIT — see LICENSE.
来源:README.md,提交 23ceece
Add Group Participant
Add a participant to a WhatsApp group
group_id必填instance_id必填participant_chat_id必填Check WhatsApp Number
Check whether a phone number has a WhatsApp account
instance_id必填phone_number必填Connect Instance
Connect a WhatsApp instance. Call this before using other tools. Validates credentials via getStateInstance.
api_urlapi_token必填instance_id必填Create Group
Create a WhatsApp group
chat_ids必填group_name必填instance_id必填Create Partner Instance
Create a new WhatsApp instance via the GREEN-API Partner API
partner_token必填Delete Partner Instance
Delete a WhatsApp instance via the GREEN-API Partner API
instance_id必填partner_token必填Delete Message
Delete a message
chat_id必填id_message必填instance_id必填Delete Notification
Delete a notification from the queue (acknowledge receipt)
receipt_id必填instance_id必填Disconnect Instance
Disconnect a WhatsApp instance and remove credentials from the session
instance_id必填Edit Message
Edit a previously sent message
chat_id必填message必填id_message必填instance_id必填Forward Messages
Forward messages to another chat
chat_id必填messages必填instance_id必填chat_id_from必填Get Authorization Code
Get an authorization code for sign-in by phone number
instance_id必填phone_number必填Get Chat History
Get chat message history. Use a small 'count' (default 50, max 100) to keep responses focused.
countchat_id必填instance_id必填Get Contact Avatar
Get the avatar of a contact or group
chat_id必填instance_id必填Get Contact Info
Get information about a contact or group
chat_id必填instance_id必填Get Contacts
Get the contact list
instance_id必填Get Group Data
Get group data (members, name, invite link)
group_id必填instance_id必填List Partner Instances
List all partner instances via the GREEN-API Partner API
partner_token必填Get Message
Get a message by ID
chat_id必填id_message必填instance_id必填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.
instance_id必填Get Instance Settings
Get instance settings
instance_id必填Get Instance State
Get instance state (authorized, notAuthorized, blocked, sleepMode)
instance_id必填Get WhatsApp Account Settings
Get WhatsApp account settings (name, description, etc.)
instance_id必填Get Recent Incoming Messages
Get recent incoming messages from the last N minutes (default 60, max 1440 = 24 hours).
minutesinstance_id必填Get Recent Outgoing Messages
Get recent outgoing messages from the last N minutes (default 60, max 1440 = 24 hours).
minutesinstance_id必填Leave Group
Leave a WhatsApp group
group_id必填instance_id必填Logout Instance
Log out the WhatsApp instance
instance_id必填Mark Chat as Read
Mark chat messages as read
chat_id必填id_messageinstance_id必填Reboot Instance
Reboot the WhatsApp instance
instance_id必填Receive Notification
Get one notification from the queue (manual polling)
instance_id必填Demote Group Admin
Revoke admin rights from a group member
group_id必填instance_id必填participant_chat_id必填Remove Group Participant
Remove a participant from a WhatsApp group
group_id必填instance_id必填participant_chat_id必填Send Contact
Send a contact card via WhatsApp
chat_id必填companylast_namefirst_nameinstance_id必填phone_number必填Send File by URL
Send a file by URL
url必填captionchat_id必填file_nameinstance_id必填Send File
Send a file directly to a chat via multipart upload (no separate URL step)
captionchat_id必填filename必填file_base64必填instance_id必填Send Location
Send a location
nameaddresschat_id必填latitude必填longitude必填instance_id必填Send Message
Send a text message via WhatsApp
chat_id必填message必填instance_id必填link_previewquoted_message_idSend Poll
Send a poll via WhatsApp
chat_id必填message必填options必填instance_id必填multiple_answersPromote Group Admin
Promote a group member to admin
group_id必填instance_id必填participant_chat_id必填Update Instance Settings
Update instance settings (webhooks, proxy, etc.)
instance_id必填webhook_urldelay_messagestate_webhookdevice_webhookincoming_webhookoutgoing_webhookwebhook_url_tokenstatus_instance_webhookmark_incoming_messages_readedUpload File
Upload a file to GREEN-API storage and return its URL. Use the returned URL with whatsapp_send_file.
filename必填file_base64必填instance_id必填已满足适用检查项的 100%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
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 receivergo build -o green-api-mcp-gateway ./cmd/serverserver: 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# 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{ "mcpServers": { "whatsapp": { "command": "/path/to/green-api-mcp-gateway", "args": ["--config", "/path/to/config.yaml"] } }}mcp: servers: - name: whatsapp command: /path/to/green-api-mcp-gateway args: ["--config", "/path/to/config.yaml"]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-gatewaygo test ./...gofmt -w .GOOS=linux GOARCH=amd64 go build -o green-api-mcp-gateway-linux ./cmd/server