feat: gitignore .mcp.json on cce init#73
Merged
Conversation
.mcp.json carries an absolute path to the cce binary and a
project_dir argument — both differ on every contributor's machine.
Committing it forces everyone to share one path layout, which never
holds in practice (homedir paths, pipx vs uv vs pip installs, etc.).
`cce init` regenerates .mcp.json on every machine, so the right
default is to keep it out of version control alongside the other
per-machine entries (.cce/, .claude/settings.local.json).
Behaviour:
- Newly-init'd projects get .mcp.json in the managed CCE block of
.gitignore.
- Existing projects pick up the new entry on the next `cce init`
(ensure_gitignore is idempotent and only appends missing
entries — it never rewrites unrelated content).
- Projects that already explicitly listed .mcp.json don't get a
duplicate.
- Existing tracked .mcp.json files are not auto-untracked; that's
a manual `git rm --cached` decision the user makes.
Tests added:
- test_ignores_mcp_json: ensure_gitignore writes .mcp.json into a
fresh .gitignore.
- test_mcp_json_not_duplicated_if_user_already_ignored:
pre-existing entry is preserved without duplication.
rajkumarsakthivel
approved these changes
May 12, 2026
Member
rajkumarsakthivel
left a comment
There was a problem hiding this comment.
LGTM. Correct change, well-scoped.
.mcp.json has absolute paths that differ per machine, and cce init regenerates it. Gitignoring it is the right default. Tests cover both the fresh write and the dedup case. No breaking change for repos that already track it.
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.
Summary
`.mcp.json` carries an absolute path to the `cce` binary and a
`--project-dir` argument — both differ on every contributor's
machine. Committing it forces everyone to share one path layout, which
never holds in practice (homedir paths, pipx vs uv vs pip installs,
etc.).
`cce init` regenerates `.mcp.json` on every machine, so the right
default is to keep it out of version control alongside the other
per-machine entries (`.cce/`, `.claude/settings.local.json`).
Behaviour
`.gitignore`.
(`ensure_gitignore` is idempotent — it only appends missing
entries, never rewrites unrelated content).
duplicate.
that's a manual `git rm --cached` decision the user makes.
Tests
into a fresh `.gitignore`.
pre-existing entry is preserved without duplication.
Verification
Test plan
`.gitignore` under the CCE-managed block
`.mcp.json` listed — no duplicate entry
`.mcp.json` — file stays tracked (the user-driven
`git rm --cached .mcp.json` step is intentional)