Skip to main content
Glama

ai-filesystem-mcp

Your AI agent's Edit isn't atomic. This MCP makes it so.

A single-tool MCP server for atomic multi-file changes with automatic rollback — built for Claude Code, Codex CLI, Cursor agents, and other modern coding agents.

Those agents ship with excellent built-in tools for reading, writing, searching, editing, and shell. They do not ship with a primitive for "apply these N file operations as one transaction; if any of them fail, revert everything." That is the one and only thing this MCP provides.

The tool

transaction — apply a batch of file operations atomically.

{
  "name": "transaction",
  "arguments": {
    "operations": [
      { "type": "create", "path": "src/feature.ts",  "content": "..." },
      { "type": "write",  "path": "src/index.ts",    "content": "..." },
      { "type": "update", "path": "src/lib/util.ts",
        "updates": [{ "oldText": "foo()", "newText": "foo(arg)" }] },
      { "type": "move",   "path": "src/old.ts", "destination": "src/legacy/old.ts" },
      { "type": "delete", "path": "src/dead.ts" }
    ],
    "rollbackOnError": true
  }
}

If operation 4 fails, operations 1-3 are restored from backup before the call returns. If everything succeeds, backups are cleaned up.

Operation kinds

type

Required fields

What it does

create

path, content

Make a new file (creates parent dirs).

write

path, content

Overwrite an existing file.

update

path, updates[]

In-place String.replace(oldText, newText) for each update, in order.

move

path, destination

Rename pathdestination.

delete

path

Remove a file or directory (recursive).

Related MCP server: File Operation MCP Server

Why one tool

Earlier 2.x versions shipped 39 commands: file I/O, search, git, code analysis, shell, archives, diffs, metadata, encryption, file watcher. Modern coding agents already do all of that better with their own Read / Edit / Write / Grep / Glob / Bash tools — wrapping those in MCP only adds latency and a new failure surface.

What an agent's Edit cannot do is treat several file changes as one unit of work. If op 4 of 5 fails, ops 1-3 are already on disk. Until the agent grows a real transaction primitive, that gap is filled externally — which is the entire job of this server.

When you actually need this

You probably don't need it for a typical "fix this bug" turn. You do need it when a single logical change must touch several files together:

  • DB migration: schema file + matching ORM model + matching test fixtures must all land or all revert.

  • Cross-cutting rename / refactor that spans many files and would half-apply if the agent crashes or runs out of context mid-stream.

  • Generated-code updates where the generator output and the hand-edited glue must stay in sync.

  • Config + corresponding code change (e.g. routing table entry + handler), where the half state is broken.

If your edit fits in one file, just use the agent's Edit. If it fits in one shell command, just use Bash. Reach for transaction only when "all or nothing" actually matters.

Install

Requires Node.js ≥ 18.

npm install -g ai-filesystem-mcp

Or from source:

git clone https://github.com/proofmath-owner/ai-filesystem-mcp.git
cd ai-filesystem-mcp
npm install
npm run build
node dist/index.js

Configure (Claude Code / Codex CLI / any MCP client)

{
  "mcpServers": {
    "ai-filesystem": {
      "command": "node",
      "args": ["/absolute/path/to/ai-filesystem-mcp/dist/index.js"]
    }
  }
}

Speaks stdio JSON-RPC. No network ports.

Trust model

Runs locally beside a trusted AI agent as the user that started it. There is no path sandbox; the trust boundary is your machine. Do not expose to untrusted clients.

Development

npm install
npm run dev      # tsx watch on src/index.ts
npm run build    # tsc -> dist/
npm run lint
npm run format

tsc errors fail the build. No tsc || true.

License

MIT

Available Tools

1 tool
transactionA

Apply a batch of file create/write/update/move/delete operations atomically. If any operation fails (and rollbackOnError is true, the default), all prior operations in the batch are reverted from on-disk backups. This is the one thing the agent's built-in per-file Edit cannot do.

