> ## Documentation Index
> Fetch the complete documentation index at: https://docs.staging.cope-demo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Your AI assistant

> Let Claude, Cursor or another MCP client read your COPE store: orders, payments, refunds, invoices, products, offers, subscriptions and webhook deliveries.

# Your AI assistant

`@copecart/cope-mcp` is an MCP server you run on your own computer. It lets your AI assistant read your COPE store through the public API, using your API key. You can then ask things like *"what did we sell last week?"*, *"did the refund for this order go through?"* or *"which webhook deliveries failed today?"*.

**This version only reads.** It has no tool that creates, changes, refunds or deletes anything.

## Set it up

1. In the COPE dashboard, create an API key under **Settings → API Keys** and choose **Read only**. See [API key integrations](/api-reference/api-key-integrations).
2. Add the server to your MCP client. For Claude Desktop, add this to `claude_desktop_config.json`:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "mcpServers": {
    "cope": {
      "command": "npx",
      "args": ["-y", "@copecart/cope-mcp@0.1.0"],
      "env": { "COPE_API_KEY": "ck_live_..." }
    }
  }
}
```

Pin the version, as in `@0.1.0` above, so an update never runs unless you choose it. The server needs Node.js 20 or later.

| Variable       | Required | Meaning                                                     |
| -------------- | -------- | ----------------------------------------------------------- |
| `COPE_API_KEY` | Yes      | Your live API key (`ck_live_...`)                           |
| `COPE_MCP_PII` | No       | `masked` (default) or `full`. See [Buyer data](#buyer-data) |

## Tools

| Tool                                                | Reads                                                                  |
| --------------------------------------------------- | ---------------------------------------------------------------------- |
| `list_orders`, `get_order`                          | Orders, with line items and payments                                   |
| `list_payments`, `get_payment`                      | Payments. Filter by buyer email, creation date or the date money moved |
| `list_refunds`, `get_refund`                        | Refunds                                                                |
| `list_invoices`, `get_invoice`                      | Invoices                                                               |
| `list_products`, `get_product`                      | Products and their payment plans                                       |
| `list_offers`, `get_offer`                          | Offers sent to buyers                                                  |
| `get_subscription`, `list_subscription_changes`     | A subscription and its price or plan changes                           |
| `list_webhook_endpoints`, `list_webhook_deliveries` | Webhook endpoints and delivery history                                 |

Lists return at most 25 items per page, and each result says how many pages there are.

## Buyer data

Everything the server returns passes through your assistant's AI provider. By default, buyers' names, email addresses, phone numbers, VAT IDs, company names, addresses and card digits are masked, for example `j***@example.com` and `J. D.`. Set `COPE_MCP_PII=full` only if your agreement with that provider covers your buyers' personal data.

## Security

* **Use a read-only key.** It reads what you can and changes nothing, so a leaked key cannot write. A full-access key also works, but it can do more than this server does. Keep the key out of shared configuration files. If it leaks, or you stop using the server, deactivate or delete it in the dashboard; it stops working within 60 seconds.
* The key is sent only to COPE's API and never appears in tool results or error messages.
* Results contain text your buyers and team wrote, such as product descriptions and names. The server labels every result as data, not instructions. Still, review what your assistant proposes before you act on it.
