Connect both. Prompts in these docs that say “in my Polar sandbox” need
polar-sandbox.
The servers use OAuth. When you connect a client, your browser opens so you can sign in and authorize an organization. You don’t copy an API key into your agent.
Set up with the Polar CLI
The quickest way: the Polar CLI detects Claude Code, Codex and Cursor and sets each one up. Claude Code and Codex get the Polar plugin, which bundles the MCP servers and skills. Cursor gets both servers in~/.cursor/mcp.json and the skills in ~/.cursor/skills.
Terminal
polar agent setup --status to see what’s set up, and --force to reinstall. For other agents, polar agent setup --skills project installs the Polar skills into .agents/skills. Then connect the MCP server as described below. See Skills and plugins for details.
Connect your agent
To connect a client yourself, add both servers.- Cursor
- Claude Code
- ChatGPT
- Claude Desktop
- Codex
- OpenCode
- Other clients
Add the following to Open Cursor’s MCP settings and connect each server to complete authorization.
.cursor/mcp.json in your project, or to ~/.cursor/mcp.json to make Polar available in every project:Headless agents and CI
Where no browser can complete OAuth, send an organization access token as a bearer token instead. The token must belong to the same environment as the server: a sandbox token forpolar-sandbox.
How the tools work
Polar exposes more than a hundred API operations. Instead of sending every operation and its input schema to your agent at the start of every conversation, the server gives it a few tools and lets it write short JavaScript snippets to find and call what it needs:1
Search
The agent calls
search to find the operations for its task, such as “find a customer and check their active subscriptions”, and their exact inputs.2
Execute
The agent calls
execute with code that makes the API calls and returns the result.One tool per operation
Some clients run their own code mode and want plain tools. Add?codemode=false to the server URL, for example https://mcp.polar.sh/mcp/polar-sandbox?codemode=false. The server then exposes one tool per operation instead of search and execute. The docs tools stay the same.
Operations and API version
The MCP server calls the Polar API withPolar-Version: 2027-01, the next API version. Payloads follow the 2027-01 schema, which can differ from the 2026-10 examples elsewhere in these docs.
Operations are named {resource}_{action}, like customers_get_state_external, the same as the CLI resource commands. The full list, the request behind each operation and what isn’t available from the MCP server are on MCP operations.
Not available from the MCP server: creating Checkout Sessions or customer sessions, ingesting events, creating subscriptions or orders, changing organization settings, uploading files, validating license keys, disputes, and access tokens. Use the API or the dashboard for these.
Event subscriptions
Clients that support MCP events, such as ChatGPT, can subscribe to changes in your organization instead of polling. The server implementsevents/list, events/subscribe and events/unsubscribe, and delivers each event to the webhook URL the client registers. Events:
order.created,order.paid,order.refundedsubscription.created,subscription.active,subscription.canceled,subscription.uncanceled,subscription.revoked,subscription.paused,subscription.resumed,subscription.past_duecustomer.created,customer.updated,customer.deleted
Read-only mode
For agents that should look up data but never change it, add?readonly=true to the server URL, for example https://mcp.polar.sh/mcp/polar-mcp?readonly=true. Only GET operations are available, and the agent asks for read-only access when you authorize it.
Telemetry
The server sends one event per tool call to help us improve it, plus a second event carrying the feedback itself when your agent calls thefeedback tool. Each tool-call event carries:
- The tool name, whether the call succeeded, the error type and status code, and the duration.
- Your agent’s name and version, when its client reports them.
- The API operations the call used (for example
GET /v1/products/{id}) with their status codes, and the names of any fields the API rejected (for examplebody.prices.0.price_amount). - The size of the result.
- For
search, the JavaScript engine’s error message when the agent’s script fails. Search runs against the public API specification without network access, so the message cannot contain your data. - The
intentyour agent passes: one sentence on the goal of the call. - What your agent writes in the
feedbacktool.
execute runs), results, field values, request and response bodies, and IDs in URLs.
intent and feedback are the only text your agent writes that the server sends. Every tool asks the agent to write them without customer names, emails or IDs, and before they are sent or logged the server redacts anything that looks like an identifier or a secret, such as emails, IDs, card numbers and API keys. Redaction matches shapes, not meaning, so a name written in plain words can still pass. If your agent handles data you don’t want to share with us at all, opt out.
To opt out, add ?telemetry=false (or 0, no, off) to the server URL, for example https://mcp.polar.sh/mcp/polar-mcp?telemetry=false. The server then ignores intent, which is neither sent nor written to its request logs, and removes the feedback tool. It combines with read-only mode: ?readonly=true&telemetry=false. The server still keeps request logs to operate and secure the service, as the Polar API does.

