Repository navigation
feat(mcp): register MCP servers with every supported CLI agent (Codex, Copilot, OpenCode, Droid, Devin) - #190
Closed
saryeljaramany wants to merge 5 commits into
Closed
saryeljaramany wants to merge 5 commits into
saryeljaramany wants to merge 5 commits into
Conversation
Collaborator
|
Thanks for coming back to #124 with a rewrite. It's a clear improvement on #164:
We're closing this PR without merging because it can't land in its current state. #124 stays open, and a fresh PR from current Blocking
Should fix
Suggested way forwardSplitting this would make review much faster:
Thanks again. The security notes in the description were especially useful, and we'd be glad to review the follow-up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #124
Summary
claudestays per-run.gemini,agent(Cursor),codex,copilot,opencode,droidanddevinare registered withsecfoo mcp sync.secfoo agentshas a new MCP column. The support matrix has one source of truth in code (CANONICAL_MCP_SUPPORT); only the test suite readsdocs/REFERENCE.md, to catch drift.Behaviour
secfoo mcp syncwithout--agentsyncs only installed CLIs, so it never creates~/.codex,~/.copilot,~/.factoryor~/.config/{opencode,devin}on machines without them.0600. A failedchmodlogs a warning.geminiis registered throughgemini mcp add, so Gemini's own CLI performs that write.~/.codex/config.tomlis edited withtomlkit(comments, datetimes, empty tables and existing line endings preserved). Remote servers useurl+http_headerswith notransportkey. SSE servers are reported as unsupported.disabled: true); they report "already configured, skipped". Ifagent mcp enablecan't run, the file is still written and the result is marked failed.sseto"type": "sse". Non-object JSON roots and non-tablemcp_serversraise a clean error instead of aTypeError.Per-run vs sync
Only
claudeis per-run. For the other agents, secfoo's adapters currently pass no MCP configuration per run. I did not evaluate upstream per-run mechanisms for Codex/Copilot/OpenCode/Droid/Devin. For Codex I deliberately avoided-coverrides because command, URL and header values would appear in the process table. Per-run support is a possible follow-up.Verification status
Verified on a real CLI
claude2.1.312on Windows: detected as available (per-run) insecfoo agentsand skipped cleanly bysecfoo mcp syncsince per-run--mcp-configis automatic onsecfoo run.Unit-tested only (shapes follow vendor docs; not exercised against the real CLI)
codex,copilot,opencode,droid,devin,agent(Cursor),gemini.opencode run --pure.~/.config/devin/mcp_config.json/%APPDATA%\devin\mcp_config.jsonpath and Droid's~/.factory/mcp.jsonshape are unverified.Not supported
agy: no MCP mechanism is documented; not re-verified against a current release.api: no tool loop.A maintainer with these CLIs installed confirming that synced servers load would be very welcome.
Security notes
syncstores secrets in plaintext at rest (0600). On Windows, 0600 is a no-op, so the permission tests run on POSIX only.--allowedTools mcp__<server>grants all tools on that server, including write tools. Use read-only tokens or per-tool allowlists.tools: ["*"]and non-interactive runs use--allow-all-tools, so read-only behaviour relies on the review prompt, not a sandbox.--sandbox read-only; OpenCode permissions are set through its permission settings. For remote servers, use read-only credentials in every case.Testing
ruff checkclean on all changed Python files,ruff format --checkclean onsrc/secfoo/mcp.py,tests/test_cli.py, andtests/test_mcp.py, andpytest tests/test_mcp.py tests/test_cli.py: 120 passed.Review history
Re-implemented from clean
mainafter the first attempt was closed, addressing each point of the earlier review.AI assistance was used to draft parts of this; I reviewed the diff and ran the tests myself.