Files
orca/opencode.json
T
Brennan BensonandAnubhav Banerjee a62fbb4229 Give OpenCode the component fixtures MCP server (#42208)
* Give OpenCode the component fixtures MCP server

The repository registered orca-component-fixtures only in .mcp.json, so
Claude Code got the fixture tools and OpenCode did not. opencode.json
already mirrors the repo's TypeScript language server for OpenCode; it
now registers the same fixtures server, in the per-server form the rest
of the file uses, which OpenCode 1.x reads and OpenCode 2 migrates.

Tracked in #41836 (STA-15139).

Co-authored-by: Anubhav Banerjee <76914348+Anubhav-2003@users.noreply.github.com>

* Find the fixtures server from any OpenCode start folder

OpenCode reads opencode.json from the nearest ancestor but starts MCP
servers in the folder it was launched from, so a relative script path
failed outside the repository root. Walk up to the script and import it.

---------

Co-authored-by: Anubhav Banerjee <76914348+Anubhav-2003@users.noreply.github.com>
2026-11-13 17:19:10 -08:00

38 lines
1.2 KiB
JSON

{
"$schema": "https://opencode.ai/config.json",
"permission": {
"*": {
"*": "allow"
},
"read": {
"*.env": "ask",
"*.env.*": "ask",
"*.env.example": "allow"
},
"external_directory": {
"*": "ask"
},
"doom_loop": "ask"
},
"lsp": {
"typescript": {
"disabled": true
},
"orca-typescript": {
"command": ["node", "config/scripts/typecheck/language-server/agent-typescript-lsp.mjs"],
"extensions": [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"]
}
},
"mcp": {
"orca-component-fixtures": {
"type": "local",
"command": [
"node",
"--input-type=module",
"-e",
"import { existsSync } from 'node:fs'; import { dirname, join } from 'node:path'; import { pathToFileURL } from 'node:url'; let dir = process.cwd(); for (;;) { const file = join(dir, 'config/scripts/component-fixtures/fixtures-mcp-server.mjs'); if (existsSync(file)) { await import(pathToFileURL(file).href); break; } const parent = dirname(dir); if (parent === dir) throw new Error('Cannot find the component fixtures server'); dir = parent; }"
]
}
}
}