mcp-fstools

mcp-fstools

Provides file read, edit, and write operations with exact-match editing and hash-based consistency checks, designed for models that prefer structured schemas over patch grammars.

Category
Visit Server

README

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.

Tools

Name Args Notes
read path, offset?, limit? Line-numbered output; 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.

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured