@dodopayments/opencode-plugin 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.mcp.json CHANGED
@@ -7,7 +7,8 @@
7
7
  "-y",
8
8
  "mcp-remote@latest",
9
9
  "https://mcp.dodopayments.com/sse"
10
- ]
10
+ ],
11
+ "enabled": true
11
12
  },
12
13
  "dodo-knowledge": {
13
14
  "type": "stdio",
@@ -16,7 +17,8 @@
16
17
  "-y",
17
18
  "mcp-remote@latest",
18
19
  "https://knowledge.dodopayments.com/mcp"
19
- ]
20
+ ],
21
+ "enabled": true
20
22
  }
21
23
  }
22
24
  }
package/README.md CHANGED
@@ -1,17 +1,17 @@
1
1
  # Dodo Payments Agent Plugin
2
2
 
3
3
  [![License](https://img.shields.io/github/license/dodopayments/dodo-agent-plugin.svg?style=flat-square)](./LICENSE)
4
- [![Version](https://img.shields.io/badge/version-0.2.0-blue.svg?style=flat-square)](./CHANGELOG.md)
4
+ [![Version](https://img.shields.io/badge/version-0.4.0-blue.svg?style=flat-square)](./CHANGELOG.md)
5
5
  [![npm](https://img.shields.io/npm/v/@dodopayments/opencode-plugin.svg?style=flat-square)](https://www.npmjs.com/package/@dodopayments/opencode-plugin)
6
6
  [![Discord](https://img.shields.io/discord/1305511580854779984?label=discord&style=flat-square)](https://discord.gg/bYqAp4ayYh)
7
7
 
8
- The official Dodo Payments plugin for AI coding agents. Installs eight integration skills and two MCP servers across **Claude Code**, **Codex CLI**, **Cursor**, and **OpenCode** from a single source of truth.
8
+ The official Dodo Payments plugin for AI coding agents. Installs seventeen integration skills and two MCP servers across **Claude Code**, **Codex CLI**, **Cursor**, and **OpenCode** from a single source of truth.
9
9
 
10
10
  ## What you get
11
11
 
12
12
  - **Dodo Payments API MCP server** - Live API access (payments, subscriptions, customers, products, refunds, licenses, usage). Authenticates via browser OAuth, no local credentials required.
13
13
  - **Dodo Knowledge MCP server** - No credentials. Semantic search over the current Dodo Payments documentation.
14
- - **Eight agent skills** - Written as `SKILL.md` files with YAML frontmatter. Your agent loads the relevant skill on its own when a task calls for it.
14
+ - **Seventeen agent skills** - Written as `SKILL.md` files with YAML frontmatter. Your agent loads the relevant skill on its own when a task calls for it.
15
15
 
16
16
  ## Install
17
17
 
@@ -71,7 +71,7 @@ OpenCode distributes via npm. Add the plugin to your `opencode.json`:
71
71
  }
72
72
  ```
73
73
 
74
- Restart OpenCode. Both MCP servers (`dodopayments-api`, `dodo-knowledge`) are registered automatically via the plugin's `config` hook, and the eight skills are auto-discovered from the installed package. No manual `mcp` block required.
74
+ Restart OpenCode. Both MCP servers (`dodopayments-api`, `dodo-knowledge`) are registered automatically via the plugin's `config` hook, and the seventeen skills are auto-discovered from the installed package. No manual `mcp` block required.
75
75
 
76
76
  If you prefer the local stdio API server with your own API key instead of the default remote OAuth server, declare `dodopayments-api` yourself in `opencode.json` - your entry wins over the plugin default:
77
77
 
@@ -95,16 +95,52 @@ If you prefer the local stdio API server with your own API key instead of the de
95
95
 
96
96
  ## Included Skills
97
97
 
98
+ **Getting started**
99
+
100
+ | Skill | Description |
101
+ |-------|-------------|
102
+ | `best-practices` | SDK setup, environments, API keys, and the canonical checkout-to-webhook architecture |
103
+ | `framework-adapters` | Official `@dodopayments/*` handlers for Next.js, Express, Hono, Astro, Remix, SvelteKit, Nuxt, Fastify, TanStack, Bun, Convex |
104
+ | `testing-and-go-live` | Test mode, test payment methods, webhook testing, production launch checklist |
105
+
106
+ **Accepting payments**
107
+
108
+ | Skill | Description |
109
+ |-------|-------------|
110
+ | `checkout-integration` | Checkout Sessions, payment links, and overlay checkout |
111
+ | `subscription-integration` | Subscription lifecycle, trials, plan changes, proration, on-demand charges |
112
+ | `mobile-checkout` | In-app checkout for React Native, Flutter, iOS, and Android |
113
+ | `webhook-integration` | Receiving and verifying webhooks via the Standard Webhooks spec |
114
+
115
+ **Billing models**
116
+
117
+ | Skill | Description |
118
+ |-------|-------------|
119
+ | `credit-based-billing` | Credit entitlements, balances, ledger, rollover, overage, meter-based deduction |
120
+ | `usage-based-billing` | Meters, event ingestion, aggregation, and per-unit pricing |
121
+ | `license-keys` | License key activation, validation, and instance management |
122
+
123
+ **Catalog and pricing**
124
+
125
+ | Skill | Description |
126
+ |-------|-------------|
127
+ | `product-catalog-management` | Products, pricing, add-ons, collections, images, digital delivery |
128
+ | `discounts-and-promotions` | Discount codes, eligibility, stacking, subscription-cycle limits |
129
+ | `localized-pricing` | Localized pricing, adaptive currency, and purchasing power parity |
130
+
131
+ **Customers and operations**
132
+
133
+ | Skill | Description |
134
+ |-------|-------------|
135
+ | `customer-management` | Customers, self-service portal, payment methods, wallets |
136
+ | `refunds-and-disputes` | Refunds, disputes and chargebacks, access reconciliation |
137
+
138
+ **UI and integrations**
139
+
98
140
  | Skill | Description |
99
141
  |-------|-------------|
100
- | `best-practices` | Comprehensive guide to integrating Dodo Payments with best practices |
101
- | `checkout-integration` | Creating checkout sessions and payment flows |
102
- | `subscription-integration` | Implementing subscription billing flows |
103
- | `webhook-integration` | Setting up and handling webhooks for payment events |
104
- | `usage-based-billing` | Implementing metered billing with events and meters |
105
- | `credit-based-billing` | Credit entitlements, balances, and metered credit deduction |
106
- | `license-keys` | Managing license keys for digital products |
107
- | `billing-sdk` | Using BillingSDK React components |
142
+ | `billing-sdk` | BillingSDK React components for pricing tables and billing UI |
143
+ | `better-auth-integration` | The `@dodopayments/better-auth` plugin for customer sync, checkout, portal |
108
144
 
109
145
  Skills source: [`dodopayments/skills`](https://github.com/dodopayments/skills) (bundled as a git submodule in `skills-src/`).
110
146
 
@@ -146,6 +182,50 @@ Then edit `.mcp.json` to point `dodopayments-api` at the local stdio server:
146
182
 
147
183
  Run `/reload-plugins` to apply changes to your current session.
148
184
 
185
+ ## Enable / disable individual MCP servers
186
+
187
+ Both MCPs ship enabled by default. You can turn either one off independently.
188
+
189
+ ### OpenCode
190
+
191
+ The npm plugin reads two environment variables before registering MCPs:
192
+
193
+ | Env var | Effect |
194
+ |---|---|
195
+ | `DODO_DISABLE_API_MCP=1` | Skips registering `dodopayments-api` |
196
+ | `DODO_DISABLE_KNOWLEDGE_MCP=1` | Skips registering `dodo-knowledge` |
197
+
198
+ Truthy values: `1`, `true`, `yes`, `on` (case-insensitive). Export the var in your shell profile or set it inline:
199
+
200
+ ```bash
201
+ DODO_DISABLE_API_MCP=1 opencode
202
+ ```
203
+
204
+ ### Claude Code, Codex CLI, Cursor
205
+
206
+ These clients load MCPs from the static `.mcp.json` shipped with the plugin. To disable a server, override its entry in your own project-level config and set `"enabled": false`.
207
+
208
+ **Claude Code** - edit `.mcp.json` at your project root (or run `claude mcp disable dodopayments-api`):
209
+
210
+ ```json
211
+ {
212
+ "mcpServers": {
213
+ "dodopayments-api": {
214
+ "type": "stdio",
215
+ "command": "npx",
216
+ "args": ["-y", "mcp-remote@latest", "https://mcp.dodopayments.com/sse"],
217
+ "enabled": false
218
+ }
219
+ }
220
+ }
221
+ ```
222
+
223
+ Run `/reload-plugins` to apply.
224
+
225
+ **Codex CLI / Cursor** - the same `enabled: false` pattern works in any project-level `.mcp.json` that overrides the plugin's bundled file. Restart the client after editing.
226
+
227
+ > Per-MCP toggles inside the Claude Code `/plugin` UI are tracked upstream in [anthropics/claude-code#27105](https://github.com/anthropics/claude-code/issues/27105) and [#46373](https://github.com/anthropics/claude-code/issues/46373). Until those land, the `enabled: false` override above is the supported path.
228
+
149
229
  ## A prompt to try first
150
230
 
151
231
  Once the plugin is active, try:
@@ -1,6 +1,6 @@
1
1
  # @dodopayments/opencode-plugin
2
2
 
3
- Official OpenCode plugin for Dodo Payments. Ships eight integration skills and auto-registers two MCP servers.
3
+ Official OpenCode plugin for Dodo Payments. Ships seventeen integration skills and auto-registers two MCP servers.
4
4
 
5
5
  This package is part of [`dodopayments/dodo-agent-plugin`](https://github.com/dodopayments/dodo-agent-plugin) - the universal Dodo Payments plugin that also installs into Claude Code, Codex, and Cursor.
6
6
 
@@ -18,12 +18,12 @@ Add to your `opencode.json`:
18
18
  Restart OpenCode. That's it.
19
19
 
20
20
  - Both MCP servers are registered automatically via the plugin's `config` hook.
21
- - The eight skills are auto-discovered from this package's `skills/` directory.
21
+ - The seventeen skills are auto-discovered from this package's `skills/` directory.
22
22
  - The first call to `dodopayments-api` opens a browser for OAuth. `dodo-knowledge` needs no auth.
23
23
 
24
24
  ## What you get
25
25
 
26
- Eight agent skills (auto-loaded when relevant): `best-practices`, `checkout-integration`, `subscription-integration`, `webhook-integration`, `usage-based-billing`, `credit-based-billing`, `license-keys`, `billing-sdk`.
26
+ Seventeen agent skills (auto-loaded when relevant): `best-practices`, `framework-adapters`, `testing-and-go-live`, `checkout-integration`, `subscription-integration`, `mobile-checkout`, `webhook-integration`, `credit-based-billing`, `usage-based-billing`, `license-keys`, `product-catalog-management`, `discounts-and-promotions`, `localized-pricing`, `customer-management`, `refunds-and-disputes`, `billing-sdk`, `better-auth-integration`.
27
27
 
28
28
  Two MCP servers (registered automatically):
29
29
 
@@ -32,6 +32,25 @@ Two MCP servers (registered automatically):
32
32
  | `dodopayments-api` | Live API access (payments, subscriptions, customers, products, refunds, licenses, usage) | OAuth (browser) on first call |
33
33
  | `dodo-knowledge` | Semantic search over the Dodo Payments documentation | None |
34
34
 
35
+ ## Enable / disable individual MCP servers
36
+
37
+ Both MCPs ship enabled. To disable either one, set the matching env var to `1` (or `true`) before launching OpenCode:
38
+
39
+ | Env var | Effect |
40
+ |---|---|
41
+ | `DODO_DISABLE_API_MCP=1` | Skips registering `dodopayments-api` |
42
+ | `DODO_DISABLE_KNOWLEDGE_MCP=1` | Skips registering `dodo-knowledge` |
43
+
44
+ ```bash
45
+ # Disable just the API server (keep docs search)
46
+ DODO_DISABLE_API_MCP=1 opencode
47
+
48
+ # Disable both
49
+ DODO_DISABLE_API_MCP=1 DODO_DISABLE_KNOWLEDGE_MCP=1 opencode
50
+ ```
51
+
52
+ Persist the toggle by exporting the var in your shell profile or a project `.env` file your shell auto-loads. Truthy values: `1`, `true`, `yes`, `on` (case-insensitive). Anything else - including unset - keeps the MCP enabled.
53
+
35
54
  ## Overriding the defaults
36
55
 
37
56
  The plugin registers MCPs with nullish-assign semantics, so anything you declare in your own `opencode.json` wins. Example - swap the default remote OAuth server for the local stdio server with your own API key:
@@ -1,22 +1,13 @@
1
1
  // @dodopayments/opencode-plugin
2
- //
3
- // Registers the Dodo Payments MCP servers via OpenCode's `config` plugin
4
- // hook so users do not need to paste an `mcp: { ... }` block into their
5
- // `opencode.json`. The bundled skills/ directory is auto-discovered by
6
- // OpenCode separately.
7
- //
2
+ // Registers Dodo Payments MCP servers via OpenCode's `config` hook.
8
3
  // @see https://opencode.ai/docs/plugins
9
- // @see https://docs.dodopayments.com/developer-resources/agent-skills
10
4
 
11
5
  /**
12
6
  * @typedef {import("@opencode-ai/plugin").Plugin} Plugin
13
7
  */
14
8
 
15
- // OpenCode loads the user's opencode.json before invoking plugin `config`
16
- // hooks on the same mutable config object. Nullish-assign (`??=`) therefore
17
- // lets a user override any entry here by declaring the same key in their
18
- // own opencode.json - e.g. swapping the default remote OAuth server for the
19
- // local stdio `dodopayments-mcp` with their own API key.
9
+ // Nullish-assign (`??=`) lets users override any entry by declaring the
10
+ // same MCP key in their own opencode.json.
20
11
  const DODO_MCP_SERVERS = {
21
12
  "dodopayments-api": {
22
13
  type: "local",
@@ -30,11 +21,27 @@ const DODO_MCP_SERVERS = {
30
21
  },
31
22
  };
32
23
 
24
+ // Env vars chosen over opencode.json config because OpenCode's top-level
25
+ // schema is strict and rejects unknown keys (anomalyco/opencode#9161).
26
+ const DISABLE_FLAGS = {
27
+ "dodopayments-api": "DODO_DISABLE_API_MCP",
28
+ "dodo-knowledge": "DODO_DISABLE_KNOWLEDGE_MCP",
29
+ };
30
+
31
+ const TRUTHY = new Set(["1", "true", "yes", "on"]);
32
+
33
+ function isDisabled(envVarName) {
34
+ const raw = process.env[envVarName];
35
+ if (raw === undefined || raw === null || raw === "") return false;
36
+ return TRUTHY.has(String(raw).trim().toLowerCase());
37
+ }
38
+
33
39
  /** @type {Plugin} */
34
40
  const dodopayments = async () => ({
35
41
  config: async (config) => {
36
42
  config.mcp ??= {};
37
43
  for (const [name, entry] of Object.entries(DODO_MCP_SERVERS)) {
44
+ if (isDisabled(DISABLE_FLAGS[name])) continue;
38
45
  config.mcp[name] ??= entry;
39
46
  }
40
47
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dodopayments/opencode-plugin",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Dodo Payments skills and MCP server hints for OpenCode.",
5
5
  "type": "module",
6
6
  "main": "opencode-plugin/index.js",