Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Each plugin lives in `plugins/<slug>`. The directory name is the install keyword
| `linear` | Linear SDK scripting skill for issue, project, team, cycle, and comment workflows. |
| `mac-notify` | macOS notifications when a Cline run completes. |
| `nanobanana` | Image generation through OpenRouter and Gemini image models. |
| `revenuecat` | RevenueCat MCP plus in-app purchase, entitlement, paywall, analytics, and troubleshooting skills. |
| `speak` | Speaks completed Cline replies with ElevenLabs text to speech. |
| `typescript-lsp` | TypeScript language service `goto_definition` support. |
| `weather-metrics` | Demo weather tool plus runtime metrics hooks. |
Expand Down
24 changes: 24 additions & 0 deletions plugins/revenuecat/NOTICE.revenuecat-ai-toolkit
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This plugin includes RevenueCat workflow skill material adapted from the RevenueCat AI toolkit.

Source: https://github.com/RevenueCat/ai-toolkit
License: MIT

Copyright (c) RevenueCat, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
29 changes: 29 additions & 0 deletions plugins/revenuecat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# revenuecat

Use RevenueCat from Cline for in-app purchase setup, subscription analytics, entitlement checks, paywalls, customer center flows, purchase testing, migration, and troubleshooting.

## What It Adds

The plugin registers the RevenueCat remote MCP server and bundles RevenueCat workflow skills for:

- Creating projects, apps, products, entitlements, offerings, and packages.
- Integrating RevenueCat SDKs in iOS, Android, Kotlin Multiplatform, Flutter, and React Native apps.
- Building paywalls, purchase flows, entitlement gates, customer center screens, and identify/log-in flows.
- Reading RevenueCat charts and project status.
- Testing purchases and troubleshooting dashboard or SDK issues.

## Requirements

RevenueCat MCP access requires RevenueCat account authentication. Interactive installs may offer to authorize the RevenueCat MCP server immediately; non-interactive installs can authorize later from `cline mcp`.

Project configuration changes depend on the user's RevenueCat account permissions. App-side SDK changes may require local platform tooling such as Xcode, Android Studio, Gradle, Flutter, or React Native tooling depending on the target app.

## Safety Notes

RevenueCat controls monetization and customer access. The bundled skills ask Cline to confirm before changing projects, apps, products, entitlements, offerings, packages, webhooks, API keys, pricing, or SDK configuration.

Public SDK keys are safe to embed in client apps. Secret API keys are server-side only and should never be written into client code.

## License

The bundled RevenueCat workflow skills are adapted from RevenueCat's AI toolkit under the MIT license. See `NOTICE.revenuecat-ai-toolkit`.
22 changes: 22 additions & 0 deletions plugins/revenuecat/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { AgentPlugin } from "@cline/sdk"

const REVENUECAT_MCP_URL = "https://mcp.revenuecat.ai/mcp"

const plugin: AgentPlugin = {
name: "revenuecat",
manifest: {
capabilities: ["mcp", "skills"],
},

setup(api) {
api.registerMcpServer({
name: "revenuecat",
transport: {
type: "streamableHttp",
url: REVENUECAT_MCP_URL,
},
})
},
}

export default plugin
20 changes: 20 additions & 0 deletions plugins/revenuecat/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "revenuecat",
"version": "0.0.0",
"private": true,
"type": "module",
"description": "Cline plugin for RevenueCat MCP access and in-app purchase monetization workflows.",
"cline": {
"plugins": [
{
"paths": [
"./index.ts"
],
"capabilities": [
"mcp",
"skills"
]
}
]
}
}
89 changes: 89 additions & 0 deletions plugins/revenuecat/skills/create-revenuecat-project/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
name: create-revenuecat-project
description: "Set up a complete RevenueCat project from scratch - creates apps, products, entitlements, offerings, and packages in the correct order. Use when the user wants to create a new RevenueCat project, configure in-app purchases, set up subscriptions or monetization, or bootstrap IAP infrastructure for iOS, Android, or Web."
---

# RevenueCat Project Bootstrap

Guide through setting up a complete RevenueCat project from scratch.

## Instructions

Important: Use the RevenueCat MCP server for all tool calls. The MCP server may have access to multiple projects. Always use `list-projects` first to retrieve all accessible projects. If multiple projects are returned, ask the user which project to use or if they want to create a new one.

### Phase 1: Discovery

Ask targeted questions to understand the developer's needs:

1. Platforms - "Which platforms are you building for?" (iOS, Android, Web, or multiple)
2. Business Model - "What type of monetization are you planning?" (subscriptions, one-time purchases, consumables, or a mix)
3. Subscription Tiers (if applicable) - "What subscription options do you want to offer?" (common: Monthly + Annual, single tier, Freemium + Premium)
4. App Details - Bundle ID (iOS, e.g. `com.company.appname`), package name (Android), and display name

### Phase 2: Create Resources

Execute in this order - dependencies matter.

