Skip to content

feat(mcp): add OpenCode MCP sync verified against opencode v2.2.5 (#124) - #239

Open
Sanjai-Gopal wants to merge 1 commit into
secfoo-com:mainfrom
Sanjai-Gopal:feat/mcp-opencode-124
Open

Sanjai-Gopal wants to merge 1 commit into
secfoo-com:mainfrom
Sanjai-Gopal:feat/mcp-opencode-124

Conversation

@Sanjai-Gopal

Copy link
Copy Markdown

Part of #124

Summary

  • Added sync_opencode() and opencode_config_path() in src/secfoo/mcp.py, resolving $OPENCODE_CONFIG, $XDG_CONFIG_HOME/opencode/opencode.json, or ~/.config/opencode/opencode.json.
  • Verified the opencode.json schema directly against opencode v2.2.5: servers live under mcp.servers.<name> with type: "local" (command: [...], environment) for stdio and type: "remote" (url, headers) for HTTP/SSE.
  • Preserves existing user settings and unrelated servers, skips already-configured entries, rejects malformed JSON/non-object config sections cleanly, and writes config files with 0600 permissions.
  • Updated SYNC_SUPPORTED_AGENTS, CANONICAL_MCP_SUPPORT["opencode"] (mechanism="sync"), docs/REFERENCE.md, and docs/agents.md.

Testing

  • Verified opencode v2.2.5 opencode mcp add --global config path and JSON shape locally.
  • pytest tests/test_mcp.py tests/test_cli.py tests/test_docs_consistency.py -q: 132 passed, 4 skipped (POSIX-only permission checks on Windows).
  • ruff check . and bandit -r src/secfoo -c .bandit -ll -q: passed.

@Sanjai-Gopal
Sanjai-Gopal requested a review from vsn411 as a code owner December 3, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant