Green API WhatsApp
MCP gateway for WhatsApp via Green API: messaging, contacts, groups and instance management.
我该使用它吗
质量与安全性
发现(6)
- LOW在 whatsapp_forward_messages 中
- LOW在 whatsapp_reboot 中
- LOW在 whatsapp_get_authorization_code 中
- LOW在 whatsapp_last_incoming_messages 中
- LOW在 whatsapp_last_outgoing_messages 中
- LOW在 whatsapp_remove_group_participant 中
基于对工具定义和协议合规性的自动分析。
上下文开销
这是每次将服务器的工具加载到模型上下文窗口时所消耗的大致 token 数。数值越高,可用于其他任务的注意力就越少。
安装
一键安装
将以下内容添加到你的 `claude_desktop_config.json` 文件中:
{
"mcpServers": {
"whatsapp": {
"url": "https://mcp.green-api.com/mcp"
}
}
}远程端点
https://mcp.green-api.com/mcpstreamable-httphttps://mcp.green-api.com/ssesse它能做什么
工具清单
工具(41)
🟡whatsapp_add_group_participant(group_id, instance_id, participant_chat_id)
Add a participant to a WhatsApp group
输入模式
{
"type": "object",
"properties": {
"group_id": {
"description": "Group ID",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"participant_chat_id": {
"description": "Participant chat ID ([email protected])",
"type": "string"
}
},
"required": [
"instance_id",
"group_id",
"participant_chat_id"
]
}🟢whatsapp_check_whatsapp(instance_id, phone_number)
Check whether a phone number has a WhatsApp account
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"phone_number": {
"description": "Phone number to check",
"type": "number"
}
},
"required": [
"instance_id",
"phone_number"
]
}⚪whatsapp_connect(api_token, api_url, instance_id)
Connect a WhatsApp instance. Call this before using other tools. Validates credentials via getStateInstance.
输入模式
{
"type": "object",
"properties": {
"api_token": {
"description": "Instance API token",
"type": "string"
},
"api_url": {
"description": "API URL (defaults to https://api.green-api.com)",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID (from console.green-api.com)",
"type": "number"
}
},
"required": [
"instance_id",
"api_token"
]
}🟡whatsapp_create_group(chat_ids, group_name, instance_id)
Create a WhatsApp group
输入模式
{
"type": "object",
"properties": {
"chat_ids": {
"description": "Participant list (chat IDs, e.g. [email protected])",
"items": {
"type": "string"
},
"type": "array"
},
"group_name": {
"description": "Group name",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id",
"group_name",
"chat_ids"
]
}🟡whatsapp_create_instance(partner_token)
Create a new WhatsApp instance via the GREEN-API Partner API
输入模式
{
"type": "object",
"properties": {
"partner_token": {
"description": "Partner Token from your GREEN-API dashboard",
"type": "string"
}
},
"required": [
"partner_token"
]
}🔴whatsapp_delete_instance(instance_id, partner_token)
Delete a WhatsApp instance via the GREEN-API Partner API
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "Instance ID to delete",
"type": "number"
},
"partner_token": {
"description": "Partner Token from your GREEN-API dashboard",
"type": "string"
}
},
"required": [
"partner_token",
"instance_id"
]
}🔴whatsapp_delete_message(chat_id, id_message, instance_id)
Delete a message
输入模式
{
"type": "object",
"properties": {
"chat_id": {
"description": "Chat ID",
"type": "string"
},
"id_message": {
"description": "ID of the message to delete",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id",
"chat_id",
"id_message"
]
}🔴whatsapp_delete_notification(instance_id, receipt_id)
Delete a notification from the queue (acknowledge receipt)
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"receipt_id": {
"description": "Notification ID (receiptId from receiveNotification)",
"type": "number"
}
},
"required": [
"instance_id",
"receipt_id"
]
}🔴whatsapp_disconnect(instance_id)
Disconnect a WhatsApp instance and remove credentials from the session
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id"
]
}🔴whatsapp_edit_message(chat_id, id_message, instance_id, message)
Edit a previously sent message
输入模式
{
"type": "object",
"properties": {
"chat_id": {
"description": "Chat ID",
"type": "string"
},
"id_message": {
"description": "ID of the message to edit",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"message": {
"description": "New message text",
"type": "string"
}
},
"required": [
"instance_id",
"chat_id",
"id_message",
"message"
]
}🔴whatsapp_forward_messages(chat_id, chat_id_from, instance_id, messages)
Forward messages to another chat
输入模式
{
"type": "object",
"properties": {
"chat_id": {
"description": "Destination chat ID",
"type": "string"
},
"chat_id_from": {
"description": "Source chat ID",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"messages": {
"description": "Message IDs to forward",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"instance_id",
"chat_id",
"chat_id_from",
"messages"
]
}🟢whatsapp_get_authorization_code(instance_id, phone_number)
Get an authorization code for sign-in by phone number
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"phone_number": {
"description": "Phone number (e.g. 79001234567)",
"type": "string"
}
},
"required": [
"instance_id",
"phone_number"
]
}🟢whatsapp_get_chat_history(chat_id, count, instance_id)
Get chat message history. Use a small 'count' (default 50, max 100) to keep responses focused.
输入模式
{
"type": "object",
"properties": {
"chat_id": {
"description": "Chat ID ([email protected] or [email protected])",
"type": "string"
},
"count": {
"description": "Number of messages (default 50, max 100)",
"type": "number"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id",
"chat_id"
]
}🟢whatsapp_get_contact_avatar(chat_id, instance_id)
Get the avatar of a contact or group
输入模式
{
"type": "object",
"properties": {
"chat_id": {
"description": "Contact or group ID",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id",
"chat_id"
]
}🟢whatsapp_get_contact_info(chat_id, instance_id)
Get information about a contact or group
输入模式
{
"type": "object",
"properties": {
"chat_id": {
"description": "Contact or group ID",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id",
"chat_id"
]
}🟢whatsapp_get_contacts(instance_id)
Get the contact list
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id"
]
}🟢whatsapp_get_group_data(group_id, instance_id)
Get group data (members, name, invite link)
输入模式
{
"type": "object",
"properties": {
"group_id": {
"description": "Group ID (e.g. [email protected])",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id",
"group_id"
]
}🟢whatsapp_get_instances(partner_token)
List all partner instances via the GREEN-API Partner API
输入模式
{
"type": "object",
"properties": {
"partner_token": {
"description": "Partner Token from your GREEN-API dashboard",
"type": "string"
}
},
"required": [
"partner_token"
]
}🟢whatsapp_get_message(chat_id, id_message, instance_id)
Get a message by ID
输入模式
{
"type": "object",
"properties": {
"chat_id": {
"description": "Chat ID",
"type": "string"
},
"id_message": {
"description": "Message ID",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id",
"chat_id",
"id_message"
]
}🟢whatsapp_get_qr(instance_id)
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.
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id"
]
}🟢whatsapp_get_settings(instance_id)
Get instance settings
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id"
]
}🟢whatsapp_get_state(instance_id)
Get instance state (authorized, notAuthorized, blocked, sleepMode)
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id"
]
}🟢whatsapp_get_wa_settings(instance_id)
Get WhatsApp account settings (name, description, etc.)
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id"
]
}🟢whatsapp_last_incoming_messages(instance_id, minutes)
Get recent incoming messages from the last N minutes (default 60, max 1440 = 24 hours).
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"minutes": {
"description": "Time window in minutes (default 60, max 1440)",
"type": "number"
}
},
"required": [
"instance_id"
]
}🟢whatsapp_last_outgoing_messages(instance_id, minutes)
Get recent outgoing messages from the last N minutes (default 60, max 1440 = 24 hours).
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"minutes": {
"description": "Time window in minutes (default 60, max 1440)",
"type": "number"
}
},
"required": [
"instance_id"
]
}🔴whatsapp_leave_group(group_id, instance_id)
Leave a WhatsApp group
输入模式
{
"type": "object",
"properties": {
"group_id": {
"description": "Group ID ([email protected])",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id",
"group_id"
]
}🔴whatsapp_logout(instance_id)
Log out the WhatsApp instance
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id"
]
}🟢whatsapp_read_chat(chat_id, id_message, instance_id)
Mark chat messages as read
输入模式
{
"type": "object",
"properties": {
"chat_id": {
"description": "Chat ID",
"type": "string"
},
"id_message": {
"description": "ID of a specific message (optional)",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id",
"chat_id"
]
}⚪whatsapp_reboot(instance_id)
Reboot the WhatsApp instance
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id"
]
}🟢whatsapp_receive_notification(instance_id)
Get one notification from the queue (manual polling)
输入模式
{
"type": "object",
"properties": {
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id"
]
}🔴whatsapp_remove_group_admin(group_id, instance_id, participant_chat_id)
Revoke admin rights from a group member
输入模式
{
"type": "object",
"properties": {
"group_id": {
"description": "Group ID ([email protected])",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"participant_chat_id": {
"description": "Participant chat ID ([email protected])",
"type": "string"
}
},
"required": [
"instance_id",
"group_id",
"participant_chat_id"
]
}🔴whatsapp_remove_group_participant(group_id, instance_id, participant_chat_id)
Remove a participant from a WhatsApp group
输入模式
{
"type": "object",
"properties": {
"group_id": {
"description": "Group ID",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"participant_chat_id": {
"description": "Participant chat ID ([email protected])",
"type": "string"
}
},
"required": [
"instance_id",
"group_id",
"participant_chat_id"
]
}🔴whatsapp_send_contact(chat_id, company, first_name, instance_id, last_name, ...)
Send a contact card via WhatsApp
输入模式
{
"type": "object",
"properties": {
"chat_id": {
"description": "Chat ID",
"type": "string"
},
"company": {
"description": "Contact company",
"type": "string"
},
"first_name": {
"description": "Contact first name",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"last_name": {
"description": "Contact last name",
"type": "string"
},
"phone_number": {
"description": "Contact phone number",
"type": "number"
}
},
"required": [
"instance_id",
"chat_id",
"phone_number"
]
}🔴whatsapp_send_file(caption, chat_id, file_name, instance_id, url)
Send a file by URL
输入模式
{
"type": "object",
"properties": {
"caption": {
"description": "File caption",
"type": "string"
},
"chat_id": {
"description": "Chat ID",
"type": "string"
},
"file_name": {
"description": "File name",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"url": {
"description": "File URL",
"type": "string"
}
},
"required": [
"instance_id",
"chat_id",
"url"
]
}🔴whatsapp_send_file_by_upload(caption, chat_id, file_base64, filename, instance_id)
Send a file directly to a chat via multipart upload (no separate URL step)
输入模式
{
"type": "object",
"properties": {
"caption": {
"description": "File caption (optional)",
"type": "string"
},
"chat_id": {
"description": "Chat ID ([email protected] or [email protected])",
"type": "string"
},
"file_base64": {
"description": "File contents encoded as base64",
"type": "string"
},
"filename": {
"description": "File name with extension (e.g. photo.jpg)",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id",
"chat_id",
"file_base64",
"filename"
]
}🔴whatsapp_send_location(address, chat_id, instance_id, latitude, longitude, ...)
Send a location
输入模式
{
"type": "object",
"properties": {
"address": {
"description": "Address",
"type": "string"
},
"chat_id": {
"description": "Chat ID",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"latitude": {
"description": "Latitude",
"type": "number"
},
"longitude": {
"description": "Longitude",
"type": "number"
},
"name": {
"description": "Place name",
"type": "string"
}
},
"required": [
"instance_id",
"chat_id",
"latitude",
"longitude"
]
}🔴whatsapp_send_message(chat_id, instance_id, link_preview, message, quoted_message_id)
Send a text message via WhatsApp
输入模式
{
"type": "object",
"properties": {
"chat_id": {
"description": "Chat ID ([email protected] or [email protected])",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"link_preview": {
"description": "Show link previews",
"type": "boolean"
},
"message": {
"description": "Message text",
"type": "string"
},
"quoted_message_id": {
"description": "ID of the message to quote (optional)",
"type": "string"
}
},
"required": [
"instance_id",
"chat_id",
"message"
]
}🔴whatsapp_send_poll(chat_id, instance_id, message, multiple_answers, options)
Send a poll via WhatsApp
输入模式
{
"type": "object",
"properties": {
"chat_id": {
"description": "Chat ID",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"message": {
"description": "Poll question",
"type": "string"
},
"multiple_answers": {
"description": "Allow multiple answers",
"type": "boolean"
},
"options": {
"description": "Answer options (strings)",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"instance_id",
"chat_id",
"message",
"options"
]
}🟡whatsapp_set_group_admin(group_id, instance_id, participant_chat_id)
Promote a group member to admin
输入模式
{
"type": "object",
"properties": {
"group_id": {
"description": "Group ID ([email protected])",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"participant_chat_id": {
"description": "Participant chat ID ([email protected])",
"type": "string"
}
},
"required": [
"instance_id",
"group_id",
"participant_chat_id"
]
}🔴whatsapp_set_settings(delay_message, device_webhook, incoming_webhook, instance_id, mark_incoming_messages_readed, ...)
Update instance settings (webhooks, proxy, etc.)
输入模式
{
"type": "object",
"properties": {
"delay_message": {
"description": "Message send delay (ms)",
"type": "number"
},
"device_webhook": {
"description": "Enable device webhook",
"type": "boolean"
},
"incoming_webhook": {
"description": "Enable incoming message webhook",
"type": "boolean"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
},
"mark_incoming_messages_readed": {
"description": "Mark incoming messages as read",
"type": "boolean"
},
"outgoing_webhook": {
"description": "Enable outgoing message webhook",
"type": "boolean"
},
"state_webhook": {
"description": "Enable state webhook",
"type": "boolean"
},
"status_instance_webhook": {
"description": "Enable instance status webhook",
"type": "boolean"
},
"webhook_url": {
"description": "URL for incoming webhooks",
"type": "string"
},
"webhook_url_token": {
"description": "Token for the webhook URL",
"type": "string"
}
},
"required": [
"instance_id"
]
}🟡whatsapp_upload_file(file_base64, filename, instance_id)
Upload a file to GREEN-API storage and return its URL. Use the returned URL with whatsapp_send_file.
输入模式
{
"type": "object",
"properties": {
"file_base64": {
"description": "File contents encoded as base64",
"type": "string"
},
"filename": {
"description": "File name with extension (e.g. photo.jpg)",
"type": "string"
},
"instance_id": {
"description": "WhatsApp instance ID",
"type": "number"
}
},
"required": [
"instance_id",
"file_base64",
"filename"
]
}社区
证据