-
-
Notifications
You must be signed in to change notification settings - Fork 61
docs: support OpenCode and other MCP clients #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Working with FableCut | ||
|
|
||
| The complete agent manual is in [CLAUDE.md](CLAUDE.md). Read it before changing the project schema, using the MCP tools, or editing the timeline. This file exists so agents that look for the cross-tool `AGENTS.md` convention, including OpenCode and Codex, find the same source of truth without duplicating it. | ||
|
|
||
| ## Project constraints | ||
|
|
||
| - Keep FableCut zero-runtime-dependency and standard-library only. | ||
| - Keep preview and export on the same compositor path. | ||
| - Prefer small, focused changes and preserve the existing terse browser-native style. | ||
| - If a schema, prop, text animation, API, or MCP surface changes, update `CLAUDE.md` and the English `README.md` in the same change. | ||
| - Run `node --check server.js && node --check app.js && node --check mcp-server.js` before opening a PR. | ||
|
|
||
| ## MCP entry point | ||
|
|
||
| The local MCP server is `mcp-server.js`. It can be started by any stdio-capable MCP client: | ||
|
|
||
| ```bash | ||
| node /absolute/path/to/FableCut/mcp-server.js | ||
| ``` | ||
|
|
||
| Use the existing `CLAUDE.md` recipes and tool descriptions rather than inventing a second protocol or schema. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -229,6 +229,39 @@ Three equivalent control surfaces: | |
| claude mcp add -s user fablecut -- node "<path-to>/fablecut/mcp-server.js" | ||
| ``` | ||
|
|
||
| **OpenCode** can use the same stdio server from its project or global | ||
| `opencode.json` configuration: | ||
|
|
||
| ```json | ||
| { | ||
| "$schema": "https://opencode.ai/config.json", | ||
| "mcp": { | ||
| "fablecut": { | ||
| "type": "local", | ||
| "command": ["node", "/absolute/path/to/FableCut/mcp-server.js"], | ||
| "enabled": true | ||
| } | ||
|
Comment on lines
+238
to
+243
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: sed -n '225,250p' README.mdRepository: ronak-create/FableCut Length of output: 900 🌐 Web query:
💡 Result: In OpenCode V2, Model Context Protocol (MCP) servers are managed within the configuration file under the mcp.servers section [1]. To disable a specific MCP server, you must set the disabled property to true within that server's configuration block [1]. Key details regarding this configuration include: - Default Behavior: Servers connect automatically unless the disabled field is explicitly set to true [1]. - No Enabled Field: V2 does not utilize an enabled field; control is achieved solely by toggling the disabled status [1]. - Configuration: You should edit the configuration file directly to update these settings, as there is no specific CLI flag for disabling an existing server [1]. Example configuration structure: mcp: servers: my-server-name: type: "local" command: "npx" args: ["-y", " Citations: 🌐 Web query:
💡 Result: For a local MCP server, use {
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"my-server": {
"type": "local",
"command": ["npx", "-y", "my-mcp-server"],
"cwd": ".",
"environment": {
"API_KEY": "{env:API_KEY}"
}
}
}
}
}
Note: current v2 documentation uses Citations:
🏁 Script executed: python3 - <<'PY'
from urllib.request import urlopen
url = "https://opencode.ai/v2/docs/mcp-servers"
text = urlopen(url, timeout=10).read().decode()
for term in ("mcp", "servers", "disabled", "enabled", "command"):
print(f"{term}: {text.lower().find(term)}")
print(text[:20000])
PYRepository: ronak-create/FableCut Length of output: 2445 Update the OpenCode example to use OpenCode V2 requires local MCP servers under 🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
| ``` | ||
|
|
||
| For another MCP client, register a local stdio server with this equivalent | ||
| command. The exact key names vary by client, but the command and arguments | ||
| do not: | ||
|
|
||
| ```json | ||
| { | ||
| "name": "fablecut", | ||
| "transport": "stdio", | ||
| "command": "node", | ||
| "args": ["/absolute/path/to/FableCut/mcp-server.js"] | ||
| } | ||
| ``` | ||
|
Comment on lines
+248
to
+259
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- candidate files ---'
git ls-files | rg '(^|/)(README\.md|CLAUDE\.md)$'
printf '%s\n' '--- README.md 220-280 ---'
cat -n README.md | sed -n '220,280p'
printf '%s\n' '--- CLAUDE.md outline/size ---'
wc -l CLAUDE.md
ast-grep outline CLAUDE.md 2>/dev/null || true
printf '%s\n' '--- CLAUDE.md MCP/client references ---'
rg -n -i -C 4 'MCP|client|stdio|transport|fablecut|command|args' CLAUDE.mdRepository: ronak-create/FableCut Length of output: 9938 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- documentation/config references ---'
rg -n -i -C 3 'mcpServers|opencode|transport|stdio|"name"|"args"|mcp-server\.js|Claude Desktop|Claude Code' \
README.md CLAUDE.md .github 2>/dev/null || true
printf '%s\n' '--- candidate MCP/config files ---'
git ls-files | rg -i '(^|/)(mcp-server|package(-lock)?|.*config.*|.*mcp.*|.*opencode.*)|(^|/)(README|CLAUDE)\.md$'
printf '%s\n' '--- mcp-server.js outline and selected source ---'
ast-grep outline mcp-server.js 2>/dev/null || true
wc -l mcp-server.js
cat -n mcp-server.js | sed -n '1,180p'
printf '%s\n' '--- package metadata ---'
for f in package.json package-lock.json; do
if [ -f "$f" ]; then
echo "### $f"
cat -n "$f" | sed -n '1,180p'
fi
doneRepository: ronak-create/FableCut Length of output: 23236 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- checked-in MCP configuration ---'
cat -n .mcp.json
printf '%s\n' '--- MCP protocol handling ---'
cat -n mcp-server.js | sed -n '430,496p'
printf '%s\n' '--- all configuration-shaped JSON files and relevant keys ---'
for f in $(git ls-files '*.json' | sort); do
case "$f" in
node_modules/*|dist/*|build/*) continue ;;
esac
if rg -q '"(mcpServers|transport|type|command|args|name)"' "$f"; then
echo "### $f"
rg -n -C 2 '"(mcpServers|transport|type|command|args|name)"' "$f"
fi
doneRepository: ronak-create/FableCut Length of output: 7760 Replace the generic MCP object with a named client configuration. Use the existing Claude Desktop recipe from 🤖 Prompt for AI AgentsSource: Learnings |
||
|
|
||
| The server is intentionally client-neutral. It speaks MCP over stdio and | ||
| does not require Claude-specific environment variables. Keep the path | ||
| absolute, and use Node 18 or newer. | ||
|
|
||
| Tools: `fablecut_status` (auto-starts the editor), `fablecut_docs`, | ||
| `fablecut_get_project`, `fablecut_set_project`, `fablecut_patch_project`, | ||
| `fablecut_import_media`, `fablecut_analyze_reference`. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Quote the MCP server path in the shell example.
If the repository path contains spaces, the unquoted path is split into multiple arguments and Node cannot start the server.
Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents