Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/context_engine/project_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ def remove_preference(project_dir: str, key: str) -> bool:
# CCE local cache and per-machine files
(".cce/", "CCE local cache (per-machine, not for version control)"),
(".claude/settings.local.json", "Claude Code local settings written by cce init"),
# `.mcp.json` carries an absolute path to the `cce` binary (different
# on each contributor's machine) and a project_dir argument that's
# also absolute. Committing it would force every contributor to
# share one path layout, which never holds. `cce init` regenerates
# it on each machine, so gitignoring it is the correct default.
(".mcp.json", ".mcp.json contains absolute paths regenerated by `cce init`"),
]


Expand Down
15 changes: 15 additions & 0 deletions tests/test_project_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,21 @@ def test_doesnt_duplicate_if_present(self, tmp_path):
content = (tmp_path / ".gitignore").read_text()
assert content.count(".cce/") == 1

def test_ignores_mcp_json(self, tmp_path):
"""`.mcp.json` contains absolute paths and is regenerated by
`cce init` on each machine — must be in the managed
gitignore block so contributors don't accidentally commit
each other's path layouts."""
ensure_gitignore(str(tmp_path))
content = (tmp_path / ".gitignore").read_text()
assert ".mcp.json" in content

def test_mcp_json_not_duplicated_if_user_already_ignored(self, tmp_path):
(tmp_path / ".gitignore").write_text(".mcp.json\nnode_modules/\n")
ensure_gitignore(str(tmp_path))
content = (tmp_path / ".gitignore").read_text()
assert content.count(".mcp.json") == 1


# ── Edge cases ─────────────────────────────────────────────────────────

Expand Down
Loading