@dodopayments/opencode-plugin 0.2.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 ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "mcpServers": {
3
+ "dodopayments-api": {
4
+ "type": "stdio",
5
+ "command": "npx",
6
+ "args": [
7
+ "-y",
8
+ "mcp-remote@latest",
9
+ "https://mcp.dodopayments.com/sse"
10
+ ]
11
+ },
12
+ "dodo-knowledge": {
13
+ "type": "stdio",
14
+ "command": "npx",
15
+ "args": [
16
+ "-y",
17
+ "mcp-remote@latest",
18
+ "https://knowledge.dodopayments.com/mcp"
19
+ ]
20
+ }
21
+ }
22
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dodo Payments
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,195 @@
1
+ # Dodo Payments Agent Plugin
2
+
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)
5
+ [![npm](https://img.shields.io/npm/v/@dodopayments/opencode-plugin.svg?style=flat-square)](https://www.npmjs.com/package/@dodopayments/opencode-plugin)
6
+ [![Discord](https://img.shields.io/discord/1305511580854779984?label=discord&style=flat-square)](https://discord.gg/bYqAp4ayYh)
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.
9
+
10
+ ## What you get
11
+
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
+ - **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.
15
+
16
+ ## Install
17
+
18
+ ### Claude Code
19
+
20
+ ```bash
21
+ claude plugins marketplace add dodopayments/dodo-agent-plugin
22
+ claude plugins install dodopayments@dodopayments
23
+ ```
24
+
25
+ The API MCP server uses browser OAuth by default, so no keys are required at install time. The first time your agent calls a Dodo tool, you'll be prompted to sign in.
26
+
27
+ ### Codex CLI
28
+
29
+ Codex reads `.claude-plugin/marketplace.json` natively, so the same repo works:
30
+
31
+ ```bash
32
+ codex plugin marketplace add dodopayments/dodo-agent-plugin
33
+ codex plugin install dodopayments@dodopayments
34
+ ```
35
+
36
+ ### Cursor
37
+
38
+ Manual install:
39
+
40
+ ```bash
41
+ git clone https://github.com/dodopayments/dodo-agent-plugin.git ~/.cursor/plugins/local/dodo-agent-plugin
42
+ ```
43
+
44
+ Restart Cursor. The plugin loads skills from `.claude/skills/` (via Cursor's Claude Code compat) and MCP servers from `.mcp.json`.
45
+
46
+ ### OpenCode
47
+
48
+ OpenCode distributes via npm. Add to your `opencode.json`:
49
+
50
+ ```jsonc
51
+ {
52
+ "$schema": "https://opencode.ai/config.json",
53
+ "plugin": ["@dodopayments/opencode-plugin"],
54
+ "mcp": {
55
+ "dodopayments-api": {
56
+ "type": "local",
57
+ "command": ["npx", "-y", "mcp-remote@latest", "https://mcp.dodopayments.com/sse"],
58
+ "enabled": true
59
+ },
60
+ "dodo-knowledge": {
61
+ "type": "local",
62
+ "command": ["npx", "-y", "mcp-remote@latest", "https://knowledge.dodopayments.com/mcp"],
63
+ "enabled": true
64
+ }
65
+ }
66
+ }
67
+ ```
68
+
69
+ OpenCode auto-discovers the eight skills from the installed package. Restart OpenCode to pick up the new config.
70
+
71
+ ## Included Skills
72
+
73
+ | Skill | Description |
74
+ |-------|-------------|
75
+ | `best-practices` | Comprehensive guide to integrating Dodo Payments with best practices |
76
+ | `checkout-integration` | Creating checkout sessions and payment flows |
77
+ | `subscription-integration` | Implementing subscription billing flows |
78
+ | `webhook-integration` | Setting up and handling webhooks for payment events |
79
+ | `usage-based-billing` | Implementing metered billing with events and meters |
80
+ | `credit-based-billing` | Credit entitlements, balances, and metered credit deduction |
81
+ | `license-keys` | Managing license keys for digital products |
82
+ | `billing-sdk` | Using BillingSDK React components |
83
+
84
+ Skills source: [`dodopayments/skills`](https://github.com/dodopayments/skills) (bundled as a git submodule in `skills-src/`).
85
+
86
+ ## Included MCP Servers
87
+
88
+ | Server | Purpose | Auth |
89
+ |--------|---------|------|
90
+ | `dodopayments-api` | Live API access (payments, subscriptions, customers, products, refunds, licenses, usage) | OAuth (browser) |
91
+ | `dodo-knowledge` | Semantic search over the Dodo Payments documentation | None |
92
+
93
+ Both servers are wired through `mcp-remote` so they run in any MCP-compatible client.
94
+
95
+ ## Configure (optional, Claude Code)
96
+
97
+ If you prefer to run the API MCP locally with an API key instead of the remote SSE server, open `/plugins` in Claude Code, select **Dodo Payments**, and choose **Configure options**. Fill in:
98
+
99
+ - `dodo_api_key` - your `dodo_test_...` or `dodo_live_...` key
100
+ - `dodo_webhook_key` - your webhook signing secret
101
+ - `dodo_environment` - `test_mode` or `live_mode`
102
+
103
+ Then edit `.mcp.json` to point `dodopayments-api` at the local stdio server:
104
+
105
+ ```json
106
+ {
107
+ "mcpServers": {
108
+ "dodopayments-api": {
109
+ "type": "stdio",
110
+ "command": "npx",
111
+ "args": ["-y", "dodopayments-mcp@latest"],
112
+ "env": {
113
+ "DODO_PAYMENTS_API_KEY": "${user_config.dodo_api_key}",
114
+ "DODO_PAYMENTS_WEBHOOK_KEY": "${user_config.dodo_webhook_key}",
115
+ "DODO_PAYMENTS_ENVIRONMENT": "${user_config.dodo_environment}"
116
+ }
117
+ }
118
+ }
119
+ }
120
+ ```
121
+
122
+ Run `/reload-plugins` to apply changes to your current session.
123
+
124
+ ## A prompt to try first
125
+
126
+ Once the plugin is active, try:
127
+
128
+ ```
129
+ Set up Dodo Payments webhook handlers in my Next.js app for payment.succeeded and subscription.active events.
130
+ ```
131
+
132
+ Your agent will load the `webhook-integration` skill, use the `dodo-knowledge` MCP to pull the latest payload shapes, and write a handler with signature verification following the Standard Webhooks spec.
133
+
134
+ ## Local development
135
+
136
+ Clone with the skills submodule:
137
+
138
+ ```bash
139
+ git clone --recurse-submodules https://github.com/dodopayments/dodo-agent-plugin.git
140
+ cd dodo-agent-plugin
141
+ ```
142
+
143
+ Validate the Claude Code plugin and marketplace:
144
+
145
+ ```bash
146
+ claude plugin validate .
147
+ ```
148
+
149
+ Load the plugin directly for a dev session:
150
+
151
+ ```bash
152
+ claude --plugin-dir ./dodo-agent-plugin
153
+ ```
154
+
155
+ Refresh the bundled skills to the latest upstream version:
156
+
157
+ ```bash
158
+ git submodule update --remote skills-src
159
+ ```
160
+
161
+ ## For maintainers
162
+
163
+ The repo is configured to publish the OpenCode npm package on every GitHub Release.
164
+
165
+ **One-time setup (already done for this repo):**
166
+
167
+ - npm scope `@dodopayments` exists and is owned by Dodo Payments.
168
+ - GitHub Actions secret `NPM_TOKEN` is provisioned with publish rights to the `@dodopayments` scope.
169
+
170
+ **Release workflow:**
171
+
172
+ 1. Bump the version in `.claude-plugin/plugin.json`.
173
+ 2. Run `node scripts/sync-manifests.mjs` to propagate the version to Cursor, Codex, npm, and marketplace manifests.
174
+ 3. Commit and tag.
175
+ 4. Create a GitHub Release - the `Publish @dodopayments/opencode-plugin` workflow runs automatically and publishes to npm with provenance.
176
+
177
+ **Manual dry-run:**
178
+
179
+ - Workflow dispatch with `dry_run: true` to validate the release pipeline without publishing.
180
+
181
+ **CI check:**
182
+
183
+ - `node scripts/sync-manifests.mjs --check` is run by the workflow and fails the release if any manifest is out of sync.
184
+
185
+ ## Resources
186
+
187
+ - [Dodo Payments documentation](https://docs.dodopayments.com)
188
+ - [Agent Skills docs](https://docs.dodopayments.com/developer-resources/agent-skills)
189
+ - [MCP Server docs](https://docs.dodopayments.com/developer-resources/mcp-server)
190
+ - [Skills source repo](https://github.com/dodopayments/skills)
191
+ - [Discord community](https://discord.gg/bYqAp4ayYh)
192
+
193
+ ## License
194
+
195
+ MIT - see [LICENSE](./LICENSE).
@@ -0,0 +1,42 @@
1
+ # @dodopayments/opencode-plugin
2
+
3
+ OpenCode plugin that ships the Dodo Payments agent skills and references the Dodo Payments API and docs MCP servers.
4
+
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
+
7
+ ## Install
8
+
9
+ Add to your `opencode.json`:
10
+
11
+ ```jsonc
12
+ {
13
+ "$schema": "https://opencode.ai/config.json",
14
+ "plugin": ["@dodopayments/opencode-plugin"],
15
+ "mcp": {
16
+ "dodopayments-api": {
17
+ "type": "local",
18
+ "command": ["npx", "-y", "mcp-remote@latest", "https://mcp.dodopayments.com/sse"],
19
+ "enabled": true
20
+ },
21
+ "dodo-knowledge": {
22
+ "type": "local",
23
+ "command": ["npx", "-y", "mcp-remote@latest", "https://knowledge.dodopayments.com/mcp"],
24
+ "enabled": true
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ Then restart OpenCode. The eight Dodo Payments skills are auto-discovered from this package's `skills/` directory.
31
+
32
+ ## What you get
33
+
34
+ - **Eight agent skills** (auto-loaded by OpenCode when relevant):
35
+ - `best-practices`, `checkout-integration`, `subscription-integration`, `webhook-integration`, `usage-based-billing`, `credit-based-billing`, `license-keys`, `billing-sdk`.
36
+ - **Two referenced MCP servers** (you configure them in `opencode.json` as shown above):
37
+ - `dodopayments-api` - live API access via OAuth.
38
+ - `dodo-knowledge` - semantic search over Dodo Payments documentation.
39
+
40
+ ## License
41
+
42
+ MIT. See [LICENSE](../LICENSE).
@@ -0,0 +1,30 @@
1
+ // @dodopayments/opencode-plugin
2
+ //
3
+ // OpenCode plugin entry point for Dodo Payments.
4
+ //
5
+ // This plugin exists to make `@dodopayments/opencode-plugin` installable
6
+ // from npm so users can reference it in their `opencode.json` "plugin" array.
7
+ // It registers no runtime hooks - the value of this package is:
8
+ //
9
+ // 1. The bundled skills/ directory (OpenCode auto-discovers SKILL.md files
10
+ // from installed packages, so the 8 Dodo Payments skills become
11
+ // available once this package is installed).
12
+ //
13
+ // 2. The documented .mcp.json and opencode.json reference snippets, so
14
+ // users know exactly which MCP servers to add to their config.
15
+ //
16
+ // If future versions of this plugin need runtime behavior (e.g. injecting
17
+ // Dodo-specific tools, hooking chat.message, etc.), add them to the returned
18
+ // Hooks object. All Hooks fields are optional - see @opencode-ai/plugin types.
19
+ //
20
+ // @see https://opencode.ai/docs/plugins
21
+ // @see https://docs.dodopayments.com/developer-resources/agent-skills
22
+
23
+ /**
24
+ * @typedef {import("@opencode-ai/plugin").Plugin} Plugin
25
+ */
26
+
27
+ /** @type {Plugin} */
28
+ const dodopayments = async () => ({});
29
+
30
+ export default dodopayments;
package/opencode.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://opencode.ai/config.json",
3
+ "plugin": [
4
+ "@dodopayments/opencode-plugin"
5
+ ],
6
+ "mcp": {
7
+ "dodopayments-api": {
8
+ "type": "local",
9
+ "command": [
10
+ "npx",
11
+ "-y",
12
+ "mcp-remote@latest",
13
+ "https://mcp.dodopayments.com/sse"
14
+ ],
15
+ "enabled": true
16
+ },
17
+ "dodo-knowledge": {
18
+ "type": "local",
19
+ "command": [
20
+ "npx",
21
+ "-y",
22
+ "mcp-remote@latest",
23
+ "https://knowledge.dodopayments.com/mcp"
24
+ ],
25
+ "enabled": true
26
+ }
27
+ }
28
+ }
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@dodopayments/opencode-plugin",
3
+ "version": "0.2.0",
4
+ "description": "Dodo Payments skills and MCP server hints for OpenCode.",
5
+ "type": "module",
6
+ "main": "opencode-plugin/index.js",
7
+ "exports": {
8
+ ".": "./opencode-plugin/index.js"
9
+ },
10
+ "files": [
11
+ "opencode-plugin/",
12
+ "skills/",
13
+ ".mcp.json",
14
+ "opencode.json",
15
+ "LICENSE"
16
+ ],
17
+ "scripts": {
18
+ "sync": "node scripts/sync-manifests.mjs",
19
+ "sync:check": "node scripts/sync-manifests.mjs --check",
20
+ "prepack": "node scripts/build-skills-for-npm.mjs materialize",
21
+ "postpack": "node scripts/build-skills-for-npm.mjs restore && git checkout skills/"
22
+ },
23
+ "keywords": [
24
+ "opencode",
25
+ "opencode-plugin",
26
+ "dodopayments",
27
+ "payments",
28
+ "billing",
29
+ "subscriptions",
30
+ "mcp",
31
+ "skills"
32
+ ],
33
+ "author": "Dodo Payments <support@dodopayments.com>",
34
+ "license": "MIT",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/dodopayments/dodo-agent-plugin.git"
38
+ },
39
+ "homepage": "https://docs.dodopayments.com/developer-resources/agent-skills",
40
+ "bugs": "https://github.com/dodopayments/dodo-agent-plugin/issues",
41
+ "peerDependencies": {
42
+ "@opencode-ai/plugin": ">=1.0.0"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "@opencode-ai/plugin": {
46
+ "optional": true
47
+ }
48
+ },
49
+ "publishConfig": {
50
+ "access": "public",
51
+ "provenance": true
52
+ }
53
+ }