1. Verify/Create Project
`list-projects` - list accessible projects
If multiple: ask user which to use, or offer to create a new one
To create a new project, use the `create-project` MCP tool
Store project_id for all subsequent calls

2. Create Apps (for each platform):
- For mobile apps, ask if the user already has set up their app in App Store Connect / Google Play Console. If so, create an app using the `create-app` tool (type: app_store | play_store). If not, use the automatically generated `test_store` app and tell the user that they can set up the integration with App Store Connect / Google Play Console later.
- For web apps, `create-app` with type rc_billing

3. Create Products (for each subscription/purchase): `create-product` tool

4. Create Entitlements (for each feature/access level): `create-entitlement` tool

5. Attach Products to Entitlements: `attach-products-to-entitlement` tool

6. Create Default Offering: `create-offering` tool (lookup_key: "default")

7. Create Packages in Offering: `create-package` tool (for subscriptions, use $rc_monthly, $rc_annual, etc.)

8. Attach Products to Packages: `attach-products-to-package` tool

9. Get API keys: use the RevenueCat MCP public API key listing tool for each app

### Phase 3: Summary & Next Steps

Provide a complete setup summary:

```
Project Setup Complete!
=======================

Project: {project_name} ({project_id})

Apps Created:
iOS: {app_name} - API Key: appl_xxxxx
Android: {app_name} - API Key: goog_xxxxx

Products:
- monthly_premium (subscription, P1M)
- annual_premium (subscription, P1Y)

Entitlements:
- premium -> monthly_premium, annual_premium

Offering: default (current)
$rc_monthly -> monthly_premium
$rc_annual -> annual_premium

Next Steps:
1. Configure store credentials in RevenueCat dashboard
2. Create products in App Store Connect / Play Console
3. Add the SDK to your app with the `integrate-revenuecat` skill
4. Implement paywall UI using the "default" offering
```

## Error Handling

If any step fails:
1. Report the specific error clearly
2. Suggest fixes (e.g., "Bundle ID may already be in use")
3. Offer to retry or skip that step
4. Continue with remaining steps if possible
127 changes: 127 additions & 0 deletions plugins/revenuecat/skills/integrate-revenuecat/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
name: integrate-revenuecat
description: End-to-end RevenueCat integration - sets up the dashboard side via the RevenueCat MCP (project, app, public API key) and installs/configures the Purchases SDK in the app. Use when the user asks to add RevenueCat, integrate Purchases, install the RevenueCat SDK, set up a RevenueCat API key, configure Purchases on launch, or set up a brand new RevenueCat integration on iOS, Android, Kotlin Multiplatform, Flutter, or React Native.
---

# integrate-revenuecat: end-to-end RevenueCat integration

Use this skill when the user wants to add RevenueCat to a project for the first time, or to reconfigure the SDK with a public API key. The skill covers two halves:

1. Dashboard side - set up the project, register the app, and obtain the public API key, all through the RevenueCat MCP server.
2. App side - install the Purchases SDK, call `Purchases.configure(...)` at app entry, and verify the configuration banner in the logs.

Walk them in order. Most integrations need both halves, even when the user asks "just install the SDK" - the SDK needs an API key from the dashboard.

> If a project + app already exist and the user only wants to wire the SDK into code, jump to Section 3 below.
> If the user wants to bootstrap a brand new RevenueCat project (apps + products + entitlements + offerings), use the `create-revenuecat-project` skill instead, then come back here for the SDK install.

## Optional Context

The user may provide a platform (`ios`, `android`, `kmp`, `flutter`, or `react-native`), an app identifier, or a project name in their request. If any are missing, inspect the workspace first and ask only for details that cannot be inferred.

## 1. Understand the status quo

Before touching the dashboard, gather the facts:

- Platform target: iOS / Apple App Store, Android / Google Play, or both. Inspect the working directory before asking - the detection algorithm in Section 3 makes this obvious for most projects.
- Technology: native iOS (Swift), native Android (Kotlin / Java), React Native, Flutter, Kotlin Multiplatform. SDK list: https://www.revenuecat.com/docs/getting-started/installation.md.
- App identifier: bundle ID (iOS), package name (Android). Pull from `Info.plist` / `AndroidManifest.xml` / `app.json` / `pubspec.yaml` rather than asking.

## 2. Dashboard side - RevenueCat MCP

Use the RevenueCat MCP server for every tool call below.

### 2a. Get or create the project
- `list-projects` - list accessible projects. If multiple, ask the user which one matches this app, or offer to create a new one.
- If there is no project, hand off to the `create-revenuecat-project` skill, then resume here.
- Store the `project_id` for the rest of the steps.

### 2b. Get or create the app
- Check which apps are already configured in the project. A `test_store` app is always present; `app_store` and `play_store` apps are present only if the user has finished store-side setup.
- Ask the user whether their app is already set up in App Store Connect (iOS) or Google Play Console (Android). Reassure them that store-side setup can come later - the `test_store` app is enough to start integrating.
- If the user confirms store-side setup is done, call `create-app`:
- iOS: `type: "app_store"`, `bundle_id` from Section 1.
- Android: `type: "play_store"`, `package_name` from Section 1.
- `name` derived from the identifier or asked from the user.

