Description
Problem: if Gemini CLI or Cursor's agent isn't installed, secfoo mcp sync --agent gemini (or --agent agent) crashes with a Python traceback (FileNotFoundError). _gemini_existing_names(), sync_gemini() and sync_cursor() call subprocess.run([...]) without checking that the binary exists.
Reproduce: add any [[mcp_servers]] entry to ~/.secfoo/config.toml, make sure gemini isn't on PATH, and run secfoo mcp sync --agent gemini.
Build: before syncing, check the binary with shutil.which (or get_adapter(agent_id).is_available()). If it's missing, return a single failed SyncResult such as gemini isn't installed (not found on PATH). The CLI already prints failed results and exits 1.
Where to look: src/secfoo/mcp.py (_gemini_existing_names, sync_gemini, sync_cursor), tests/test_mcp.py.
Done when: both agents print a one-line error and exit 1 instead of a traceback, and tests/test_mcp.py has a test for each, with the binary missing via monkeypatched shutil.which.
Activity