Skip to content

Commit f82b3b9

Browse files
committed
fix: externalize @opencode-ai/plugin and zod to prevent bundled Zod v4 class conflict
Fixes #50 — bundled Zod v4 created duplicate class hierarchy causing TypeError: schema._zod is undefined on OpenCode 1.2.25+
1 parent 12f454b commit f82b3b9

File tree

3 files changed

+8
-41
lines changed

3 files changed

+8
-41
lines changed

README.md

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -143,49 +143,16 @@ opencode run "your prompt" --model cursor-acp/sonnet-4.5
143143

144144
## MCP Tool Bridge
145145

146-
The plugin bridges MCP (Model Context Protocol) servers into Cursor models via a `mcptool` CLI. Any MCP server configured in `opencode.json` becomes callable through cursor-agent's Shell tool.
147-
148-
### Configure MCP servers
149-
150-
Add to `~/.config/opencode/opencode.json`:
151-
152-
```json
153-
{
154-
"mcp": {
155-
"hybrid-memory": {
156-
"type": "local",
157-
"command": ["node", "/path/to/mcp-server.js"],
158-
"environment": {}
159-
},
160-
"playwright": {
161-
"type": "local",
162-
"command": ["npx", "-y", "@playwright/mcp", "--headless"],
163-
"environment": {}
164-
}
165-
}
166-
}
167-
```
168-
169-
### mcptool CLI
170-
171-
Installed automatically with the plugin:
146+
Any MCP servers already configured in your `opencode.json` work automatically with cursor-acp models — no extra setup needed. The plugin discovers them at startup and injects usage instructions into the system prompt so the model calls them via cursor-agent's Shell tool.
172147

173148
```bash
174-
mcptool servers # list configured servers
149+
mcptool servers # list discovered servers
175150
mcptool tools [server] # list available tools
176-
mcptool call hybrid-memory memory_stats # call a tool
151+
mcptool call hybrid-memory memory_stats # call a tool manually
177152
mcptool call playwright browser_navigate '{"url":"https://example.com"}'
178153
```
179154

180-
The model uses `mcptool` via Shell automatically — no manual intervention needed. The plugin injects usage instructions into the system prompt.
181-
182-
### Supported MCP servers
183-
184-
Any MCP server using stdio transport works. Tested with:
185-
- **hybrid-memory** — persistent memory with semantic search
186-
- **@modelcontextprotocol/server-filesystem** — file operations
187-
- **@playwright/mcp** — headless browser automation
188-
- **@modelcontextprotocol/server-everything** — MCP test/reference server
155+
Any MCP server using stdio transport works. Tested with hybrid-memory, @modelcontextprotocol/server-filesystem, @playwright/mcp, and @modelcontextprotocol/server-everything.
189156

190157
## Architecture
191158

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@rama_nigg/open-cursor",
3-
"version": "2.3.17",
3+
"version": "2.3.18",
44
"description": "No prompt limits. No broken streams. Full thinking + tool support. Your Cursor subscription, properly integrated.",
55
"type": "module",
66
"main": "dist/plugin-entry.js",
77
"module": "src/plugin-entry.ts",
88
"scripts": {
9-
"build": "bun build ./src/index.ts ./src/plugin-entry.ts ./src/cli/discover.ts ./src/cli/opencode-cursor.ts ./src/cli/mcptool.ts --outdir ./dist --target node",
10-
"dev": "bun build ./src/index.ts ./src/plugin-entry.ts ./src/cli/discover.ts ./src/cli/opencode-cursor.ts ./src/cli/mcptool.ts --outdir ./dist --target node --watch",
9+
"build": "bun build ./src/index.ts ./src/plugin-entry.ts ./src/cli/discover.ts ./src/cli/opencode-cursor.ts ./src/cli/mcptool.ts --outdir ./dist --target node --external @opencode-ai/plugin --external zod",
10+
"dev": "bun build ./src/index.ts ./src/plugin-entry.ts ./src/cli/discover.ts ./src/cli/opencode-cursor.ts ./src/cli/mcptool.ts --outdir ./dist --target node --watch --external @opencode-ai/plugin --external zod",
1111
"test": "bun test",
1212
"test:unit": "bun test tests/unit",
1313
"test:integration": "bun test tests/integration",

tests/unit/plugin-tools-hook.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ describe("Plugin tool hook", () => {
136136
} finally {
137137
rmSync(projectDir, { recursive: true, force: true });
138138
}
139-
});
139+
}, 15000);
140140

141141
it("executes shell alias and defaults cwd to context directory", async () => {
142142
const projectDir = mkdtempSync(join(tmpdir(), "plugin-hook-shell-"));

0 commit comments

Comments
 (0)