# MCP server

> Connect Zyptos to AI assistants and agents (Cursor, Claude, VS Code, the OpenAI API) with the Model Context Protocol.

Source: https://zyptos.com/docs/mcp

## Overview

Zyptos runs a remote MCP server, so an AI assistant can look up contacts, read conversations and templates, check usage and, if you allow it, send WhatsApp messages from your workspace. It wraps the same [REST API](https://zyptos.com/docs/api), with the same rules: scopes, opt-outs, the 24-hour window and queued sending.

| Setting | Value |
| --- | --- |
| URL | `https://zyptos.com/mcp` |
| Transport | Streamable HTTP (stateless; responses are JSON) |
| Auth | A workspace API key as `Authorization: Bearer zk_live_…` |
| Rate limit | 120 requests per minute per key, shared with the REST API |
| Plans | Pro and Agency; other plans get plan_upgrade_required |

## Create a key

In the app, open `Settings` > `New API key`. Give it only the scopes the assistant needs: for a read-only assistant, leave `messages:send`, `contacts:write` and `broadcasts:write` unchecked. The MCP URL is shown on the same page. Keep the key out of shared config files; the snippets below read it from an environment variable or a prompt where the client supports that.

## Cursor

Add this to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` in a project, set `ZYPTOS_API_KEY` in your environment, then enable the server under Settings > MCP.

mcp.json:

```json
{
  "mcpServers": {
    "zyptos": {
      "url": "https://zyptos.com/mcp",
      "headers": { "Authorization": "Bearer ${env:ZYPTOS_API_KEY}" }
    }
  }
}
```

## Claude Code and Claude Desktop

Claude Code takes the header directly:

Claude Code:

```bash
claude mcp add --transport http zyptos https://zyptos.com/mcp \
  --header "Authorization: Bearer $ZYPTOS_API_KEY"
```

Claude Desktop's custom connectors sign in with OAuth, which Zyptos doesn't offer yet. Use the `mcp-remote` bridge in `claude_desktop_config.json` instead (needs Node.js), then restart Claude Desktop:

claude_desktop_config.json:

```json
{
  "mcpServers": {
    "zyptos": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://zyptos.com/mcp", "--header", "Authorization:${ZYPTOS_AUTH}"],
      "env": { "ZYPTOS_AUTH": "Bearer zk_live_your_key" }
    }
  }
}
```

## VS Code

For GitHub Copilot agent mode, add `.vscode/mcp.json`. VS Code asks for the key once and stores it securely.

.vscode/mcp.json:

```json
{
  "inputs": [{ "type": "promptString", "id": "zyptos-key", "description": "Zyptos API key", "password": true }],
  "servers": {
    "zyptos": {
      "type": "http",
      "url": "https://zyptos.com/mcp",
      "headers": { "Authorization": "Bearer ${input:zyptos-key}" }
    }
  }
}
```

## ChatGPT and the OpenAI API

Custom MCP servers in the ChatGPT app currently support OAuth or no authentication, not API keys, so Zyptos can't be added there yet. You can still give ChatGPT our public docs: ask it to read [https://zyptos.com/llms-full.txt](https://zyptos.com/llms-full.txt). In your own apps, the OpenAI Responses API accepts the key as a header:

OpenAI Responses API:

```python
from openai import OpenAI

client = OpenAI()
resp = client.responses.create(
    model="gpt-5",
    tools=[{
        "type": "mcp",
        "server_label": "zyptos",
        "server_url": "https://zyptos.com/mcp",
        "headers": {"Authorization": f"Bearer {ZYPTOS_API_KEY}"},
        "require_approval": "always",
    }],
    input="How many messages did we send this month, and which templates are approved?",
)
print(resp.output_text)
```

## Other clients

Any client that supports Streamable HTTP and custom headers works. POST JSON-RPC to the URL with `Accept: application/json, text/event-stream`. Each request is independent (no session id), so you can call `tools/list` or `tools/call` directly:

curl:

```bash
curl https://zyptos.com/mcp \
  -H "Authorization: Bearer $ZYPTOS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_usage","arguments":{}}}'
```

## Tools

Tool errors come back as results with `isError: true` and the same error codes as the REST API, so the assistant can explain what went wrong (for example `window_closed` or `opted_out`).

| Tool | Scope | What it does |
| --- | --- | --- |
| `get_workspace` | any key | Returns the Zyptos workspace this API key belongs to (name, plan, status), the key's scopes, and the connected WhatsApp numbers with quality rating and messaging limit. |
| `get_usage` | any key | This calendar month's usage (UTC): messages sent, received and failed, billable messages by Meta pricing category, active conversations, broadcasts created and total contacts. |
| `list_contacts` | `contacts:read` | Lists contacts, newest first. `query` matches name, WhatsApp profile name, phone or email. Filter by tag or opt-out state. Paginated. |
| `get_contact` | `contacts:read` | Gets one contact by id. |
| `create_contact` | `contacts:write` | Creates a contact, or merges into the existing contact with the same phone number (tags are added, not replaced). |
| `update_contact` | `contacts:write` | Updates a contact. Only the fields you pass change; `tags` and `attributes` replace the stored values. Pass null for name or email to clear them. |
| `list_templates` | `templates:read` | Lists WhatsApp message templates synced from Meta, with status, category, language, body text and variable count. Only APPROVED templates can be sent. |
| `list_conversations` | `messages:read` | Lists inbox conversations, most recent activity first, with the contact, unread count and whether the 24-hour window is open (free-text replies are only possible while it is). |
| `list_messages` | `messages:read` | Lists the messages of one conversation, newest first. |
| `get_message` | `messages:read` | Gets one message by id, including its delivery status (queued, sent, delivered, read or failed). |
| `send_text_message` | `messages:send` | Sends a WhatsApp text message to a real customer from the workspace's connected number. Only allowed while the contact's 24-hour customer service window is open (24 hours after their last message); otherwise use send_template_message. The message is queued and its status starts as `queued`. |
| `send_template_message` | `messages:send` | Sends an approved WhatsApp template to a real customer; works outside the 24-hour window. Never sent to contacts who opted out. The message is queued and its status starts as `queued`. |
| `create_broadcast` | `broadcasts:write` | Sends an approved template to many real customers: all contacts, contacts with a tag, or a list of contact ids. Opted-out contacts are skipped. Sends are paced by the broadcast queue and Meta's messaging limit. Variables may use {{name}} and {{phone}}. Needs the broadcasts:write scope. |
| `get_broadcast` | `broadcasts:write` | Gets a broadcast's status and per-status recipient counts (pending, sent, delivered, read, failed, skipped). |

## Safety

- `send_text_message`, `send_template_message` and `create_broadcast` message real customers. Read-only tools are marked with `readOnlyHint`, so most clients ask you to confirm everything else.
- Free text only goes out while the contact's 24-hour window is open, templates never go to opted-out contacts, and every send is queued and paced like sends from the app.
- Use a separate key per assistant so you can see when it was last used and revoke it on its own in Settings.
