Polar MCP server for AI agents

Live

BEARER TOKEN

BILLING

Accounting & Finance

Polar gives your agent billing in your Polar account: read orders, subscriptions, customers, and revenue metrics, then create checkouts, discounts, and products, ingest usage events, issue refunds, and manage license keys.

  • Per-user credentials: each call uses the actual user's access token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Polar
agent · Acme Q3
Run
What was our MRR and revenue last month?
S
polar_metrics_get
230ms
Billing agent
Returned last month's revenue, MRR, order count, and active subscriptions as a monthly series, with amounts in cents.
Sources: Polar metrics
polar
1 metrics report
18:29
Message Claude...

Tools your billing agent reaches for on Polar, scoped per user.

CALL ANY TOOL
60 tools for billing in Polar: read orders, subscriptions, payments, and metrics, create checkouts, products, and discounts, ingest usage events into meters, issue refunds, and manage customers and license keys.
polar_benefit_get
Get benefit
Get a benefit by ID. Returns the benefit with type, description and type-specific properties. Use polar_benefit_get when you have the ID.
Parameters
Name
Type
Required
Description
id
string
Required
Benefit ID (UUID). Example: 8f2c4a9e-1b3d-4e5f-9a7b-6c8d0e1f2a3b.
polar_benefit_grants_list
List benefit grants
polar_checkout_create
Create checkout
polar_checkout_link_delete
Delete checkout link
polar_checkout_link_get
Get checkout link
polar_checkout_links_list
List checkout links
polar_customer_create
Create customer
polar_customer_delete
Delete customer
polar_customer_get_by_external_id
Customer get by external id
polar_customer_meters_list
List customer meters
polar_customer_update
Update customer
polar_customers_list
List customers
polar_discount_create
Create discount
polar_discount_get
Get discount
polar_disputes_list
List disputes
polar_events_ingest
Events ingest
polar_license_key_deactivate
Deactivate license key
polar_license_key_get
Get license key
polar_license_key_update
Update license key
polar_license_keys_list
List license keys
polar_meter_quantities_get
Get meter quantities
polar_order_get
Get order
polar_order_invoice_generate
Generate order invoice
polar_orders_list
List orders
polar_organization_get
Get organization
polar_payments_list
List payments
polar_product_create
Create product
polar_product_get
Get product
polar_product_update
Update product
polar_refunds_list
List refunds

For more tools, view docs.

Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Polar tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["polar"], toolNames: [
    "polar_metrics_get",
    "polar_customer_state_get",
    "polar_checkout_create"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Show last month's MRR, check this customer's subscription state, and create a checkout for the annual plan" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["polar"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Show last month's MRR, check this customer's subscription state, and create a checkout for the annual plan" }],
  tools,
});

// Execute the tool call with the user's vaulted Polar access token
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["polar"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Show last month's MRR, check this customer's subscription state, and create a checkout for the annual plan" }],
  tools,
});

// Tool call runs with the user's vaulted Polar access token
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["polar"] }, pageSize: 100,
});

const agent = new Agent({
  name: "billing_agent",
  model: "gemini-2.5-pro",
  instruction: "Polar tools scoped to this user",
  tools,
});

await agent.run("Show last month's MRR, check this customer's subscription state, and create a checkout for the annual plan");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Polar tool. Click to copy, paste into your agent, done.
Revenue and orders
Copy the prompt
Copied
Show revenue and MRR for last month.
Copy the prompt
Copied
List the orders from the last 7 days.
Copy the prompt
Copied
Get the invoice download link for this order.
Customers and subscriptions
Copy the prompt
Copied
Get the full state of this customer, including subscriptions and benefits.
Copy the prompt
Copied
List the active subscriptions for this product.
Copy the prompt
Copied
Create a customer portal session for this customer.
Checkout and usage
Copy the prompt
Copied
Create a checkout session for this product.
Copy the prompt
Copied
Create a 20 percent discount with the code LAUNCH.
Copy the prompt
Copied
Show this meter's quantities for the last 30 days.
SEE HOW AUTH WORKS
Each user connects their own Polar access token once, and Scalekit sends it with every call. Tokens stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Polar
once. We tie it to their identity and the access they approved, with no shared bot account and no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Polar
credential lives in a vault scoped to them. User A's data is never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tenants:
isolated
3
Resolve
When your agent calls a
Polar
tool, we fetch the right credential server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Polar
tool call is logged: who triggered it, which tool ran, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other accounting and finance connectors.
GTM and RevOps Teams
Revenue forecast commentary
Pulls open pipeline from Salesforce and HubSpot, calculates coverage against quota, flags at-risk stages, posts commentary to Slack, and logs every snapshot to Google Sheets.
GTM and RevOps Teams
CRM AI agent
Reads the Granola transcript after every call, extracts next steps and updates the HubSpot record, drafts the follow-up in Gmail, and confirms in Slack, all on the rep's own delegated OAuth.
Test other agents
See the same per-user auth pattern across other accounting and finance connectors.
GTM
Revenue forecast agent
Score pipeline coverage against quota across Salesforce and HubSpot, post forecast commentary to Slack, log snapshots to Sheets.
GTM
CRM AI agent
Turn each Granola call transcript into a HubSpot record update, a drafted Gmail follow-up, and a Slack recap.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Polar access token looks fine in a demo. In production every refund and subscription change looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared token
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Polar today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Polar as the user or through a shared token?
As the user. Each user connects their own Polar access token once, and Scalekit sends it with every call. Refunds, subscription changes, and discounts the agent creates are attributed to that user in your audit trail, not a shared service account.
Where is the Polar access token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. To rotate it, the user reconnects with a new access token. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Polar?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the order, subscription, and metrics read tools without polar_refund_create, polar_customer_delete, or polar_subscription_revoke. 5 of the 60 tools are destructive, including polar_subscription_revoke, which cancels a subscription immediately and revokes its benefits. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Polar access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
How does the agent work with usage-based billing in Polar?
polar_meter_create defines a meter, polar_events_ingest sends usage events for customers, and polar_meter_quantities_get returns the aggregated quantities over a time range. polar_customer_meters_list shows each customer's meter balance.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""polar"": {
""url"": ""https://mcp.scalekit.com/polar"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.polar]
url = ""https://mcp.scalekit.com/polar""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""polar"": {
""url"": ""https://mcp.scalekit.com/polar"",
""type"": ""http""
}
}
}