### 2c. Get the public API key
- Use the RevenueCat MCP public API key listing tool with the relevant app ID:
- `app_store` / `play_store` if the store-side app exists.
- Otherwise the `test_store` app.
- The returned key is public and safe to embed in client app code. iOS keys are prefixed `appl_...`, Android keys `goog_...`, Amazon `amzn_...`.

> Never use the secret API key in client code. Secret keys are server-side only.

## 3. App side - install and configure the SDK

### 3a. Detect the platform

Inspect the working directory and pick the first match, from top to bottom:

1. React Native: `package.json` has a `react-native-purchases` entry, or `react-native` as a dependency -> read `platforms/react-native.md`. If `expo` is also a dependency, note it as an Expo project.
2. Flutter: `pubspec.yaml` exists at the project root -> read `platforms/flutter.md`.
3. Kotlin Multiplatform: `build.gradle.kts` contains a `kotlin { ... }` multiplatform source sets block, or depends on `com.revenuecat.purchases:purchases-kmp*` -> read `platforms/kmp.md`.
4. Android (native): `build.gradle(.kts)` applies `com.android.application` (and is not KMP) -> read `platforms/android.md`.
5. iOS (native): `Package.swift`, `*.xcodeproj`, `*.xcworkspace`, or `Podfile` at the project root -> read `platforms/ios.md`.

If several match (e.g. an `ios/` folder inside a Flutter project), pick the outermost project, the one that owns the build. If still ambiguous, ask the user which platform they want to configure.

### 3b. Shared concepts (all platforms)

- Public SDK key, not secret key. RevenueCat issues a separate public SDK key per store/platform. iOS apps use an `appl_...` key, Android apps use a `goog_...` key (Amazon uses `amzn_...`). Server-side secret keys must never appear in client apps.
- Configure once per app launch. Call `Purchases.configure(...)` exactly once, as early as possible (app entry point). Later calls no-op or warn.
- Anonymous users by default. If you don't pass an `appUserID`, RevenueCat creates a stable anonymous ID. Only pass `appUserID` if you already have an authenticated user at launch; otherwise call `logIn(...)` later (see the `revenuecat-identify-user` skill).
- Enable debug logging during integration. Each platform file shows how. Turn it off for release builds.
- Keep keys out of source control. Recommend `.env` (RN), `xcconfig` (iOS), `local.properties` / `gradle.properties` (Android), or dart-define (Flutter) when the user asks about secret management.

### 3c. Implementation

Read the platform file that matches detection:

- `platforms/ios.md`
- `platforms/android.md`
- `platforms/kmp.md`
- `platforms/flutter.md`
- `platforms/react-native.md`

Each platform file is self-contained: install command, exact `configure` snippet, and where to place it in the app entry point.

## 4. Verify

Do not claim setup is complete until:

1. The project builds (Xcode build, `./gradlew assembleDebug`, `flutter run`, `npx react-native run-ios`, or the KMP equivalent).
2. The app launches and the RevenueCat SDK logs a configuration banner in the console / logcat / Metro output (each platform file describes the expected log line).
3. No authentication errors appear on the first SDK network call. A wrong API key surfaces as an auth error log as soon as the app fetches offerings.

If the user only asked to "install" without running the app, tell them what to look for in the logs when they do run it.

## 5. Next steps

### 5a. Products, entitlements, offerings
Check whether products, entitlements, and offerings are already set up in the project. If not, offer to help via the `create-revenuecat-project` skill.

### 5b. Store-side setup

iOS (App Store Connect)

1. In-App Purchase Key (recommended for StoreKit 2) - App Store Connect -> Users and Access -> Integrations -> In-App Purchase. Generate key, download the `.p8` file. Note the Key ID and Issuer ID.
2. Shared Secret (legacy StoreKit 1) - App Store Connect -> App -> App Information -> App-Specific Shared Secret.
3. If the user provides this information, register it on the RevenueCat side via `create-app` / `update-app`.

Android (Google Play Console)

1. Service account credentials - Create a service account in Google Cloud Console. Grant "Service Account User" role. Create a JSON key. In Play Console, grant the service account access with "View financial data" permission.
2. Real-time Developer Notifications (RTDN) - Set up a Cloud Pub/Sub topic. Configure in Play Console -> Monetization setup.
3. If the user provides this information, register it via `create-app` / `update-app`.

### 5c. Subsequent skills

Common follow-ups after `integrate-revenuecat`:

- `revenuecat-paywall` - display a dashboard-configured paywall.
- `revenuecat-purchase-flow` - implement purchase + restore manually.
- `revenuecat-entitlements-gate` - gate features behind active entitlements.
- `revenuecat-identify-user` - wire `logIn` / `logOut` to the app's auth system.
- `revenuecat-testing-setup` - set up a sandbox testing channel.
- `revenuecat-troubleshoot` - diagnose offerings / products / entitlement bugs.
Loading