Polar Integration
Manage Polar products, orders, and subscriptions
The Polar integration provides access to manage Polar products, orders, and subscriptions through the Integrate MCP server.
Installation
The Polar integration is included with the SDK:
import { polarIntegration } from "integrate-sdk/server";Setup
1. Create a Polar OAuth App
- Go to Polar Settings
- Create a new OAuth application
- Configure your redirect URI
- Note your Client ID and Client Secret
2. Configure the Integration on Your Server
Add the Polar integration to your server configuration. The integration automatically reads POLAR_CLIENT_ID and POLAR_CLIENT_SECRET from your environment variables:
import { createMCPServer, polarIntegration } from "integrate-sdk/server";
export const { client: serverClient } = createMCPServer({
apiKey: process.env.INTEGRATE_API_KEY,
integrations: [
polarIntegration({
}),
],
});You can override the environment variables by passing explicit values:
polarIntegration({
clientId: process.env.CUSTOM_POLAR_ID,
clientSecret: process.env.CUSTOM_POLAR_SECRET,
});3. Client-Side Usage
The default client automatically includes all integrations. You can use it directly:
import { client } from "integrate-sdk";
await client.authorize("polar");
const result = await client.polar.listProducts({});
console.log(result);If you're using a custom client, add the integration to the integrations array:
import { createMCPClient, polarIntegration } from "integrate-sdk";
const customClient = createMCPClient({
integrations: [polarIntegration()],
});Configuration Options
export interface PolarIntegrationConfig {
/** Polar OAuth client ID (defaults to POLAR_CLIENT_ID env var) */
clientId?: string;
Tools
polar_list_products
List products
export interface PolarListProductsParams {
/** Organization ID */
organization_id?: string;
polar_get_product
Get product details
export interface PolarGetProductParams {
/** Product ID */
product_id: string;
polar_create_product
Create a new product
export interface PolarCreateProductParams {
/** Product name */
name: string;
polar_update_product
Update a product
export interface PolarUpdateProductParams {
/** Product ID */
product_id: string;
polar_list_subscriptions
List subscriptions
export interface PolarListSubscriptionsParams {
/** Organization ID */
organization_id?: string;
polar_get_subscription
Get subscription details
export interface PolarGetSubscriptionParams {
/** Subscription ID */
subscription_id: string;
polar_update_subscription
Update a subscription
export interface PolarUpdateSubscriptionParams {
/** Subscription ID */
subscription_id: string;
polar_revoke_subscription
Revoke a subscription
export interface PolarRevokeSubscriptionParams {
/** Subscription ID */
subscription_id: string;
polar_list_customers
List customers
export interface PolarListCustomersParams {
/** Organization ID */
organization_id?: string;
polar_get_customer
Get customer details
export interface PolarGetCustomerParams {
/** Customer ID */
customer_id: string;
polar_create_customer
Create a new customer
export interface PolarCreateCustomerParams {
/** Customer email */
email: string;
polar_update_customer
Update a customer
export interface PolarUpdateCustomerParams {
/** Customer ID */
customer_id: string;
polar_delete_customer
Delete a customer
export interface PolarDeleteCustomerParams {
/** Customer ID */
customer_id: string;
polar_get_customer_state
Get customer state (subscriptions, orders, etc.)
export interface PolarGetCustomerStateParams {
/** Customer ID */
customer_id: string;
polar_list_orders
List orders
export interface PolarListOrdersParams {
/** Organization ID */
organization_id?: string;
polar_get_order
Get order details
export interface PolarGetOrderParams {
/** Order ID */
order_id: string;
polar_get_order_invoice
Get order invoice
export interface PolarGetOrderInvoiceParams {
/** Order ID */
order_id: string;
polar_list_benefits
List benefits
export interface PolarListBenefitsParams {
/** Organization ID */
organization_id?: string;
polar_get_benefit
Get benefit details
export interface PolarGetBenefitParams {
/** Benefit ID */
benefit_id: string;
polar_create_benefit
Create a new benefit
export interface PolarCreateBenefitParams {
/** Benefit type */
type: string;
polar_update_benefit
Update a benefit
export interface PolarUpdateBenefitParams {
/** Benefit ID */
benefit_id: string;
polar_list_discounts
List discounts
export interface PolarListDiscountsParams {
/** Number to return */
limit?: number;
polar_get_discount
Get discount details
export interface PolarGetDiscountParams {
/** Discount ID */
discount_id: string;
polar_create_discount
Create a new discount
export interface PolarCreateDiscountParams {
/** Discount name */
name: string;
polar_delete_discount
Delete a discount
export interface PolarDeleteDiscountParams {
/** Discount ID */
discount_id: string;
polar_list_checkout_links
List checkout links
export interface PolarListCheckoutLinksParams {
/** Number to return */
limit?: number;
polar_get_checkout_link
Get checkout link details
export interface PolarGetCheckoutLinkParams {
/** Checkout link ID */
checkout_link_id: string;
polar_create_checkout_link
Create a new checkout link
export interface PolarCreateCheckoutLinkParams {
/** Product price ID */
product_price_id: string;
polar_list_license_keys
List license keys
export interface PolarListLicenseKeysParams {
/** Number to return */
limit?: number;
polar_get_license_key
Get license key details
export interface PolarGetLicenseKeyParams {
/** License key ID */
license_key_id: string;
polar_validate_license_key
Validate a license key
export interface PolarValidateLicenseKeyParams {
/** License key ID */
license_key_id: string;
polar_activate_license_key
Activate a license key
export interface PolarActivateLicenseKeyParams {
/** License key ID */
license_key_id: string;
polar_get_metrics
Get metrics for a time period
export interface PolarGetMetricsParams {
/** Start date (YYYY-MM-DD) */
start_date: string;
polar_list_organizations
List organizations
export interface PolarListOrganizationsParams {
/** Number to return */
limit?: number;
polar_get_organization
Get organization details
export interface PolarGetOrganizationParams {
/** Organization ID */
organization_id: string;
Notes
- Category: Finance
- Authentication mode: OAuth