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

# Build with AI Coding Agents

> Use the Dodo Agent Plugin to build integrations with Claude Code, Codex CLI, Cursor, and OpenCode — MCP servers and skills in one install.

The Dodo Agent Plugin wires two MCP servers and eight integration skills into your AI coding agent in a single install. It works with **Claude Code**, **Codex CLI**, **Cursor**, and **OpenCode** — and the MCP servers and skills CLI work with any MCP-compatible client.

<Info>
  **Three primitives, one plugin.** The Agent Plugin bundles everything you need:

  * **API MCP server** — live access to payments, subscriptions, customers, products, refunds, licenses, and usage. Authenticates via browser OAuth (no local keys required).
  * **Knowledge MCP server** — semantic search across all Dodo Payments documentation. No credentials needed.
  * **Eight agent skills** — cheat sheets your agent loads on demand for checkout, subscriptions, webhooks, usage-based billing, credit-based billing, license keys, BillingSDK, and best practices.
</Info>

## Install the plugin

Choose your coding agent below. The install adds both MCP servers and all eight skills automatically.

<AccordionGroup>
  <Accordion title="Claude Code" defaultOpen>
    Install from the marketplace:

    ```bash theme={null}
    claude plugins marketplace add dodopayments/dodo-agent-plugin
    claude plugins install dodopayments@dodopayments
    ```

    The API MCP server uses browser OAuth by default — no keys required at install time. The first time your agent calls a Dodo tool, you'll be prompted to sign in.

    <Card title="Dodo Agent Plugin on GitHub" icon="github" href="https://github.com/dodopayments/dodo-agent-plugin">
      Source code, configuration options, and local development instructions
    </Card>
  </Accordion>

  <Accordion title="Codex CLI">
    Codex installs plugins in two steps: register the marketplace from your shell, then install the plugin from inside the Codex TUI.

    <Steps>
      <Step title="Register the marketplace">
        ```bash theme={null}
        codex plugin marketplace add dodopayments/dodo-agent-plugin
        ```
      </Step>

      <Step title="Install from the Codex TUI">
        Open Codex and run the `/plugins` slash command:

        ```bash theme={null}
        codex
        ```

        Then type `/plugins`, switch to the **Dodo Payments** marketplace, select the **dodopayments** plugin, and choose **Install plugin**.
      </Step>
    </Steps>

    Both MCP servers and all eight skills are registered automatically once the plugin is installed.

    <Note>
      Codex CLI does not have a `codex plugin install` subcommand — plugin installation always happens through the in-TUI `/plugins` flow. See the [official Codex plugins docs](https://developers.openai.com/codex/plugins).
    </Note>

    If you previously added the marketplace and the plugin doesn't appear under `/plugins`, refresh it:

    ```bash theme={null}
    codex plugin marketplace upgrade dodopayments
    ```
  </Accordion>

  <Accordion title="Cursor">
    Manual install — clone the repo into Cursor's local plugins directory:

    ```bash theme={null}
    git clone https://github.com/dodopayments/dodo-agent-plugin.git ~/.cursor/plugins/local/dodo-agent-plugin
    ```

    Restart Cursor. The plugin loads skills from `.claude/skills/` (via Cursor's Claude Code compatibility layer) and MCP servers from `.mcp.json`.

    <Info>
      Cursor marketplace support is coming. For now, use the manual install above.
    </Info>
  </Accordion>

  <Accordion title="OpenCode">
    OpenCode distributes via npm. Add the plugin to your `opencode.json`:

    ```json theme={null}
    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@dodopayments/opencode-plugin"]
    }
    ```

    Restart OpenCode. Both MCP servers (`dodopayments-api`, `dodo-knowledge`) are registered automatically via the plugin's config hook, and the eight skills are auto-discovered from the installed package. No manual `mcp` block required.
  </Accordion>
</AccordionGroup>

<Info>
  Using a different agent? The [MCP Server](/developer-resources/mcp-server) and [Agent Skills](/developer-resources/agent-skills) guides cover Cursor, Claude Desktop, VS Code, Windsurf, Cline, Zed, and any MCP-compatible client.
</Info>

## What you get

Once the plugin is installed, your agent has access to two MCP servers and eight skills.

### MCP servers

| Server             | Purpose                                                                                  | Auth            |
| ------------------ | ---------------------------------------------------------------------------------------- | --------------- |
| `dodopayments-api` | Live API access — payments, subscriptions, customers, products, refunds, licenses, usage | OAuth (browser) |
| `dodo-knowledge`   | Semantic search across all Dodo Payments documentation                                   | None            |

Both servers are wired through `mcp-remote` so they run in any MCP-compatible client.

### Agent skills

| Skill                      | Description                                                          |
| -------------------------- | -------------------------------------------------------------------- |
| `best-practices`           | Comprehensive guide to integrating Dodo Payments with best practices |
| `checkout-integration`     | Creating checkout sessions and payment flows                         |
| `subscription-integration` | Implementing subscription billing flows                              |
| `webhook-integration`      | Setting up and handling webhooks for payment events                  |
| `usage-based-billing`      | Implementing metered billing with events and meters                  |
| `credit-based-billing`     | Credit entitlements, balances, and metered credit deduction          |
| `license-keys`             | Managing license keys for digital products                           |
| `billing-sdk`              | Using BillingSDK React components                                    |

Skills load automatically — your agent picks the right one when it detects a relevant task. See the [Agent Skills documentation](/developer-resources/agent-skills) for the full list and individual installation.

### Try this prompt first

Once the plugin is active, try:

```
Set up Dodo Payments webhook handlers in my Next.js app for payment.succeeded and subscription.active events.
```

Your agent will load the `webhook-integration` skill, use the `dodo-knowledge` MCP to pull the latest payload shapes, and write a handler with signature verification following the Standard Webhooks spec.

## Other supported agents

The Agent Plugin covers Claude Code, Codex CLI, Cursor, and OpenCode. If you use a different agent, connect to Dodo Payments through the MCP servers and skills CLI:

| Agent                    | Fastest path                                        | Also supports                                   |
| ------------------------ | --------------------------------------------------- | ----------------------------------------------- |
| **Claude Code**          | Agent Plugin (one command)                          | MCP server, individual skills                   |
| **Codex CLI**            | Agent Plugin (one command)                          | MCP server                                      |
| **Cursor**               | Agent Plugin (git clone)                            | MCP server config, skills CLI                   |
| **OpenCode**             | Agent Plugin (npm)                                  | MCP server config, skills CLI                   |
| GitHub Copilot (VS Code) | [MCP Server guide](/developer-resources/mcp-server) | [Skills CLI](/developer-resources/agent-skills) |
| Claude Desktop           | [MCP Server guide](/developer-resources/mcp-server) | —                                               |
| Windsurf                 | [MCP Server guide](/developer-resources/mcp-server) | [Skills CLI](/developer-resources/agent-skills) |
| Cline / Zed / others     | [MCP Server guide](/developer-resources/mcp-server) | [Skills CLI](/developer-resources/agent-skills) |

## Docs built for agents

Every Dodo Payments documentation page is available in a format optimized for AI consumption:

* **Full docs index**: [`docs.dodopayments.com/llms.txt`](https://docs.dodopayments.com/llms.txt) — serves the complete documentation index for context ingestion.
* **Plain markdown**: Append `.md` to any documentation URL to get the raw markdown version (e.g., `/api-reference/introduction.md`).
* **Source repository**: [`github.com/dodopayments/dodo-docs`](https://github.com/dodopayments/dodo-docs) — clone for offline indexing.

## What your agent can do

With the plugin installed, your coding agent can:

* **Create checkout sessions and payment links** — [One-time payments](/features/one-time-payment-products) and [subscriptions](/features/subscription)
* **Stand up subscription and usage-based billing end-to-end** — [Subscriptions](/features/subscription), [Usage-based billing](/features/usage-based-billing/introduction), [Credit-based billing](/features/credit-based-billing)
* **Generate Standard Webhooks–compliant handlers** with signature verification — [Webhooks](/developer-resources/webhooks)
* **Wire BillingSDK React components** for pricing tables and subscription management — [BillingSDK](/developer-resources/billingsdk)
* **Author license-key flows** for digital products — [License keys](/features/license-keys)
* **Implement credit-based billing** with entitlements, balances, rollover, and overage — [Credits](/features/credit-based-billing)

## Security and best practices

<Warning>
  **Never commit production API keys.** Use [test mode](/miscellaneous/test-mode-vs-live-mode) during development. The Agent Plugin uses browser OAuth by default — only switch to local API keys if your workflow requires it.
</Warning>

* **Use test mode first.** Sandbox your integration with `dodo_test_...` keys before going live. See [Test Mode vs Live Mode](/miscellaneous/test-mode-vs-live-mode).
* **OAuth is the default.** The Agent Plugin authenticates via browser OAuth (no local secrets). Only use API-key mode if you need it — see the Configure section below.
* **Review agent-generated code.** Always verify webhook handlers include signature verification following the [Standard Webhooks spec](https://standardwebhooks.com/).

## Configure with an API key

By default, the Agent Plugin uses the remote MCP server with browser OAuth — no local credentials needed. If your workflow requires a local API key (e.g., CI environments, headless servers), you can switch to stdio mode.

<AccordionGroup>
  <Accordion title="Local API key mode — Claude Code">
    Open `/plugins` in Claude Code, select **Dodo Payments**, and choose **Configure options**. Fill in:

    * `dodo_api_key` — your `dodo_test_...` or `dodo_live_...` key
    * `dodo_webhook_key` — your webhook signing secret
    * `dodo_environment` — `test_mode` or `live_mode`

    Then edit `.mcp.json` to point `dodopayments-api` at the local stdio server:

    ```json theme={null}
    {
      "mcpServers": {
        "dodopayments-api": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "dodopayments-mcp@latest"],
          "env": {
            "DODO_PAYMENTS_API_KEY": "${user_config.dodo_api_key}",
            "DODO_PAYMENTS_WEBHOOK_KEY": "${user_config.dodo_webhook_key}",
            "DODO_PAYMENTS_ENVIRONMENT": "${user_config.dodo_environment}"
          }
        }
      }
    }
    ```

    Run `/reload-plugins` to apply changes to your current session.
  </Accordion>

  <Accordion title="Local API key mode — OpenCode">
    Declare `dodopayments-api` yourself in `opencode.json` — your entry wins over the plugin's default remote server:

    ```json theme={null}
    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@dodopayments/opencode-plugin"],
      "mcp": {
        "dodopayments-api": {
          "type": "local",
          "command": ["npx", "-y", "dodopayments-mcp@latest"],
          "environment": {
            "DODO_PAYMENTS_API_KEY": "dodo_test_...",
            "DODO_PAYMENTS_WEBHOOK_KEY": "whsec_...",
            "DODO_PAYMENTS_ENVIRONMENT": "test_mode"
          },
          "enabled": true
        }
      }
    }
    ```

    Restart OpenCode to apply.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="MCP Server" icon="terminal" href="/developer-resources/mcp-server">
    Full reference for both MCP servers — all supported clients, configuration, and available tools
  </Card>

  <Card title="Agent Skills" icon="wand-magic-sparkles" href="/developer-resources/agent-skills">
    Individual skill installation, skill reference, and per-agent setup instructions
  </Card>

  <Card title="Sentra IDE Assistant" icon="bolt" href="/developer-resources/sentra">
    AI-powered billing assistant for VS Code, Cursor, and Windsurf — ask, build, and plan in your editor
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Complete OpenAPI reference for all Dodo Payments endpoints
  </Card>
</CardGroup>
