feat(mcp): expose home and fs root scanning options - #720
Merged
dmtrKovalenko merged 1 commit intoJul 29, 2026
Merged
Conversation
fff-core gates indexing of $HOME and / behind enable_home_dir_scanning and enable_fs_root_scanning, and every other surface (C, python, nvim, node/bun) exposes them. fff-mcp did not, so it aborts at startup whenever an editor or agent launches it from a home directory. Add --enable-home-scan and --enable-root-scan, also settable via FFF_ENABLE_HOME_SCAN and FFF_ENABLE_ROOT_SCAN. Both default off, so the guard is unchanged unless opted into.
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.
Closes #588 for the MCP surface.
fff-coregates indexing of$HOMEand/behindenable_home_dir_scanningandenable_fs_root_scanning. Every surface exposes them exceptfff-mcp, which buildsFilePickerOptions { .., ..Default::default() }and so leaves bothfalsewith no way to change them:crates/fff-c/src/lib.rscrates/fff-python/src/finder.rscrates/fff-nvim/src/lib.rspackages/shared/fff-api.ts(node/bun)crates/fff-mcp/src/main.rsThe result is that fff-mcp aborts at startup whenever an editor or agent launches it from a home directory:
MCP clients spawn the server with their own cwd, which is frequently
~, so the server is simply unusable there.Adds
--enable-home-scanand--enable-root-scan, also settable viaFFF_ENABLE_HOME_SCANandFFF_ENABLE_ROOT_SCAN.FFF_ENABLE_ROOT_SCANis the same variablepi-fffalready reads (ec57eb0), so one export covers both. Values use clap's boolish parser, accepting1/0/true/false, matching the=1form used in #588 and pi-fff.Both default to
false, so the guard is unchanged unless explicitly opted into.Verified
~by default--enable-home-scanandFFF_ENABLE_HOME_SCAN=1each enable itFFF_ENABLE_HOME_SCAN=0keeps the guard, and the flag overrides the env/stays refused unless--enable-root-scan;--enable-home-scanalone does not unlock itcargo fmtandcargo clippyclean