You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: secfoo mcp sync --agent agent crashes on a non-object ~/.cursor/mcp.json and drops its other keys #170
Problem:sync_cursor() handles ~/.cursor/mcp.json badly in two ways:
It reads the file with json.loads(...).get("mcpServers", {}). If the top level isn't a JSON object (for example []), that raises AttributeError and the user sees a traceback.
It writes back {"mcpServers": existing}, which drops every other top-level key the user had in that file.
Build:
Load the whole file. If the top level isn't an object, return a failed SyncResult that names the file (as the invalid-JSON branch does today).
Treat a mcpServers value that isn't an object the same way.
When writing, update only root["mcpServers"] and keep every other key.
Where to look:src/secfoo/mcp.py (sync_cursor), tests/test_mcp.py (test_sync_cursor_*).
Done when: there are new tests for (a) a top-level [], (b) "mcpServers": [], and (c) an extra top-level key kept after a sync, and the existing cursor tests still pass.
Activity