ParametersJSON Schema
NameRequiredDescriptionDefault
operationsYesOrdered list of file operations to execute as one atomic batch.
rollbackOnErrorNoWhen true (default), any failure rolls all completed ops in the batch back from backup.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Disclosures atomicity, rollback on failure, and default behavior of rollbackOnError. No annotations provided, so description carries full burden; it adequately informs about core behavior but does not mention success outcomes or side effects beyond rollback.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences, front-loaded with the core purpose, followed by a key differentiator. No superfluous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (two parameters, one nested array) and no output schema, the description covers atomicity, rollback, and operation types adequately. Lacks explanation of return value or error handling details, but the core use case is clear.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents parameters fully. The description adds minimal extra context (e.g., 'from on-disk backups') but does not significantly enhance understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the verb 'apply', resource 'batch of file operations', and atomicity. Distinguishes from the agent's built-in Edit by noting this is something it cannot do, providing sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly contrasts with the agent's per-file Edit, implying when to use this tool (for atomic batch operations). Lacks explicit when-not-to-use or alternatives beyond that single comparison.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 40 tool updatesv4.0.0
    • Removedanalyze_code
    • Removedbatch_operations
    • Removedchange_permissions
    • Removedcompress_files
    • Removedcreate_directory
    • Removeddecrypt_file
    • Removeddiff_files
    • Removedencrypt_file
    • Removedexecute_shell
    • Removedextract_archive
    • Removedfile_watcher
    • Removedformat_code
    • Removedfuzzy_search
    • Removedget_file_metadata
    • Removedgit_add
    • Removedgit_branch
    • Removedgit_checkout
    • Removedgit_clone
    • Removedgit_commit
    • Removedgit_init
    • Removedgit_log
    • Removedgit_pull
    • Removedgit_push
    • Removedgit_status
    • Removedgithub_create_pr
    • Removedlist_directory
    • Removedmodify_code
    • Removedmove_file
    • Removedread_file
    • Removedread_files
    • Removedscan_secrets
    • Removedsearch_content
    • Removedsearch_files
    • Removedsecurity_audit
    • Removedsemantic_search
    • Removedshell
    • Removedsuggest_refactoring
    • Changedtransaction11 fields changed
      • changedInput schema / properties / operations / description
        Previous value: -"List of file operations to execute"New value: +"Ordered list of file operations to execute as one atomic batch."
      • addedInput schema / properties / operations / items / additionalProperties
        Added value: +false
      • changedInput schema / properties / operations / items / properties / content / description
        Previous value: -"Content for create/update operations"New value: +"Required for \"create\" and \"write\"."
      • addedInput schema / properties / operations / items / properties / destination
        Added value: +{
        +  "description": "Required for \"move\" (new path).",
        +  "type": "string"
        +}
      • removedInput schema / properties / operations / items / properties / encoding
        Removed value: -{
        -  "default": "utf8",
        -  "description": "File encoding",
        -  "type": "string"
        -}
      • changedInput schema / properties / operations / items / properties / path / description
        Previous value: -"File path for the operation"New value: +"Target file or directory path."
      • changedInput schema / properties / operations / items / properties / type / description
        Previous value: -"Type of operation"New value: +"Operation kind. create=new file, write=overwrite, update=text replace, move=rename, delete=remove."
      • changedInput schema / properties / operations / items / properties / type / enum
        Previous value: -[
        -  "create",
        -  "read",
        -  "update",
        -  "delete"
        -]New value: +[
        +  "create",
        +  "write",
        +  "update",
        +  "move",
        +  "delete"
        +]
      • addedInput schema / properties / operations / items / properties / updates
        Added value: +{
        +  "description": "Required for \"update\". Each entry is { oldText, newText } and is applied in order via string replace.",
        +  "items": {
        +    "additionalProperties": false,
        +    "properties": {
        +      "newText": {
        +        "type": "string"
        +      },
        +      "oldText": {
        +        "type": "string"
        +      }
        +    },
        +    "required": [
        +      "oldText",
        +      "newText"
        +    ],
        +    "type": "object"
        +  },
        +  "type": "array"
        +}
      • addedInput schema / properties / operations / minItems
        Added value: +1
      • changedInput schema / properties / rollbackOnError / description
        Previous value: -"Whether to rollback all operations if any fails"New value: +"When true (default), any failure rolls all completed ops in the batch back from backup."
    • Removedupdate_file
    • Removedwrite_file
  2. 40 tool updatesv2.0.0
    • First observedanalyze_code
    • First observedbatch_operations
    • First observedchange_permissions
    • First observedcompress_files
    • First observedcreate_directory
    • First observeddecrypt_file
    • First observeddiff_files
    • First observedencrypt_file
    • First observedexecute_shell
    • First observedextract_archive
    • First observedfile_watcher
    • First observedformat_code
    • First observedfuzzy_search
    • First observedget_file_metadata
    • First observedgit_add
    • First observedgit_branch
    • First observedgit_checkout
    • First observedgit_clone
    • First observedgit_commit
    • First observedgit_init
    • First observedgit_log
    • First observedgit_pull
    • First observedgit_push
    • First observedgit_status
    • First observedgithub_create_pr
    • First observedlist_directory
    • First observedmodify_code
    • First observedmove_file
    • First observedread_file
    • First observedread_files
    • First observedscan_secrets
    • First observedsearch_content
    • First observedsearch_files
    • First observedsecurity_audit
    • First observedsemantic_search
    • First observedshell
    • First observedsuggest_refactoring
    • First observedtransaction
    • First observedupdate_file
    • First observedwrite_file

TDQS

A3.9/5.0
Disambiguation5/5

With only one tool, there is no ambiguity between tools. The single tool has a clearly defined purpose.

Naming Consistency5/5

With a single tool, naming is trivially consistent. The name 'transaction' is descriptive and fits the tool's purpose.

Tool Count2/5

A single tool for a file system server is too few. The server's purpose implies a need for multiple operations, but only a batch transaction tool is provided.

Completeness1/5

The server severely lacks basic file operations (read, write, list, etc.). It only offers a batch transaction tool, which is a narrow supplement, not a complete file system interface.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    Enables comprehensive directory analysis and file management operations including project structure exploration, intelligent file search, full CRUD operations on files and directories, batch operations with rollback capabilities, and Git integration.
    13
    4
    -
  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables comprehensive file and document operations including image compression, archive creation/extraction, file copying/moving, PDF merging/splitting/conversion, SQLite database queries, and advanced text processing.
    -
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables comprehensive filesystem operations including reading/writing files, directory management, file searching, editing with diff preview, compression, hashing, and merging with dynamic directory access control.
    668,809
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/proofmath-owner/ai-filesystem-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server