# 2chat — how to use (mcp.ai)

Connect your 2chat account and use 5 tools for communication straight from your AI agent. Connect with your own API key. 2Chat provides a programmable API for integrating WhatsApp and other text channels, enabling developers to send and receive messages, manage groups, and automate workflows.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p__2chat?ms=1787295720000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `_2chat_create_contact`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/_2chat`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/_2chat/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/_2chat/create/contact` — Tool to create a new contact in your 2Chat account. Use after gathering and verifying first name and at least one contact detail (email, phone, or address).
  - body: { last_name?: string, first_name: string, contact_detail: object[], profile_pic_url?: string }
- `POST https://api.mcp.ai/api/_2chat/get/api/usage/info` — Tool to retrieve current API usage and account information. Use when you need to monitor your remaining quotas before sending more requests.
- `POST https://api.mcp.ai/api/_2chat/list/contacts` — Tool to list all contacts in your 2Chat account. Use when you need to retrieve your contact list after confirming your account connection.
  - body: { page_number?: integer, channel_uuid?: string, results_per_page?: integer }
- `POST https://api.mcp.ai/api/_2chat/list/webhooks` — List all configured webhook subscriptions for WhatsApp and phone call events. Use this when you need to audit, review, or retrieve UUIDs of your active webhook subscriptions. Returns details including
- `POST https://api.mcp.ai/api/_2chat/test/api/key` — Tool to validate your API key and retrieve account info. Use when confirming credentials before performing other operations.

## Example prompts
- "What can I do in 2chat?"
- "Show me a summary of my 2chat account"

## More
- Page: https://mcp.ai/_2chat
- Agent spec (llms.txt): https://mcp.ai/_2chat/llms.txt
- Postman collection: https://mcp.ai/_2chat/postman.json
