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

# MCP server

> Operate Duro from Claude, Cursor, Windsurf, or VS Code. A hosted Model Context Protocol server with 28 tools, scoped keys, and a full audit log.

Duro ships a hosted **Model Context Protocol** server so an AI client can run your billing ops as tool calls: chase failed renewals, switch rails, pull metrics, create plans, all from the editor. It is a thin translation layer that verifies your MCP key, mints a short-lived scoped token, and calls Duro's REST API on your behalf, so every tool call runs through the same auth, tenant isolation, and validation as the API.

<Note>
  **Judges:** connect with the keys below. The test key sees sandbox data, the live key sees live data. Every call is logged in the dashboard under **Developers, then MCP**, with the AI client that made it and the input and response.
</Note>

## Connect

Point any MCP client at **`https://mcp.useduro.com`** and authenticate with an MCP key as a Bearer token. Generate your own in the dashboard (**Developers, then MCP, then New key**), or use the ready-made keys:

```text theme={null}
mcp_test_O5MqWy3dz-w31R8vAdiO_sGYLjL_HzResTCWnlDASyk   (sandbox)
mcp_live_mfpa_Z68NPQHi1V5S1dZlbizMixO4vBIJcn-JdFCK60   (live)
```

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={null}
    claude mcp add --transport http duro https://mcp.useduro.com --header "Authorization: Bearer mcp_live_mfpa_Z68NPQHi1V5S1dZlbizMixO4vBIJcn-JdFCK60"
    ```
  </Tab>

  <Tab title="Cursor">
    `~/.cursor/mcp.json`

    ```json theme={null}
    {
      "mcpServers": {
        "duro": {
          "url": "https://mcp.useduro.com",
          "headers": { "Authorization": "Bearer mcp_live_mfpa_Z68NPQHi1V5S1dZlbizMixO4vBIJcn-JdFCK60" }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Windsurf">
    `~/.codeium/windsurf/mcp_config.json`

    ```json theme={null}
    {
      "mcpServers": {
        "duro": {
          "serverUrl": "https://mcp.useduro.com",
          "headers": { "Authorization": "Bearer mcp_live_mfpa_Z68NPQHi1V5S1dZlbizMixO4vBIJcn-JdFCK60" }
        }
      }
    }
    ```
  </Tab>

  <Tab title="VS Code">
    `.vscode/mcp.json`

    ```json theme={null}
    {
      "servers": {
        "duro": {
          "type": "http",
          "url": "https://mcp.useduro.com",
          "headers": { "Authorization": "Bearer mcp_live_mfpa_Z68NPQHi1V5S1dZlbizMixO4vBIJcn-JdFCK60" }
        }
      }
    }
    ```
  </Tab>
</Tabs>

The key prefix selects the mode: `mcp_test_` keys see sandbox data, `mcp_live_` keys see live data. Revoke any key from the dashboard at any time.

## Tools

Twenty-eight tools. Destructive tools accept `dry_run: true` to preview without executing, and each carries `readOnlyHint` / `destructiveHint` / `idempotentHint` annotations so clients gate confirmation correctly.

| Group         | Tools                                                                                                                                                        |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Billing**   | `list_plans`, `create_plan`, `list_subscriptions`, `create_subscription`, `update_subscription`, `cancel_subscription`, `list_invoices`, `create_promo_code` |
| **Recovery**  | `list_recovery_cases`, `get_recovery_case`, `retry_payment`, `switch_rail`, `send_recovery_message`, `pause_dunning`, `resume_dunning`, `run_recovery_now`   |
| **Customers** | `list_customers`, `get_customer`, `create_customer`, `update_customer`, `list_payment_methods`, `detach_payment_method`                                      |
| **Insights**  | `get_metrics`, `list_transactions`, `list_webhook_deliveries`, `replay_webhook`, `list_events`, `get_workspace`                                              |

## Try it

Ask your agent something like:

> Which subscriptions failed overnight, and can we recover the ones on card?

It calls `list_recovery_cases`, reasons over the failures, and can `retry_payment` or `switch_rail` on the recoverable ones. Or for a monthly review: "Summarize MRR, churn, and recovered revenue this month" runs `get_metrics` and `list_recovery_cases` and writes it up.

## Audit

Every tool invocation is written to the MCP activity log with the tool name, the AI client (provider), status, duration, the input arguments, and the response. Browse and filter it in the dashboard under **Developers, then MCP**.
