Integrations
Polar
Manage products, subscriptions, and customers
The Polar integration provides access to Polar's API 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
- Navigate to the API section
- Create a new OAuth application
- 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({
scopes: [
"products:read",
"subscriptions:read",
"customers:read",
"orders:read",
"benefits:read",
], // Optional
}),
],
});You can override the environment variables by passing explicit values:
polarIntegration({
clientId: process.env.CUSTOM_POLAR_ID,
clientSecret: process.env.CUSTOM_POLAR_SECRET,
scopes: ["products:read", "subscriptions:read"],
});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 products = await client.polar.listProducts({});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
Prop
Type
Available Tools
Products
polar_list_products- List productspolar_get_product- Get a specific product
Subscriptions
polar_list_subscriptions- List subscriptionspolar_get_subscription- Get a specific subscription
Customers
polar_list_customers- List customerspolar_get_customer- Get a specific customer
Orders
polar_list_orders- List orderspolar_get_order- Get a specific order
Benefits
polar_list_benefits- List benefits
Examples
List Products
const result = await client.polar.listProducts({
organizationId: "org_123",
});
console.log("Products:", result);Get Subscription
const result = await client.polar.getSubscription({
subscriptionId: "sub_123",
});
console.log("Subscription:", result);List Customers
const result = await client.polar.listCustomers({
organizationId: "org_123",
limit: 50,
});
console.log("Customers:", result);OAuth Scopes
The default scopes are ['products:read', 'subscriptions:read', 'customers:read', 'orders:read', 'benefits:read']. You may need different scopes:
products:read- Read productsproducts:write- Create and update productssubscriptions:read- Read subscriptionssubscriptions:write- Manage subscriptionscustomers:read- Read customerscustomers:write- Manage customersorders:read- Read ordersbenefits:read- Read benefits
Error Handling
try {
const result = await client.polar.getProduct({
productId: "prod_123",
});
} catch (error) {
if (error.message.includes("not found")) {
console.error("Product not found");
} else if (error.message.includes("authentication")) {
console.error("Authentication failed");
} else {
console.error("Unexpected error:", error);
}
}Next Steps
- Explore the Stripe Integration
- Explore the Ramp Integration
- See Advanced Usage for more examples