mcp-fstools
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-fstools read ./src/app.js lines 1-50"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-fstools
Minimal MCP server that exposes opencode-style file tools
(read / edit / write) over stdio. Designed for models that handle a
small, structured schema better than a free-form patch grammar.
Why this exists
Alternatives tried:
codex-rsapply_patchshell command — the model has to compose a custom multi-line patch grammar (*** Begin Patch/*** Update File:/-old/+new/*** End Patch) inside a shell argument. Smaller models stumble on this format.mcp-workspace(Python, stdio) — exposes the same opencode shape but enforces two extra boundaries the host already covers: a--project-dirfilter and a.gitignorefilter that blocks reading common ignored files (target/,.env, etc.).
This server keeps the opencode tool shape and drops the extra boundaries, so models get a familiar three-field schema and can reach every file the OS sandbox allows.
Related MCP server: hashfile-mcp
Tools
Name | Args | Notes |
|
| Line-numbered output; defaults 100 lines / 10,000 chars, up to 2,000 lines / 100,000 chars; records file hash for must-read-first. |
|
| Exact match; must be unique; must-read-first enforced. |
|
| Atomic full-file write; creates parent dirs. |
Read limits
read is bounded so one call can't flood the model's context. By default
it returns at most 100 content lines and 10,000 content characters
(plus a short paging hint). The agent can request more by passing limit
(up to 2,000 lines) and max_chars (up to 100,000 chars); when only
limit is given, max_chars defaults to 100 per line, capped at 100,000
chars. A read that hits either limit or needs more lines ends with a hint
like call read(offset=N) to continue; the model pages through large
files with offset.
edit mirrors opencode's contract:
You must call
readon the same file first in the session.oldStringmust appear exactly once in the current file content.The file must not have changed since the last
reador since the last successfuledit/writeon that file (hash mismatch → fail).
The hash check runs before the oldString check, so a stale edit
against a changed file reports "file changed" rather than the
misleading "oldString not found".
JSON-RPC arg names
Tool calls accept either casing — pick whichever feels natural. The
schema tools/list reports uses camelCase (MCP convention), but the
server also accepts snake_case at call time, so all of these are
equivalent for edit:
filePath/file_patholdString/old_stringnewString/new_string
If a Pydantic error names a field as missing, check both spellings before assuming truncation — that's the diagnostic FastMCP surfaces when an unknown key is dropped.
Sandbox
None at the application layer. The host (e.g. Codex) provides the
OS-level sandbox (Seatbelt/landlock) which already wraps the spawned
subprocess. This server intentionally does not enforce a
--project-dir boundary or a .gitignore filter.
Install
# First install
uv tool install .
# After source changes — use --reinstall (not --force)
uv tool install --reinstall .Both commands write outside the default Codex sandbox scope
(~/.local/share/uv/tools/, ~/.cache/uv/), so run with
sandbox_permissions: "require_escalated". See AGENTS.md for the
why behind --reinstall.
Entry point: mcp-fstools (stdio MCP server).
Wire into Codex
In ~/.codex/config.toml:
[mcp_servers.mcp_fstools]
command = "mcp-fstools"
default_tools_approval_mode = "approve"Restart Codex after the install. To verify, run a read and an edit
in a fresh session — both should succeed without a permission prompt.
Available Tools
3 toolseditA
Replace old_string with new_string in file_path.
Requirements (matches opencode):
You must call
readon this file in the same session first.old_stringmust appear exactly once in the current file content. Provide more surrounding context if it isn't unique.The file must not have changed since the last
read.
Returns a unified diff of the change.
Inputs: filePath (required), newString (required), oldString (required). Returns: result
readA
Read a file, optionally from offset (1-based) for limit lines.
Returns line-numbered content like cat -n. Records the file's
content hash so a subsequent edit can enforce must-read-first.
Inputs: path (required), limit, offset. Returns: result
writeA
Write content to file_path, overwriting any existing content.
Parent directories are created if missing. The file's new content
hash is recorded so a follow-up edit will require a fresh read.
Inputs: content (required), filePath (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clear, distinct purpose: read retrieves content, edit modifies parts, write overwrites entirely. No overlap in functionality.
All tool names are single-word verbs, simple and consistent. No mixing of conventions.
Three tools is minimal but appropriate for a focused file editing server. Each tool earns its place, though more tools could be added for listing or deletion.
The tool set lacks fundamental file operations like delete, rename, list, or search. For a general file system server, this is a significant gap.
Maintenance
Related MCP Connectors
A real-time, multiplayer filesystem for agents and humans: shared files, live edits, history.
Persistent file storage for AI agents via MCP and curl. Upload, download, and version files.
Read, create and update canonical AI-readable documents in your Data Rooms.
Securely search and manage workspace context files for AI agents and teams.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides hashline-based file editing using line-addressed edits and content hashes for integrity verification. It enables LLMs to perform precise file modifications while ensuring edits are rejected if the file content has changed since the last read.10MIT
- FlicenseNot gradedqualityDmaintenanceProvides reliable file editing through hash-anchored operations.5-
- AlicenseAqualityDmaintenanceExposes hash-anchored file edits to MCP-compatible AI coding agents, enabling safe read and write operations with stale edit detection.176 npm1MIT
- AlicenseBqualityCmaintenanceEnables AI agents to read, replace, and write files through line-range-scoped, byte-literal edits that preserve CRLF/LF line endings and indentation, reject ambiguous matches, and perform atomic writes. It returns the actual current range content and a self-correction hint on mismatch, eliminating 'Could not find oldString' failures in MCP clients like opencode and Claude Desktop.3MIT