TL;DR: faf_gemini and faf_agents keep your hand-written GEMINI.md and AGENTS.md, and tell you what they couldn't write.
In Plain English
Old state. gemini-faf-mcp had its own copy of the code that writes faf's block into GEMINI.md and AGENTS.md. In a few cases it cut hand-written lines, then replied "existing content preserved" either way.
Fix. It now follows faf-cli's rules, the same ones faf-cli, faf-mcp, claude-faf-mcp and grok-faf-mcp use. faf replaces only the block between its own marker lines. Everything else in the file is yours.
New state. Run faf_gemini or faf_agents any time.
Your lines stay. A file faf can't safely write is left exactly as it was, and the reply says
why.
What happened since The New Era Edition
Last write-up was The New Era Edition, for Gemini (v3.1.0). Short tour to today:
- 3.1.1 —
gemini-faf-mcp --versionand--helpanswer and exit, instead of starting the server. - 3.1.2 —
faf_geminiandfaf_agentskeep your hand-written files. This post.
Why it matters if you use Gemini CLI or Antigravity
GEMINI.md is where you tell Gemini how your project works: which tests to run,
what not to touch, how you like things done. AGENTS.md does the same for every
other agent. A context tool that can cut those is worse than none.
- Safe to run. Ask Gemini to update the files without checking them first.
- No surprises. If a file can't be written, the reply says which one and why.
- Quiet git diffs. A second run leaves one faf block, so your history only shows real changes.
What 3.1.2 is
faf writes its block between two marker lines, <!-- faf:start --> and <!-- faf:end -->. faf replaces only text it can prove it wrote. A matching pair of marker lines means only what's between them is updated. Without one, faf
puts its block on top and keeps everything else.
| When your file… | Before | Now |
|---|---|---|
| starts with a line that looks like faf's | treated as faf's own, replaced | never reclaimed; every line kept |
| has a start marker but no end marker | everything after it was cut | nothing cut |
| mentions the markers in its text or a code example | the wrong part could be replaced | only whole marker lines outside code count |
| isn't UTF-8, or links out of the project | rewritten or written through | left exactly as it was; the reply says why |
Writes land in one step, and keep the file's permissions, Windows line endings and a leading
BOM. The /faf:export command no longer asks Gemini to write the files itself; the
tools do it.
How we got it right
- An audit of the five FAF MCP servers found the problem, with exact reproductions.
- We fixed it once, in faf-cli's rules, then ported those rules to Python with the audit's cases as tests. Independent reviews followed, and their findings were fixed before release.
- After publishing, we ran 3.1.2 from PyPI on a clean machine: a marker quoted in prose ignored, a second run idempotent, a non-UTF-8 file and a link out of the project both refused and left untouched. 0 findings.
Full suite on the release: 308 tests pass, 0 fail.
Not claimed
- A refusal comes back as
success: falsewith the reason, like every gemini-faf-mcp error. It doesn't set MCP'sisErrorflag. - The fix is in the local package (
uvx), the one that writes your files.
Try it
Gemini CLI:
gemini extensions install https://github.com/Wolfe-Jam/gemini-faf-mcpAntigravity, or any client that runs a local MCP server:
{ "mcpServers": { "gemini-faf": { "command": "uvx", "args": ["gemini-faf-mcp==3.1.2"] } } }Claude Code:
claude mcp add gemini-faf-mcp -- uvx gemini-faf-mcp==3.1.2Then ask Gemini to run faf_gemini or faf_agents.
Technical details
- Version: gemini-faf-mcp 3.1.2 (November 5, 2026), The New Era Edition
- Where: PyPI · the MCP Registry
- Changes: #45 · release notes
Feedback welcome
Questions, nits, suggestions — guide the next version. Tell us what you want to see.