> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cope.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

`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?"*.

It **only reads** unless you turn changes on. With changes on, it can refund a payment, change a subscription, create, send or cancel an offer, and create or change a product, and it asks **you** to confirm each change before anything happens. See [Making changes](#making-changes).

## 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", "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)    |
| `COPE_MCP_WRITES` | No       | `off` (default) or `on`. See [Making changes](#making-changes) |

## 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.

## Making changes

Changes are off by default. To turn them on, set `COPE_MCP_WRITES` to `on` and use a **full-access** key; a read-only key refuses every change.

| Tool                                         | Changes                                                                                                                                                                                                                                                             |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `refund_payment`                             | Refunds a payment in full or in part. The money goes back to the buyer                                                                                                                                                                                              |
| `cancel_subscription`                        | Cancels a subscription now, or at the end of the period already paid for                                                                                                                                                                                            |
| `pause_subscription`, `resume_subscription`  | Pauses or resumes a subscription's renewals                                                                                                                                                                                                                         |
| `change_subscription_plan`                   | Moves a subscription to another payment plan, from its next billing cycle                                                                                                                                                                                           |
| `change_subscription_price`                  | Changes a subscription's recurring amount, from its next billing cycle                                                                                                                                                                                              |
| `create_offer`                               | Creates an offer: a price for one product made out to one buyer, as a private checkout link you send yourself. Nobody is notified. The same offer asked for twice within a day returns the first one                                                                |
| `send_offer`, `resend_offer`, `cancel_offer` | Emails an offer's link to its buyer the first time, emails it again (at most every 5 minutes), or cancels an active offer (final)                                                                                                                                   |
| `create_product`, `update_product`           | Creates a product (it starts in review, not on sale) or changes a product's name, headline, internal name, URL, refund periods or net-price flag. **An update takes the product off sale and back to review** unless COPE trusts your business with product changes |

**Every change asks you first.** Your MCP client shows exactly what will happen, for example *"Refund 12.50 EUR of payment pay\_… to j\*\*\*@example.com (50.00 EUR is still refundable)?"*. Nothing changes unless you tick the box and accept. If what the question shows changed while you were deciding, you are asked again. If your client cannot show such a question, changes are refused.

**A network problem does not make a change twice.** Each change carries a key derived from what you confirmed and the current state, and COPE applies one key once. If the answer is lost, your assistant is told the change may or may not have been made and should look before asking again. If it was made, the next question shows the new state, so a second refund is always a new question you answer yourself.

## 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.

## Questions about COPE itself

This server reads your store. For questions about how COPE works, also add the docs search MCP server at `https://docs.cope.com/mcp`, which needs no key. See [AI shopping agents](/ai-agents/shopping-agents#give-your-ai-tools-these-docs).

## Security

* **Use a read-only key** unless you turned changes on. It reads what you can and changes nothing, so a leaked key cannot write. 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.
