Skip to main content
Glama
devrandom

mcp-fstools

by devrandom

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-rs apply_patch shell 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-dir filter and a .gitignore filter 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: Filesystem MCP

Tools

Name

Args

Notes

read

path, offset?, limit?, max_chars?

Line-numbered output; defaults 100 lines / 10,000 chars, up to 2,000 lines / 100,000 chars; records file hash for must-read-first.

edit

filePath / file_path, oldString / old_string, newString / new_string

Exact match; must be unique; must-read-first enforced.

write

filePath / file_path, content

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:

  1. You must call read on the same file first in the session.

  2. oldString must appear exactly once in the current file content.

  3. The file must not have changed since the last read or since the last successful edit/write on 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_path

  • oldString / old_string

  • newString / 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 tools
editA

Replace old_string with new_string in file_path.

Requirements (matches opencode):

  • You must call read on this file in the same session first.

  • old_string must 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYes
newStringYes
oldStringYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior5/5

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

No annotations are provided, so the description carries full burden. It discloses all behavioral traits: requirements to read first, uniqueness constraint, no changes since read, and return type (unified diff). This is thorough and transparent.

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?

The description is concise with a clear structure: a single sentence explaining the action, followed by bullet-pointed requirements and a return statement. Every sentence adds value.

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?

For a file editing tool with 3 parameters, no annotations, but an output schema, the description covers prerequisites, behavior, and return value. It is fairly complete, though it could elaborate on edge cases.

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

Parameters2/5

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

Schema description coverage is 0%, but the description does not add much meaning beyond the parameter names used in context. It explains usage but not parameter semantics like types or formats.

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?

The description clearly states the verb 'Replace' and the resource 'string in file_path', and mentions it returns a unified diff. It distinguishes from sibling tools 'read' and 'write' which have different operations.

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?

The description specifies prerequisites: must have read the file, old_string must appear exactly once, and file must not have changed. It provides clear conditions for use, though it does not explicitly contrast with sibling tools like 'write'.

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

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes
limitNo
offsetNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.7/5.0
Behavior5/5

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

Without annotations, the description fully discloses behavior: returns line-numbered content, records file hash for subsequent edit enforcement, and supports optional offset/limit. No contradictions.

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?

Four sentences, each adding value. First sentence states the main action. No redundant information. Well-structured and front-loaded.

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

Completeness5/5

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

The description covers all necessary aspects: action, optional parameters, return format (line-numbered), and side effect (hash recording). Suitable for a low-complexity read tool.

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

Parameters4/5

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

Schema coverage is 0%, so description must add meaning. It explains offset as 1-based and limit as number of lines. Path parameter is not described, but the context is sufficient for a read tool.

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?

The description clearly states the action ('Read a file'), the resource, and optional features (offset, limit). It distinguishes itself from sibling tools (edit, write) by its purpose.

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?

The description implies when to use (reading files) and provides context about hash recording for edit enforcement. However, it does not explicitly state when not to use or mention alternatives.

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

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYes
filePathYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses key behaviors: overwriting content, creating parent directories if missing, and recording a content hash that affects edit. These are important for the agent to understand side effects. Missing details like idempotency or failure handling, but overall sufficient.

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?

The description is very concise: three sentences. The first sentence states the core action, the second adds directory creation behavior, and the third explains the hash recording. Every sentence adds value without redundancy or fluff.

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?

For a simple write tool, the description covers primary behavior and important side effects. It does not mention return values, but an output schema exists (context confirms) which likely covers that. Overall, it provides enough information for the agent to use the tool correctly.

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?

The description adds basic meaning by using parameter names in context: 'Write `content` to `file_path`'. It also explains that parent directories are created for filePath. However, with 0% schema coverage, more detail on constraints (e.g., path format, content encoding) would be beneficial. The description provides minimal yet adequate semantics.

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?

The description clearly states the action: 'Write `content` to `file_path`, overwriting any existing content.' It specifies the verb (write), resource (file), and that it overwrites. It also distinguishes from sibling tools by noting that the content hash is recorded, requiring a fresh read for a follow-up edit.

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?

The description provides context about when to use this tool by mentioning the interaction with edit: 'a follow-up `edit` will require a fresh `read`.' This implies write is for creating or fully overwriting files. However, it does not explicitly state when to prefer write over edit or when not to use it, which would be clearer.

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. 3 tool updatesv0.1.0
    • First observededit
    • First observedread
    • First observedwrite

TDQS

A4.2/5.0
Disambiguation5/5

Each tool has a clear, distinct purpose: read retrieves content, edit modifies parts, write overwrites entirely. No overlap in functionality.

Naming Consistency5/5

All tool names are single-word verbs, simple and consistent. No mixing of conventions.

Tool Count4/5

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.

Completeness2/5

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

ActivityMaintained
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

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to safely explore directories, read files, search content by pattern or filename, and edit files with checksum verification and dry-run preview within sandboxed filesystem access.
    16
    75
    ISC
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables reading, creating, and editing files on the local filesystem through operations like view, create, string replacement, and line insertion.
    182
    3
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Provides 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.
    11
    8
    MIT

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/devrandom/mcp-fstools'

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