8000 GitHub - devinwang/adapty-mcp: Model Context Protocol (MCP) server for Adapty — full coverage of Server-Side API v2, legacy v1, Web API, Analytics Export, and webhook utilities. · GitHub
[go: up one dir, main page]

Skip to content

About

Model Context Protocol (MCP) server for Adapty — full coverage of Server-Side API v2, legacy v1, Web API, Analytics Export, and webhook utilities.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

adapty-mcp

A Model Context Protocol (MCP) server that exposes the full public Adapty REST API surface as tools — Server-Side API v2 (12 tools), legacy v1 (7 tools), Web API (3 tools), Analytics Export (3 tools), and webhook utilities (2 tools). 27 tools total.

Quick start

Install globally:

npm i -g adapty-mcp

Run as an MCP stdio server (any MCP-compatible client can spawn it):

ADAPTY_SECRET_API_KEY=secret_live_... adapty-mcp

For Cursor or any other MCP client, point its server config at the adapty-mcp binary and pass ADAPTY_SECRET_API_KEY via env. Optional: ADAPTY_PUBLIC_API_KEY for Web API tools, ADAPTY_SECRET_API_KEY_SANDBOX / ADAPTY_PUBLIC_API_KEY_SANDBOX for the Adapty staging environment.

Multi-app config

If you manage multiple Adapty apps from the same machine, write ~/.config/adapty-mcp/accounts.json:

{
  "default": "main",
  "apps": {
    "main": {
      "live":    { "secretKey": "secret_live_main...",  "publicKey": "public_live_main..." },
      "sandbox": { "secretKey": "secret_stag_main...",  "publicKey": "public_stag_main..." }
    },
    "side-project": {
      "live": { "secretKey": "secret_live_side..." }
    }
  }
}

Override the path with ADAPTY_MCP_CONFIG=/path/to/accounts.json.

Each tool accepts optional app and environment arguments:

  • app — name from the apps map. Omit to use default.
  • environment — "live" (default) or "sandbox".

When the config file is present, env-var fallbacks are NOT consulted, so multi-app setups behave predictably. The file mode is checked at startup; loose permissions trigger a stderr warning recommending chmod 600.

The default request timeout is 30 seconds; GET requests automatically retry up to three times on 429/502/503/504 responses with exponential backoff. Mutating verbs are never auto-retried.

Tool catalog

< 85C1 p dir="auto">(generated by npx tsx scripts/gen-tool-docs.ts)

Server-Side API v2

Tool Description
adapty_profile_get Retrieve an Adapty user profile (access levels, subscriptions, non-subscriptions). Use case: check whether a customer currently has an active access level.
adapty_profile_create Create a new Adapty profile. Use case: pre-create a profile when your backend signs up a user.
adapty_profile_update Update Adapty profile attributes (name, email, custom_attributes, ...). Use case: sync user profile changes from your backend.
adapty_profile_delete Delete an Adapty profile and its data. Use case: GDPR/CCPA delete request.
adapty_access_level_grant Grant or extend an access level for a customer (without an actual purchase). Use case: comp a creator account, refund credit.
adapty_access_level_revoke Revoke a previously granted access level. Use case: undo a manual grant.
adapty_transaction_set Submit a store transaction (App Store or Google Play) for Adapty to verify and record. Use case: server-side receipt validation when your client cannot reach Adapty directly.
adapty_stripe_purchase_validate Validate a Stripe subscription/customer with Adapty. Use case: granting access on Stripe purchase events.
adapty_integration_identifiers_set Attach external integration identifiers (Amplitude, Mixpanel, AppsFlyer, etc.) to an Adapty profile so server-to-server analytics can correlate the same user across systems.
adapty_paywall_get Fetch a single paywall by its developer ID. Use case: server-side rendering of a paywall configuration.
adapty_paywalls_list List all paywalls configured for the current Adapty app. Use case: build a server-side index of paywall keys.
adapty_paywall_update Update a paywall configuration (name, remote_config, products). Use case: rotate remote config or product list from a server-side admin tool.

Server-Side API v1 (Legacy)

Tool Description
adapty_v1_profile_get [LEGACY — prefer v2 equivalent] Fetch a v1 SDK profile by profile id or customer user id. Use case: maintain compatibility with apps still on the v1 SDK API surface.
adapty_v1_profile_create [LEGACY — prefer v2 equivalent] Create a v1 SDK profile via the legacy /profiles/ endpoint. Use case: pre-create profiles from a backend integrated against the v1 SDK API.
adapty_v1_profile_update [LEGACY — prefer v2 equivalent] Patch a v1 SDK profile attributes payload. Use case: sync profile changes through the legacy SDK API.
adapty_v1_profile_delete [LEGACY — prefer v2 equivalent] Delete a v1 SDK profile via /profiles/{id}/delete. Use case: GDPR/CCPA delete request for legacy integrations.
adapty_v1_access_level_grant [LEGACY — prefer v2 equivalent] Grant or extend a paid access level via the v1 SDK URL-scoped endpoint. Use case: comp an account through the legacy API.
adapty_v1_access_level_revoke [LEGACY — prefer v2 equivalent] Revoke a previously granted paid access level via the v1 SDK URL-scoped endpoint. Use case: undo a manual grant on legacy stacks.
adapty_v1_stripe_token_validate [LEGACY — prefer v2 equivalent] Validate a Stripe token through the v1 SDK /purchase/stripe/token/validate/ endpoint. Use case: verify a Stripe token in legacy purchase flows.

Web API

Tool Description
adapty_web_paywall_get Fetch a web-rendered paywall configuration by its developer ID. Use case: server-side rendering of a paywall on a marketing landing page.
adapty_web_paywall_view_record Record that a paywall was viewed by a customer. Use case: track impressions for conversion analytics.
adapty_web_attribution_set Attach marketing attribution metadata (source/network/attributes) to a profile. Use case: forward MMP postbacks to Adapty.

Analytics Export

Tool Description
adapty_analytics_query Query Adapty analytics metrics over a date range. Use case: pull MRR/ARR/conversion numbers into a dashboard or chatbot answer.
adapty_analytics_cohorts_query Query Adapty cohort retention metrics over a date range. Use case: weekly/monthly retention for a marketing review.
adapty_analytics_export_csv Export an analytics dataset as CSV. Use case: bulk download for spreadsheet analysis.

Webhook Utilities

Tool Description
adapty_webhook_authorization_verify Verify an incoming Adapty webhook by constant-time comparing the inbound Authorization header value against the value you configured in the Adapty dashboard. No HMAC — Adapty echoes the configured token verbatim.
adapty_webhook_event_parse Parse a raw webhook JSON body into a typed Adapty event. Validates against the discriminated union of all 18 known event types.

License

MIT.

About

Model Context Protocol (MCP) server for Adapty — full coverage of Server-Side API v2, legacy v1, Web API, Analytics Export, and webhook utilities.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0