Ziel: ~/.config/opencode/opencode.json korrekt konfigurieren und alle 7 SIN-Code Tools als MCP registrieren.
Status: ✅ DONE (opencode.json valid, 7 tools registered) Aufwand: ~30 Minuten
NOTE (2026-06-02): This plan originally used the deprecated
mcpServerskey withtype: "stdio"andcommand: "/path"+args: ["--mcp"]. This was WRONG. opencode 1.15.11+ uses the legacymcpkey, with:
type: "local"(NOT "stdio")command: [array]with--mcpINSIDE the array (NOT inargs)enabled: true(required)The corrected config is below.
{
"mcp": {
"sin-discover": {
"type": "local",
"command": ["/Users/jeremy/.local/bin/discover", "--mcp"],
"enabled": true,
"description": "Discover files in a directory with relevance scoring"
},
"sin-execute": {
"type": "local",
"command": ["/Users/jeremy/.local/bin/execute", "--mcp"],
"enabled": true,
"description": "Execute shell commands safely with secret redaction"
},
"sin-map": {
"type": "local",
"command": ["/Users/jeremy/.local/bin/map", "--mcp"],
"enabled": true,
"description": "Map code architecture with dependency graphs"
},
"sin-grasp": {
"type": "local",
"command": ["/Users/jeremy/.local/bin/grasp", "--mcp"],
"enabled": true,
"description": "Deep code understanding for individual files"
},
"sin-scout": {
"type": "local",
"command": ["/Users/jeremy/.local/bin/scout", "--mcp"],
"enabled": true,
"description": "Search code with regex, semantic, and symbol search"
},
"sin-harvest": {
"type": "local",
"command": ["/Users/jeremy/.local/bin/harvest", "--mcp"],
"enabled": true,
"description": "Fetch URLs with caching and structure extraction"
},
"sin-orchestrate": {
"type": "local",
"command": ["/Users/jeremy/.local/bin/orchestrate", "--mcp"],
"enabled": true,
"description": "Manage tasks with dependencies and rollback plans"
}
}
}| Original (WRONG) | Correct (opencode 1.15.11+) | Why |
|---|---|---|
"mcpServers": {...} |
"mcp": {...} |
mcpServers is unrecognized key |
"type": "stdio" |
"type": "local" |
Schema only accepts local or remote |
"command": "/path" |
"command": ["/path", "--mcp"] |
Must be array; --mcp inside array |
"args": ["--mcp"] |
(no args — merge into command) | --mcp belongs in command array |
(missing) "enabled": true |
"enabled": true |
Required field |
Error produced by wrong config:
ConfigInvalidError: Unrecognized key: mcpServers
After implementation:
-
~/.config/opencode/opencode.jsonexists - JSON is valid
- All 7 tools are registered under
mcp(notmcpServers) - opencode recognizes the tools (verified via
opencode debug config) - Tools can be called via MCP stdio transport
Verification command:
# Verify config is valid (no mcpServers, has mcp)
python3 -c "
import json
d = json.load(open('/Users/jeremy/.config/opencode/opencode.json'))
assert 'mcp' in d
assert 'mcpServers' not in d
print('✅ opencode.json valid')
"
# Verify each tool responds to MCP initialize
for tool in discover execute map grasp scout harvest orchestrate; do
echo "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{}}" | \
/Users/jeremy/.local/bin/$tool --mcp | head -1
doneInfra-SIN-OpenCode-Stack/scripts/sync-opencode-config.sh— syncsmcpkey (NOTmcpServers)Infra-SIN-OpenCode-Stack/scripts/opencode-auto-sync.sh— syncsmcpkeyInfra-SIN-OpenCode-Stack/scripts/sync-local-opencode-configs.mjs— syncsmcpkeyInfra-SIN-OpenCode-Stack/opencode-config-install.sh— initializesmcp: {}(NOTmcpServers)
Last corrected: 2026-06-02