# MCP (Model Context Protocol)

The Model Context Protocol (MCP) is an emerging open standard that lets AI agents securely access tools, APIs, and external data through a unified interface. Instead of writing custom integrations or backend logic, MCP bridges your local or cloud tools directly to the AI model — giving it controlled, structured access to real-world functions.\
When combined with Whapi.Cloud’s WhatsApp API, MCP enables agents to send messages, manage groups, post to channels, or trigger workflows instantly. It transforms WhatsApp automation from code-heavy development into a plug-and-run experience.

In short, MCP brings the missing layer of intelligence between your AI agent and Whapi’s powerful WhatsApp API — letting you build, test, and scale automations faster than ever.

***

### Quick start

Requires Node.js 18+.

Install and run via NPX:

```
npx -y whapi-mcp@latest
```

Or set your Whapi API token and run:

```
# PowerShell
$env:API_TOKEN="YOUR_TOKEN"; npx -y whapi-mcp@latest
```

### Using with MCP clients

* Cursor: add to %USERPROFILE%.cursor\mcp.json

```
{
  "mcpServers": {
    "whapi-mcp": {
      "command": "npx",
      "args": ["-y", "whapi-mcp@latest"],
      "env": { "API_TOKEN": "YOUR_TOKEN" }
    }
  }
}
```

* Claude Desktop: add to %APPDATA%\Claude\claude\_desktop\_config.json (same structure as above).

### Tools

The server exposes tools generated from Whapi OpenAPI. Example:

* sendMessageText (required: to, body)

Example call (pseudo):

```
name: sendMessageText
arguments: { "to": "1234567890@s.whatsapp.net", "body": "Hello" }
```

***

{% hint style="success" %}
**Agent Skill available**

If you use AI coding agents (Cursor, Claude Code, GitHub Copilot, etc.), install the **Whapi Agent Skill** alongside the MCP server. It provides your agent with accurate reference material

```bash
npx skills add Whapi-Cloud/whapi-whatsapp-api-skill
```

[Learn more →](https://support.whapi.cloud/help-desk/ai-tools/agent-skills)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.whapi.cloud/help-desk/ai-tools/mcp-model-context-protocol.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
