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

# MCP server for your store (cope-mcp)

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

# MCP server for your store (cope-mcp)

`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

The server is published on npm as [`cope-mcp`](https://www.npmjs.com/package/cope-mcp).

1. In the COPE dashboard, create an API key under **Settings → API Keys** and choose **Read only**. See [API key integrations](https://docs.cope.com/api-reference/api-key-integrations.md).
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.6"],
      "env": { "COPE_API_KEY": "ck_live_..." }
    }
  }
}
```

Pin the version, as in `@0.1.6` 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. Completed orders only, unless you ask for drafts, pending or failed checkouts, each with its latest card decline |
| `list_payments`, `get_payment` | Sale payments. Settled sales only, unless you ask for trial, pending or failed ones. Filter by payment method, buyer email, creation date, the date money moved, or one subscription (its first charge and every renewal) |
| `list_refunds`, `get_refund` | Refunds, and on request the reversals of refunds that failed after they were paid out. Filter by status, payment method or date |
| `list_chargebacks`, `get_chargeback` | Chargebacks, and the reversals that returned their money when a dispute was won, each naming its dispute |
| `get_dispute` | A dispute, by its processor's id: its state, reason and evidence deadline |
| `list_invoices`, `get_invoice` | Invoices |
| `list_products`, `get_product` | Products and their payment plans |
| `get_currencies` | The currencies the store can price a plan in, the one COPE stamps on a plan sent without a currency, and COPE's exchange rate into them from each platform currency the store cannot sell in |
| `list_offers`, `get_offer` | Offers sent to buyers |
| `get_checkout` | A checkout created from your server, and its order once paid |
| `list_subscriptions` | The subscriptions that changed in a time window, oldest change first, for a sync |
| `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. `list_subscriptions` is the exception: up to 100 a page, followed by `next_cursor` while `has_more` is true, and only changes at least 120 seconds old.

## 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, withdrawal and refund periods (for buyers in the EU, the UK and Switzerland, and for buyers elsewhere; `-1` is none) 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.

`send_offer`, `resend_offer` and `cancel_offer` carry no key, because COPE takes none on them; the offer's own state guards them instead. Each is checked against the offer before you are asked, sent once, and never retried. If its answer is lost, your assistant is told to read the offer: a send or a cancel that went through shows in the offer's state, and a resend is not repeated for you, so a lost answer cannot become a second email.

## 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 [MCP for AI shopping agents (cope-sdk/mcp)](https://docs.cope.com/ai-agents/shopping-agents.md#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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.