Update to Polar
Snapshot Nov 3, 2026 · 19:24 UTC · version 0.2.2
Collection source: downloaded plugin package.
Payment or plan references changed
Skill instructions — Now says: available by listing organizations: call `execute` with `GET /v1/organizations/`, or `organizations_list` where the server exposes one tool per...
Observed in published text. Live prices and checkout terms have not been verified by this change.
Up to 10 plugins free · no card required.
All fields and original values.
Skill instructions
Nov 3, 2026 · 00:14 UTC
available. Try listing products or organizations using MCP tools. **Polar plugin installed:** the plugin already configures the Polar server (`polar`, plus `polar-sandbox` where available). Ask the user to sign in to it, preferring `pola...
Nov 3, 2026 · 19:24 UTC
available by listing organizations: call `execute` with `GET /v1/organizations/`, or `organizations_list` where the server exposes one tool per operation. **Polar plugin installed:** the plugin already configures the Polar server (`polar...
Compare saved observations
Download comparison JSONSKILL.md text changes
− removed · + added
--- before +++ after @@ -14,7 +14,7 @@ ### Step 1: Check MCP Availability -First, check if the Polar MCP server is available. Try listing products or organizations using MCP tools. +First, check if the Polar MCP server is available by listing organizations: call `execute` with `GET /v1/organizations/`, or `organizations_list` where the server exposes one tool per operation. **If MCP tools work:** Skip to Step 3. @@ -22,7 +22,7 @@ ### Step 2: Install Polar MCP -**Polar plugin installed:** the plugin already configures the Polar server (`polar`, plus `polar-sandbox` where available). Ask the user to sign in to it, preferring `polar-sandbox`: in Claude Code with `/mcp`, in Codex with `codex mcp login <server>`, and in ChatGPT when prompted to connect. Then continue with the verification below. +**Polar plugin installed:** the plugin already configures the Polar server (`polar`, plus `polar-sandbox` where available). Ask the user to sign in to it, preferring `polar-sandbox`: in Claude Code with `/mcp`, in Codex with `codex mcp login <server>`, in Cursor or Antigravity from their MCP settings, in Gemini CLI with `/mcp auth <server>`, and in ChatGPT when prompted to connect. Then continue with the verification below. Otherwise, guide the user to install the Polar MCP server based on their environment: @@ -46,9 +46,7 @@ } ``` -After installation, the user must: -1. Restart their editor/CLI -2. Authenticate when prompted (redirects to polar.sh) +For other clients, follow the [Polar MCP guide](https://polar.sh/docs/integrate/mcp). After installing, the user restarts their editor or CLI and signs in when prompted (in Claude Code, run `/mcp` and authenticate). The sandbox server signs in at sandbox.polar.sh and the production server at polar.sh. Once authenticated, verify MCP works by listing organizations. @@ -57,11 +55,8 @@ Ask the user: 1. **Framework**: What framework are you using? - - Next.js (App Router) - - Next.js (Pages Router) - - Express.js - - FastAPI (Python) - - Other + - Next.js (App Router), Express, Hono, Astro, SvelteKit, Remix, TanStack Start, Nuxt, Fastify, Cloudflare Workers, or another TypeScript/JavaScript framework + - Python: there's no integration skill; follow the [Python SDK docs](https://polar.sh/docs/integrate/sdk/python) 2. **Environment**: Start with sandbox or production? - Sandbox (recommended for new setups) @@ -72,22 +67,28 @@ - One-time purchase - Both -### Step 4: Create Organization (if needed) +From here on, use the `polar-sandbox` server's tools for sandbox and the `polar` server's tools for production. If only `polar` is available (as in ChatGPT), create sandbox products in the sandbox dashboard or with the Polar CLI instead. -Use MCP to check if user has an organization. If not, guide them to create one at: +### Step 4: Choose the Organization + +List the organizations with MCP. If there are several, ask which one to use. Note its `id`, `slug` and `default_presentment_currency`. Signing in to the MCP server already asks a user without an organization to create one; without MCP, they can create one at: - Sandbox: https://sandbox.polar.sh/start - Production: https://polar.sh/start ### Step 5: Create First Product -Use MCP to create a test product. Example for subscription: +Create the product with MCP (`POST /v1/products/`). The price must be in the organization's `default_presentment_currency`, and the billing interval is fixed per product. Example for a monthly subscription: +```json +{ + "organization_id": "<organization id from Step 4>", + "name": "Pro Plan", + "recurring_interval": "month", + "prices": [{ "amount_type": "fixed", "price_amount": 2900, "price_currency": "<default_presentment_currency>" }] +} ``` -Create a product with: -- Name: "Pro Plan" -- Monthly price: $29 -- Organization: [user's org] -``` + +Omit `recurring_interval` for a one-time purchase. "Both", or monthly and yearly billing, means separate products. Show the user the server, organization, name, price, currency and interval, and create the product once they confirm. Store the returned product ID for checkout integration. @@ -98,40 +99,46 @@ Before invoking it, make sure the user has these environment variables ready (use whatever loader their framework provides): ```bash -POLAR_ACCESS_TOKEN= # from polar.sh/settings (or sandbox) -POLAR_WEBHOOK_SECRET= # created in Step 7 -POLAR_SERVER=sandbox # omit or set to "production" when going live +POLAR_ACCESS_TOKEN= # organization access token, created below +POLAR_WEBHOOK_SECRET= # created in Step 7 +POLAR_ENVIRONMENT=sandbox # omit or set to "production" when going live ``` +The quickest way to create the access token is the Polar CLI. Install it with `npm install -g @polar-sh/cli`, then ask the user to run: + +```bash +polar auth login --sandbox +token=$(polar auth token --scope checkouts:write --scope customer_sessions:write) && echo "POLAR_ACCESS_TOKEN=$token" >> .env +``` + +`polar auth token` opens the token page in a browser with those scopes preselected, waits for the user to create the token, and prints it, so this saves it to `.env` without showing it. The token belongs to the active organization and its environment: `polar auth whoami --json` shows which one that is, and `polar auth org` changes it. + +Without the CLI, create the token in the sandbox or production dashboard: Settings → Access Tokens → Create token. + Pass along the product ID from Step 5 so checkout links can be tested in Step 8. ### Step 7: Set Up Webhooks -Use the Polar CLI to forward webhooks to the local dev server. It needs no tunnel and no dashboard endpoint. The `polar-testing` skill ("Local Webhook Testing") has the details. +Start the dev server, then follow `polar-testing` ("Local Webhook Testing") to forward webhooks to it with the Polar CLI. It needs no tunnel and no dashboard endpoint: -1. Install the CLI (`npm install -g @polar-sh/cli`) and ask the user to run `polar auth login --sandbox`, which opens a browser. -2. Save the local signing secret without printing it, then restart the dev server: - ```bash - secret=$(polar webhook listen --print-secret) && echo "POLAR_WEBHOOK_SECRET=$secret" >> .env - ``` -3. Start `polar webhook listen <port>/<webhook-path>` in the background, using the path from the route generated in Step 6, and keep it running. -4. Run `polar webhook trigger order.paid`. It prints the handler's response and exits with status 1 when the handler fails. Fix the handler and repeat until it exits with 0. +1. If you skipped it in Step 6, install the CLI and ask the user to run `polar auth login --sandbox`, which opens a browser. +2. Save the local signing secret to `.env` with `polar webhook listen --print-secret`, then restart the dev server. +3. Start `polar webhook listen <port>/<webhook-path>` in the background, using the path from the route generated in Step 6. Pass `--org <id from Step 4>` if the account has several organizations. +4. Run `polar webhook trigger order.paid`. Success is exit 0 with a `Response 2xx` line. On a failure it prints the handler's response and exits with status 1; fix the handler and repeat. If it only says the event was forwarded by your `polar webhook listen` terminal, check the `listen` output. -When deploying, create a webhook endpoint for the public URL with MCP or in the dashboard (Settings → Webhooks), select `order.paid`, `subscription.created` and `subscription.canceled`, and use that endpoint's secret as `POLAR_WEBHOOK_SECRET` in the deployed environment. +When deploying, create a webhook endpoint for the public URL in the dashboard (Settings → Webhooks) or with MCP (`url`, `format: "raw"` and the `events`: `order.paid`, `subscription.created` and `subscription.canceled`). Use that endpoint's secret as `POLAR_WEBHOOK_SECRET` in the deployed environment. The MCP response contains the secret, so tell the user where to copy it rather than repeating it. ### Step 8: Test the Integration -1. Start the dev server. -2. Visit the checkout URL with the product ID from Step 5 (path and query shape come from the route generated in Step 6). -3. Complete checkout using test card: `4242 4242 4242 4242`. -4. Verify that `polar webhook listen` shows `order.paid` with a 2xx status from the handler. -5. Check the success page displays correctly. +1. Visit the checkout URL with the product ID from Step 5 (path and query shape come from the route generated in Step 6). +2. Complete checkout using test card: `4242 4242 4242 4242`. +3. Verify that `polar webhook listen` shows `order.paid` with a 2xx status from the handler. +4. Check the success page displays correctly. ### Step 9: Next Steps Once basic setup works, suggest: -1. **Add customer portal** - Let users manage subscriptions (Recipe 2 in `polar-integration`). -2. **Link to your auth** - Pass `externalCustomerId` in checkout. -3. **Add benefits** - License keys, file downloads, Discord roles. -4. **Go production** - Switch `POLAR_SERVER` from `sandbox` to `production`. +1. **Link to your auth** - Pass `external_customer_id` from the logged-in user when creating checkouts. +2. **Add benefits** - License keys, file downloads, Discord roles. +3. **Go production** - Production is separate from sandbox: set up the organization at polar.sh, re-create the product (it gets a new ID), create a production access token and webhook endpoint, and set `POLAR_ENVIRONMENT=production`. Then submit the organization for review in the dashboard; checkouts are blocked until it can accept payments.
Full technical diff · 1 changed fields
changed /skill_md_contents
"---\nname: setup-polar\ndescription: |\n Interactive onboarding wizard to set up Polar payment integration from scratch. Use this skill when: (1) User wants to \"set up Polar\" or \"integrate Polar\" in their project; (2) User is starting fresh with Polar and needs guided setup; (3) User asks \"how do I get started with Polar\"; (4) User wants to add payments/subscriptions/checkout to their app using Polar; (5) User needs help creating their first Polar product and checkout. This skill walks through MCP installation, authentication, product creation, and generates framework-specific integration code.\n---\n\n# Polar Setup Wizard\n\nInteractive setup guide to get Polar payments working in your project.\n\n## Setup Flow\n\nFollow these steps in order:\n\n### Step 1: Check MCP Availability\n\nFirst, check if the Polar MCP server is available. Try listing products or organizations using MCP tools.\n\n**If MCP tools work:** Skip to Step 3.\n\n**If MCP not available:** Continue to Step 2.\n\n### Step 2: Install Polar MCP\n\n**Polar plugin installed:** the plugin already configures the Polar server (`polar`, plus `polar-sandbox` where available). Ask the user to sign in to it, preferring `polar-sandbox`: in Claude Code with `/mcp`, in Codex with `codex mcp login <server>`, and in ChatGPT when prompted to connect. Then continue with the verification below.\n\nOtherwise, guide the user to install the Polar MCP server based on their environment:\n\n**Claude Code:**\n```bash\n# Production\nclaude mcp add --transport http polar https://mcp.polar.sh/mcp/polar-mcp\n\n# Sandbox (recommended for setup)\nclaude mcp add --transport http polar-sandbox https://mcp.polar.sh/mcp/polar-sandbox\n```\n\n**Cursor** (`.cursor/mcp.json`):\n```json\n{\n \"mcpServers\": {\n \"polar-sandbox\": {\n \"url\": \"https://mcp.polar.sh/mcp/polar-sandbox\"\n }\n }\n}\n```\n\nAfter installation, the user must:\n1. Restart their editor/CLI\n2. Authenticate when prompted (redirects to polar.sh)\n\nOnce authenticated, verify MCP works by listing organizations.\n\n### Step 3: Gather Project Context\n\nAsk the user:\n\n1. **Framework**: What framework are you using?\n - Next.js (App Router)\n - Next.js (Pages Router)\n - Express.js\n - FastAPI (Python)\n - Other\n\n2. **Environment**: Start with sandbox or production?\n - Sandbox (recommended for new setups)\n - Production\n\n3. **Product type**: What are you selling?\n - Subscription (recurring)\n - One-time purchase\n - Both\n\n### Step 4: Create Organization (if needed)\n\nUse MCP to check if user has an organization. If not, guide them to create one at:\n- Sandbox: https://sandbox.polar.sh/start\n- Production: https://polar.sh/start\n\n### Step 5: Create First Product\n\nUse MCP to create a test product. Example for subscription:\n\n```\nCreate a product with:\n- Name: \"Pro Plan\"\n- Monthly price: $29\n- Organization: [user's org]\n```\n\nStore the returned product ID for checkout integration.\n\n### Step 6: Generate Integration Code\n\nHand off to the `polar-integration` skill to generate the Checkout, Customer Portal, and Webhooks endpoints for the framework selected in Step 3. That skill has the canonical, framework-agnostic recipes plus per-framework variations.\n\nBefore invoking it, make sure the user has these environment variables ready (use whatever loader their framework provides):\n\n```bash\nPOLAR_ACCESS_TOKEN= # from polar.sh/settings (or sandbox)\nPOLAR_WEBHOOK_SECRET= # created in Step 7\nPOLAR_SERVER=sandbox # omit or set to \"production\" when going live\n```\n\nPass along the product ID from Step 5 so checkout links can be tested in Step 8.\n\n### Step 7: Set Up Webhooks\n\nUse the Polar CLI to forward webhooks to the local dev server. It needs no tunnel and no dashboard endpoint. The `polar-testing` skill (\"Local Webhook Testing\") has the details.\n\n1. Install the CLI (`npm install -g @polar-sh/cli`) and ask the user to run `polar auth login --sandbox`, which opens a browser.\n2. Save the local signing secret without printing it, then restart the dev server:\n ```bash\n secret=$(polar webhook listen --print-secret) && echo \"POLAR_WEBHOOK_SECRET=$secret\" >> .env\n ```\n3. Start `polar webhook listen <port>/<webhook-path>` in the background, using the path from the route generated in Step 6, and keep it running.\n4. Run `polar webhook trigger order.paid`. It prints the handler's response and exits with status 1 when the handler fails. Fix the handler and repeat until it exits with 0.\n\nWhen deploying, create a webhook endpoint for the public URL with MCP or in the dashboard (Settings → Webhooks), select `order.paid`, `subscription.created` and `subscription.canceled`, and use that endpoint's secret as `POLAR_WEBHOOK_SECRET` in the deployed environment.\n\n### Step 8: Test the Integration\n\n1. Start the dev server.\n2. Visit the checkout URL with the product ID from Step 5 (path and query shape come from the route generated in Step 6).\n3. Complete checkout using test card: `4242 4242 4242 4242`.\n4. Verify that `polar webhook listen` shows `order.paid` with a 2xx status from the handler.\n5. Check the success page displays correctly.\n\n### Step 9: Next Steps\n\nOnce basic setup works, suggest:\n\n1. **Add customer portal** - Let users manage subscriptions (Recipe 2 in `polar-integration`).\n2. **Link to your auth** - Pass `externalCustomerId` in checkout.\n3. **Add benefits** - License keys, file downloads, Discord roles.\n4. **Go production** - Switch `POLAR_SERVER` from `sandbox` to `production`.\n""---\nname: setup-polar\ndescription: |\n Interactive onboarding wizard to set up Polar payment integration from scratch. Use this skill when: (1) User wants to \"set up Polar\" or \"integrate Polar\" in their project; (2) User is starting fresh with Polar and needs guided setup; (3) User asks \"how do I get started with Polar\"; (4) User wants to add payments/subscriptions/checkout to their app using Polar; (5) User needs help creating their first Polar product and checkout. This skill walks through MCP installation, authentication, product creation, and generates framework-specific integration code.\n---\n\n# Polar Setup Wizard\n\nInteractive setup guide to get Polar payments working in your project.\n\n## Setup Flow\n\nFollow these steps in order:\n\n### Step 1: Check MCP Availability\n\nFirst, check if the Polar MCP server is available by listing organizations: call `execute` with `GET /v1/organizations/`, or `organizations_list` where the server exposes one tool per operation.\n\n**If MCP tools work:** Skip to Step 3.\n\n**If MCP not available:** Continue to Step 2.\n\n### Step 2: Install Polar MCP\n\n**Polar plugin installed:** the plugin already configures the Polar server (`polar`, plus `polar-sandbox` where available). Ask the user to sign in to it, preferring `polar-sandbox`: in Claude Code with `/mcp`, in Codex with `codex mcp login <server>`, in Cursor or Antigravity from their MCP settings, in Gemini CLI with `/mcp auth <server>`, and in ChatGPT when prompted to connect. Then continue with the verification below.\n\nOtherwise, guide the user to install the Polar MCP server based on their environment:\n\n**Claude Code:**\n```bash\n# Production\nclaude mcp add --transport http polar https://mcp.polar.sh/mcp/polar-mcp\n\n# Sandbox (recommended for setup)\nclaude mcp add --transport http polar-sandbox https://mcp.polar.sh/mcp/polar-sandbox\n```\n\n**Cursor** (`.cursor/mcp.json`):\n```json\n{\n \"mcpServers\": {\n \"polar-sandbox\": {\n \"url\": \"https://mcp.polar.sh/mcp/polar-sandbox\"\n }\n }\n}\n```\n\nFor other clients, follow the [Polar MCP guide](https://polar.sh/docs/integrate/mcp). After installing, the user restarts their editor or CLI and signs in when prompted (in Claude Code, run `/mcp` and authenticate). The sandbox server signs in at sandbox.polar.sh and the production server at polar.sh.\n\nOnce authenticated, verify MCP works by listing organizations.\n\n### Step 3: Gather Project Context\n\nAsk the user:\n\n1. **Framework**: What framework are you using?\n - Next.js (App Router), Express, Hono, Astro, SvelteKit, Remix, TanStack Start, Nuxt, Fastify, Cloudflare Workers, or another TypeScript/JavaScript framework\n - Python: there's no integration skill; follow the [Python SDK docs](https://polar.sh/docs/integrate/sdk/python)\n\n2. **Environment**: Start with sandbox or production?\n - Sandbox (recommended for new setups)\n - Production\n\n3. **Product type**: What are you selling?\n - Subscription (recurring)\n - One-time purchase\n - Both\n\nFrom here on, use the `polar-sandbox` server's tools for sandbox and the `polar` server's tools for production. If only `polar` is available (as in ChatGPT), create sandbox products in the sandbox dashboard or with the Polar CLI instead.\n\n### Step 4: Choose the Organization\n\nList the organizations with MCP. If there are several, ask which one to use. Note its `id`, `slug` and `default_presentment_currency`. Signing in to the MCP server already asks a user without an organization to create one; without MCP, they can create one at:\n- Sandbox: https://sandbox.polar.sh/start\n- Production: https://polar.sh/start\n\n### Step 5: Create First Product\n\nCreate the product with MCP (`POST /v1/products/`). The price must be in the organization's `default_presentment_currency`, and the billing interval is fixed per product. Example for a monthly subscription:\n\n```json\n{\n \"organization_id\": \"<organization id from Step 4>\",\n \"name\": \"Pro Plan\",\n \"recurring_interval\": \"month\",\n \"prices\": [{ \"amount_type\": \"fixed\", \"price_amount\": 2900, \"price_currency\": \"<default_presentment_currency>\" }]\n}\n```\n\nOmit `recurring_interval` for a one-time purchase. \"Both\", or monthly and yearly billing, means separate products. Show the user the server, organization, name, price, currency and interval, and create the product once they confirm.\n\nStore the returned product ID for checkout integration.\n\n### Step 6: Generate Integration Code\n\nHand off to the `polar-integration` skill to generate the Checkout, Customer Portal, and Webhooks endpoints for the framework selected in Step 3. That skill has the canonical, framework-agnostic recipes plus per-framework variations.\n\nBefore invoking it, make sure the user has these environment variables ready (use whatever loader their framework provides):\n\n```bash\nPOLAR_ACCESS_TOKEN= # organization access token, created below\nPOLAR_WEBHOOK_SECRET= # created in Step 7\nPOLAR_ENVIRONMENT=sandbox # omit or set to \"production\" when going live\n```\n\nThe quickest way to create the access token is the Polar CLI. Install it with `npm install -g @polar-sh/cli`, then ask the user to run:\n\n```bash\npolar auth login --sandbox\ntoken=$(polar auth token --scope checkouts:write --scope customer_sessions:write) && echo \"POLAR_ACCESS_TOKEN=$token\" >> .env\n```\n\n`polar auth token` opens the token page in a browser with those scopes preselected, waits for the user to create the token, and prints it, so this saves it to `.env` without showing it. The token belongs to the active organization and its environment: `polar auth whoami --json` shows which one that is, and `polar auth org` changes it.\n\nWithout the CLI, create the token in the sandbox or production dashboard: Settings → Access Tokens → Create token.\n\nPass along the product ID from Step 5 so checkout links can be tested in Step 8.\n\n### Step 7: Set Up Webhooks\n\nStart the dev server, then follow `polar-testing` (\"Local Webhook Testing\") to forward webhooks to it with the Polar CLI. It needs no tunnel and no dashboard endpoint:\n\n1. If you skipped it in Step 6, install the CLI and ask the user to run `polar auth login --sandbox`, which opens a browser.\n2. Save the local signing secret to `.env` with `polar webhook listen --print-secret`, then restart the dev server.\n3. Start `polar webhook listen <port>/<webhook-path>` in the background, using the path from the route generated in Step 6. Pass `--org <id from Step 4>` if the account has several organizations.\n4. Run `polar webhook trigger order.paid`. Success is exit 0 with a `Response 2xx` line. On a failure it prints the handler's response and exits with status 1; fix the handler and repeat. If it only says the event was forwarded by your `polar webhook listen` terminal, check the `listen` output.\n\nWhen deploying, create a webhook endpoint for the public URL in the dashboard (Settings → Webhooks) or with MCP (`url`, `format: \"raw\"` and the `events`: `order.paid`, `subscription.created` and `subscription.canceled`). Use that endpoint's secret as `POLAR_WEBHOOK_SECRET` in the deployed environment. The MCP response contains the secret, so tell the user where to copy it rather than repeating it.\n\n### Step 8: Test the Integration\n\n1. Visit the checkout URL with the product ID from Step 5 (path and query shape come from the route generated in Step 6).\n2. Complete checkout using test card: `4242 4242 4242 4242`.\n3. Verify that `polar webhook listen` shows `order.paid` with a 2xx status from the handler.\n4. Check the success page displays correctly.\n\n### Step 9: Next Steps\n\nOnce basic setup works, suggest:\n\n1. **Link to your auth** - Pass `external_customer_id` from the logged-in user when creating checkouts.\n2. **Add benefits** - License keys, file downloads, Discord roles.\n3. **Go production** - Production is separate from sandbox: set up the organization at polar.sh, re-create the product (it gets a new ID), create a production access token and webhook endpoint, and set `POLAR_ENVIRONMENT=production`. Then submit the organization for review in the dashboard; checkouts are blocked until it can accept payments.\n"Full snapshot data
{
"description": "Interactive onboarding wizard to set up Polar payment integration from scratch. Use this skill when: (1) User wants to \"set up Polar\" or \"integrate Polar\" in their project; (2) User is starting fresh with Polar and needs guided setup; (3) User asks \"how do I get started with Polar\"; (4) User wants to add payments/subscriptions/checkout to their app using Polar; (5) User needs help creating their first Polar product and checkout. This skill walks through MCP installation, authentication, product creation, and generates framework-specific integration code.\n",
"included_files": [],
"name": "setup-polar",
"skill_md_contents": "---\nname: setup-polar\ndescription: |\n Interactive onboarding wizard to set up Polar payment integration from scratch. Use this skill when: (1) User wants to \"set up Polar\" or \"integrate Polar\" in their project; (2) User is starting fresh with Polar and needs guided setup; (3) User asks \"how do I get started with Polar\"; (4) User wants to add payments/subscriptions/checkout to their app using Polar; (5) User needs help creating their first Polar product and checkout. This skill walks through MCP installation, authentication, product creation, and generates framework-specific integration code.\n---\n\n# Polar Setup Wizard\n\nInteractive setup guide to get Polar payments working in your project.\n\n## Setup Flow\n\nFollow these steps in order:\n\n### Step 1: Check MCP Availability\n\nFirst, check if the Polar MCP server is available by listing organizations: call `execute` with `GET /v1/organizations/`, or `organizations_list` where the server exposes one tool per operation.\n\n**If MCP tools work:** Skip to Step 3.\n\n**If MCP not available:** Continue to Step 2.\n\n### Step 2: Install Polar MCP\n\n**Polar plugin installed:** the plugin already configures the Polar server (`polar`, plus `polar-sandbox` where available). Ask the user to sign in to it, preferring `polar-sandbox`: in Claude Code with `/mcp`, in Codex with `codex mcp login <server>`, in Cursor or Antigravity from their MCP settings, in Gemini CLI with `/mcp auth <server>`, and in ChatGPT when prompted to connect. Then continue with the verification below.\n\nOtherwise, guide the user to install the Polar MCP server based on their environment:\n\n**Claude Code:**\n```bash\n# Production\nclaude mcp add --transport http polar https://mcp.polar.sh/mcp/polar-mcp\n\n# Sandbox (recommended for setup)\nclaude mcp add --transport http polar-sandbox https://mcp.polar.sh/mcp/polar-sandbox\n```\n\n**Cursor** (`.cursor/mcp.json`):\n```json\n{\n \"mcpServers\": {\n \"polar-sandbox\": {\n \"url\": \"https://mcp.polar.sh/mcp/polar-sandbox\"\n }\n }\n}\n```\n\nFor other clients, follow the [Polar MCP guide](https://polar.sh/docs/integrate/mcp). After installing, the user restarts their editor or CLI and signs in when prompted (in Claude Code, run `/mcp` and authenticate). The sandbox server signs in at sandbox.polar.sh and the production server at polar.sh.\n\nOnce authenticated, verify MCP works by listing organizations.\n\n### Step 3: Gather Project Context\n\nAsk the user:\n\n1. **Framework**: What framework are you using?\n - Next.js (App Router), Express, Hono, Astro, SvelteKit, Remix, TanStack Start, Nuxt, Fastify, Cloudflare Workers, or another TypeScript/JavaScript framework\n - Python: there's no integration skill; follow the [Python SDK docs](https://polar.sh/docs/integrate/sdk/python)\n\n2. **Environment**: Start with sandbox or production?\n - Sandbox (recommended for new setups)\n - Production\n\n3. **Product type**: What are you selling?\n - Subscription (recurring)\n - One-time purchase\n - Both\n\nFrom here on, use the `polar-sandbox` server's tools for sandbox and the `polar` server's tools for production. If only `polar` is available (as in ChatGPT), create sandbox products in the sandbox dashboard or with the Polar CLI instead.\n\n### Step 4: Choose the Organization\n\nList the organizations with MCP. If there are several, ask which one to use. Note its `id`, `slug` and `default_presentment_currency`. Signing in to the MCP server already asks a user without an organization to create one; without MCP, they can create one at:\n- Sandbox: https://sandbox.polar.sh/start\n- Production: https://polar.sh/start\n\n### Step 5: Create First Product\n\nCreate the product with MCP (`POST /v1/products/`). The price must be in the organization's `default_presentment_currency`, and the billing interval is fixed per product. Example for a monthly subscription:\n\n```json\n{\n \"organization_id\": \"<organization id from Step 4>\",\n \"name\": \"Pro Plan\",\n \"recurring_interval\": \"month\",\n \"prices\": [{ \"amount_type\": \"fixed\", \"price_amount\": 2900, \"price_currency\": \"<default_presentment_currency>\" }]\n}\n```\n\nOmit `recurring_interval` for a one-time purchase. \"Both\", or monthly and yearly billing, means separate products. Show the user the server, organization, name, price, currency and interval, and create the product once they confirm.\n\nStore the returned product ID for checkout integration.\n\n### Step 6: Generate Integration Code\n\nHand off to the `polar-integration` skill to generate the Checkout, Customer Portal, and Webhooks endpoints for the framework selected in Step 3. That skill has the canonical, framework-agnostic recipes plus per-framework variations.\n\nBefore invoking it, make sure the user has these environment variables ready (use whatever loader their framework provides):\n\n```bash\nPOLAR_ACCESS_TOKEN= # organization access token, created below\nPOLAR_WEBHOOK_SECRET= # created in Step 7\nPOLAR_ENVIRONMENT=sandbox # omit or set to \"production\" when going live\n```\n\nThe quickest way to create the access token is the Polar CLI. Install it with `npm install -g @polar-sh/cli`, then ask the user to run:\n\n```bash\npolar auth login --sandbox\ntoken=$(polar auth token --scope checkouts:write --scope customer_sessions:write) && echo \"POLAR_ACCESS_TOKEN=$token\" >> .env\n```\n\n`polar auth token` opens the token page in a browser with those scopes preselected, waits for the user to create the token, and prints it, so this saves it to `.env` without showing it. The token belongs to the active organization and its environment: `polar auth whoami --json` shows which one that is, and `polar auth org` changes it.\n\nWithout the CLI, create the token in the sandbox or production dashboard: Settings → Access Tokens → Create token.\n\nPass along the product ID from Step 5 so checkout links can be tested in Step 8.\n\n### Step 7: Set Up Webhooks\n\nStart the dev server, then follow `polar-testing` (\"Local Webhook Testing\") to forward webhooks to it with the Polar CLI. It needs no tunnel and no dashboard endpoint:\n\n1. If you skipped it in Step 6, install the CLI and ask the user to run `polar auth login --sandbox`, which opens a browser.\n2. Save the local signing secret to `.env` with `polar webhook listen --print-secret`, then restart the dev server.\n3. Start `polar webhook listen <port>/<webhook-path>` in the background, using the path from the route generated in Step 6. Pass `--org <id from Step 4>` if the account has several organizations.\n4. Run `polar webhook trigger order.paid`. Success is exit 0 with a `Response 2xx` line. On a failure it prints the handler's response and exits with status 1; fix the handler and repeat. If it only says the event was forwarded by your `polar webhook listen` terminal, check the `listen` output.\n\nWhen deploying, create a webhook endpoint for the public URL in the dashboard (Settings → Webhooks) or with MCP (`url`, `format: \"raw\"` and the `events`: `order.paid`, `subscription.created` and `subscription.canceled`). Use that endpoint's secret as `POLAR_WEBHOOK_SECRET` in the deployed environment. The MCP response contains the secret, so tell the user where to copy it rather than repeating it.\n\n### Step 8: Test the Integration\n\n1. Visit the checkout URL with the product ID from Step 5 (path and query shape come from the route generated in Step 6).\n2. Complete checkout using test card: `4242 4242 4242 4242`.\n3. Verify that `polar webhook listen` shows `order.paid` with a 2xx status from the handler.\n4. Check the success page displays correctly.\n\n### Step 9: Next Steps\n\nOnce basic setup works, suggest:\n\n1. **Link to your auth** - Pass `external_customer_id` from the logged-in user when creating checkouts.\n2. **Add benefits** - License keys, file downloads, Discord roles.\n3. **Go production** - Production is separate from sandbox: set up the organization at polar.sh, re-create the product (it gets a new ID), create a production access token and webhook endpoint, and set `POLAR_ENVIRONMENT=production`. Then submit the organization for review in the dashboard; checkouts are blocked until it can accept payments.\n"
}SHA-256 of public snapshot: 0caaa58c574070aa7aac51b5c88d8b6a51214add8ad0f7222f3ca04ade2cf85a