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

# Build with agents

> Choose between the Polar plugin, MCP server, CLI, skills and llms.txt to let a coding agent build and run your Polar integration.

Polar is built so a coding agent can do what you'd do in the dashboard: create products, look up customers, test webhooks and write the integration code. There are five ways to give your agent access. Most setups use the first one.

| Tool | What it gives the agent | Use it when |
| - | - | - |
| [Plugin and skills](https://polar.sh/docs/agents/skills-and-plugins.md) | The MCP servers plus instructions for setup, integration, testing and migration | You use Claude Code, Codex, ChatGPT, Cursor, Gemini CLI or Antigravity |
| [MCP server](https://polar.sh/docs/integrate/mcp.md) | Read and change data in your organization, search the docs | Any MCP client, or you only want data access |
| [Polar CLI](https://polar.sh/docs/integrate/cli/introduction.md) | Terminal commands for every resource, local webhooks, access tokens | The agent runs shell commands, or you script Polar |
| [Agent signup](https://polar.sh/docs/agents/signup.md) | An organization the agent creates on its own and hands to you | You don't have a Polar account yet |
| [`llms.txt`](https://polar.sh/docs/llms.txt) | An index of these docs, and every page as Markdown | The agent only needs to read the docs |

## Set it up in one command

Install the CLI, then let it set up the agents it finds:

```bash Terminal theme={null}
curl -fsSL https://polar.sh/install.sh | bash
polar agent setup
```

`polar agent setup` detects Claude Code, Codex and Cursor. Claude Code and Codex get the Polar plugin. Cursor gets both MCP servers and the skills. See [Skills and plugins](https://polar.sh/docs/agents/skills-and-plugins.md) for what each agent gets and how to install the plugin in other agents.

## Sandbox first

Let your agent work in the [sandbox](https://polar.sh/docs/integrate/sandbox.md) until the integration works. Nothing there moves real money, and its data is separate from production.

* **MCP:** connect `polar-sandbox` (`https://mcp.polar.sh/mcp/polar-sandbox`) next to `polar`, and say "in my Polar sandbox" in your prompts.
* **CLI:** sign in with `polar auth login --sandbox`. Commands act on the active organization's environment.
* **API:** use `https://sandbox-api.polar.sh` and a sandbox access token.

When you're ready, follow [Go live](https://polar.sh/docs/quickstart/go-live.md).

Work in the sandbox until the user says otherwise. Never put an organization access token in client-side code or commit it. Use the app's user ID as `external_id` on customers. Verify webhook signatures. Before calling an MCP operation, check /agents/mcp-operations; before a CLI command, check /integrate/cli/reference.

## What agents can't do

Some actions have no CLI command and no MCP operation. Your agent writes code against the API or SDK for these, or asks you to use the dashboard:

* Creating Checkout Sessions and customer sessions (Customer Portal links). The agent can create Checkout Links.
* Ingesting events. The agent can create meters and read their quantities.
* Creating subscriptions and orders.
* Changing organization settings.
* Uploading files, and validating or activating license keys.
* Disputes, payouts, payout accounts, members and identity verification.

The [MCP operations](https://polar.sh/docs/agents/mcp-operations.md) page lists every operation that is available.

## Two API versions

The SDK and cURL examples in these docs use API version `2026-10`. The MCP server calls `2027-01`, so a few operations, like manual benefit grants, exist only there. CLI commands use `2026-10` and mark the few `2027-01` commands as preview.

## Learn more

| Resource | Description |
| - | - |
| [MCP server](https://polar.sh/docs/integrate/mcp.md) | Connect a client, headless tokens, read-only mode |
| [Skills and plugins](https://polar.sh/docs/agents/skills-and-plugins.md) | What the plugin contains and how to install it |
| [Agent signup](https://polar.sh/docs/agents/signup.md) | How an agent signs up and hands the organization to you |
| [Resource commands](https://polar.sh/docs/integrate/cli/resources.md) | Manage resources from the CLI |
| [Quickstart](https://polar.sh/docs/quickstart/overview.md) | The integration your agent builds, step by step |


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