@stackcurious/polar-mcp
v0.1.0
Published
MCP server for Polar.sh — give your AI agent control of products, checkouts, subscriptions, customers, and license keys
Maintainers
Readme
@stackcurious/polar-mcp
An MCP server that gives AI agents control of Polar.sh — products, checkouts, subscriptions, customers, and license keys. Drop into Claude, Cursor, Windsurf, or any MCP client and let your agent run your billing.
Polar is a developer-first billing platform. This server makes it agent-first.
Why
Polar's web dashboard is excellent for humans. This server is for the other half of your team — your agents — that should be able to ask:
- "Create a checkout link for the Pro tier"
- "How many active subscribers do I have on the Founder plan?"
- "Show me last week's orders sorted by revenue"
- "Validate this license key for me"
…and have it just work, without you opening the dashboard.
Tools
| Tool | Description |
|------|-------------|
| polar_list_products | List products, filtered by org / archived / recurring |
| polar_get_product | Fetch one product including prices and benefits |
| polar_list_subscriptions | List subscriptions, filtered by product / customer / active |
| polar_get_subscription | Fetch one subscription |
| polar_list_orders | List orders (one-time + sub invoices) |
| polar_get_order | Fetch one order |
| polar_list_customers | List customers, filtered by email or query |
| polar_get_customer | Fetch one customer |
| polar_get_customer_state | Snapshot of customer's active subs, granted benefits, recent orders |
| polar_create_checkout | Create a checkout session and return the URL |
| polar_get_checkout | Fetch an existing checkout session |
| polar_validate_license_key | Validate a license key against your org |
| polar_list_license_keys | List license keys issued by your org |
| polar_list_webhook_endpoints | List registered webhook endpoints |
14 tools covering ~80% of operational queries. Refunds, benefit grants, and customer-portal sessions are intentionally excluded from v0.1 — they're either high-blast-radius writes or need a different auth model. File an issue if you need them.
Setup
1. Install
npm install -g @stackcurious/polar-mcp2. Get an Organization Access Token
Polar dashboard → Settings → Developer → Access Tokens → create one with the scopes you need (typically read on everything + write on checkouts:create).
The token starts with polar_oat_…. Keep it server-side.
3. Configure your MCP client
Claude Code:
claude mcp add polar -- env POLAR_ACCESS_TOKEN=polar_oat_your_token npx @stackcurious/polar-mcpClaude Desktop / Cursor / Windsurf — add to your MCP config:
{
"mcpServers": {
"polar": {
"command": "npx",
"args": ["@stackcurious/polar-mcp"],
"env": {
"POLAR_ACCESS_TOKEN": "polar_oat_your_token",
"POLAR_SERVER": "production"
}
}
}
}4. Use it
Restart your MCP client and ask:
- "List my Polar products."
- "Create a checkout for the Pro plan and email me the link."
- "How many active subscribers do I have, and what's my MRR?"
- "Validate license key XYZ-123-ABC."
Sandbox vs Production
Set POLAR_SERVER=sandbox to point at https://sandbox-api.polar.sh/v1 for testing without touching real customers. Defaults to production.
POLAR_SERVER=sandbox POLAR_ACCESS_TOKEN=polar_oat_sandbox npx @stackcurious/polar-mcpRate Limits
Polar allows 500 requests/minute on production, 100/min on sandbox. This server doesn't queue or throttle — if you hit a 429, the SDK throws and the MCP returns the error to your agent. In practice, agent workloads stay well under the limit.
Switching from RevenueCat?
We wrote up the migration: Switch from RevenueCat to Polar in 30 minutes. It pairs with @stackcurious/revenuecat-charts-mcp if you want analytics on the RC side.
Webhooks
This MCP server doesn't receive webhooks (out of MCP scope — the agent is the consumer, not the server). For inbound webhook handling in your own app, use Polar's official standardwebhooks library:
import { Webhook } from "standardwebhooks";
const wh = new Webhook(process.env.POLAR_WEBHOOK_SECRET!);
const payload = wh.verify(rawBody, headers);Requirements
- Node.js 18+
- A Polar Organization Access Token (
polar_oat_…)
Built by
Q — an autonomous AI agent platform. This server is one of a small family of @stackcurious/*-mcp packages giving agents real grip on developer tools. See also: @stackcurious/revenuecat-charts-mcp.
License
MIT.
