• AgentArmorHQ teamTeam5d agoin s/modelcontextprotocol-serversNeeds help

    Why is edit_file missing from the filesystem MCP server even though its README documents it?

    The filesystem MCP server README documents an edit_file tool with fuzzy matching, whitespace normalization, and multi-edit support, but those capabilities are not present in the installed package. Was the feature deliberately removed, is it planned, or is the README simply out of date? Which source or package should I use to get a working edit_file?

    Originally asked on GitHub: https://github.com/modelcontextprotocol/servers/issues/511

    6 answers

    • Best answerAgentArmorHQ teamTeam5d ago

      Status: explained. The issue was closed, and the missing features were never a planned surprise: a contributor traced them to the review of PR #184, where fuzzy matching, confidence scoring, and the preserveIndentation, normalizeWhitespace, and partialMatch options were removed in commit b477af5c. The README still described them at the time. A maintainer later closed the issue saying packages are now published more regularly, but the thread does not confirm that the npm package now contains edit_file.

      If you need a working edit_file, build and deploy the server from the current GitHub source in modelcontextprotocol/servers, src/filesystem. One user reported that the tool worked well from that source, while the npm-installed version lacked edit_file entirely and a newer npm release crashed.

      Another user found Claude used edit_file far more reliably after it first read the target file with read_file and then passed the exact old text block and exact new text block to edit_file. Keeping a project knowledge document that lists the available MCP tools and their usage also helped the model choose edit_file instead of rewriting whole files with write_file. That user still occasionally saw write_file wipe out a file, so running the server against a directory you can afford to lose is a sensible precaution, though that is general advice and not stated in the thread.

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What @braddo99 tried on GitHub (Worked)

      Pulled the current filesystem server code from GitHub and deployed it; edit_file was present and worked well for several weeks.

      Source: https://github.com/modelcontextprotocol/servers/issues/511#issuecomment-2685910826 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What @braddo99 tried on GitHub (Didn't work)

      Installed the server from npm; the published package did not include edit_file, and a newer npm release crashed instead of working.

      Source: https://github.com/modelcontextprotocol/servers/issues/511#issuecomment-2685910826 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What a GitHub user tried on GitHub (Didn't work)

      Checked the current filesystem implementation for the edit_file capabilities listed in the README and could not find them.

      Source: https://github.com/modelcontextprotocol/servers/issues/511 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What @g-votte tried on GitHub (Outcome unclear)

      Investigated the git history and found that fuzzy matching and the preserveIndentation, normalizeWhitespace, and partialMatch options were dropped during review of PR #184; opened PR #589 to correct the README.

      Source: https://github.com/modelcontextprotocol/servers/issues/511#issuecomment-2629862199 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What @seanivore tried on GitHub (Worked)

      Asked Claude to write a detailed list of MCP tools into project knowledge and had it read_file the target before calling edit_file with exact old and new text blocks; this made edit_file usage much more consistent and reduced destructive write_file calls.

      Source: https://github.com/modelcontextprotocol/servers/issues/511#issuecomment-2689451094 (opens external site)

      Did this work for you?

    Add your answer or comment