mcp-file-tools
MCP server for sandboxed, encoding-aware text file operations—especially legacy/non-UTF-8 files.
Read, write, edit, copy, move, delete, and inspect text files while auto-detecting or preserving encodings, BOMs, and line endings.
Detect and convert among 45 encodings (UTF, Cyrillic, Western/Central European, Greek, Turkish, Baltic/Nordic, Hebrew/Arabic/Vietnamese/Thai, DOS, CJK), with confidence and candidate reporting.
Search file contents by regex and find files by glob, with encoding-aware grep, gitignore support, sorting, pagination, and batch reads.
Manage BOMs and line endings (detect/add/strip/convert).
Browse directories with list/tree views, create directories, and get file metadata.
Check allowed directories and update availability.
Use MCP prompts for encoding audits, mojibake fixes, and UTF-8 migration (per README).
Supports legacy Delphi and Pascal projects by providing tools to read and write source files and UI text in legacy encodings like Windows-1251.
Facilitates the maintenance of legacy PHP and HTML websites by providing encoding-aware file operations and regex search capabilities for localized content.
Provides automatic detection and conversion between various legacy encodings and Unicode, ensuring data integrity for files with non-UTF-8 text.
MCP File Tools
Claude sees Настройки — not ???? or Íàñòðîéêè.
MCP server for file operations on text that isn't UTF-8. It detects the encoding from the file's bytes rather than its extension, hands the model UTF-8, and writes back in the original encoding — BOM and CRLF/LF intact, still byte-compatible with whatever legacy tool owns the file.
45 encodings, read and write — Cyrillic (CP1251, KOI8-R/U, CP866/855), Windows-125x, ISO-8859-x, DOS code pages, MacRoman, UTF-16/UTF-32, CJK (GBK, Big5, Shift_JIS, EUC-JP/KR) (full list)
Encoding-aware across the whole tool set —
edit_file,grep_text_filesandsearch_filesdecode the same way, not just read and writeDetection you can inspect —
detect_encodingreports the charset, a confidence score and any BOM, so garbled text becomes diagnosableBOM and line endings are first-class — including on UTF-16, where a naive byte-level rewrite corrupts the file
Sandboxed — every path, symlink and junction targets included, is checked against the directories you allowed
Built for: Delphi/Pascal units with Cyrillic UI text, VB6 forms, legacy PHP/HTML with localized content, and INI or data files whose encoding you can't tell from the filename.
User: Read config.ini and change the title to "Настройки"
Claude: [read_text_file → cp1251 detected] → [edits UTF-8] → [write_file → back to cp1251]PRs welcome and merged fast — no CLA, no style review, one-line fixes count. Forked this to fix something? Please send it back instead.
Installation
Claude Code plugin (recommended)
claude plugin marketplace add dimitar-grigorov/mcp-file-tools
claude plugin install mcp-file-toolsInside a session: /plugin marketplace add … and /plugin install ….
Requires Node.js 18+ on your PATH. The launcher is a Node script
and Claude Code does not bundle Node; without it /mcp shows the server as not connected.
First launch downloads the binary for your OS at a pinned version, verifies its SHA-256 and caches it. It is scoped to the folder you have open, so there is nothing to configure. For directories outside the workspace, or a machine without Node, use a manual install.
Coming from a manual install
claude mcp list # find the old file-tools entry
claude mcp remove file-tools
claude plugin marketplace add dimitar-grigorov/mcp-file-tools
claude plugin install mcp-file-tools
# Old binary, once /mcp shows the plugin connected:
# Windows Remove-Item "$env:LOCALAPPDATA\Programs\mcp-file-tools\mcp-file-tools.exe"
# Linux/macOS rm ~/.local/bin/mcp-file-toolsTool names change too: mcp__file-tools__* becomes
mcp__plugin_mcp-file-tools_file-tools__*, so update your permission rules, see
Auto-approve tools.
Updating the plugin
claude plugin marketplace update mcp-file-tools
claude plugin update mcp-file-tools@mcp-file-toolsUse the full plugin@marketplace id, not the bare name, or turn on auto-update in
/plugin → Marketplaces.
Registries and directories
This server is listed in the Official MCP Registry for discovery by any MCP client, and indexed on Glama, which scores it A for license, quality and maintenance.
Manual install (other MCP clients, or access outside your workspace)
Download the binary for your platform, then register it with the directories it may access.
Platform | Release asset | Suggested path |
Windows x64 |
|
|
Linux x64 |
|
|
macOS ARM64 |
|
|
Windows (PowerShell, not CMD):
mkdir -Force "$env:LOCALAPPDATA\Programs\mcp-file-tools"
iwr "https://github.com/dimitar-grigorov/mcp-file-tools/releases/latest/download/mcp-file-tools_windows_amd64.exe" -OutFile "$env:LOCALAPPDATA\Programs\mcp-file-tools\mcp-file-tools.exe"
claude mcp add --scope user file-tools -- "$env:LOCALAPPDATA\Programs\mcp-file-tools\mcp-file-tools.exe" "C:\Projects"Linux / macOS (swap the asset name from the table for your platform):
mkdir -p ~/.local/bin
curl -L "https://github.com/dimitar-grigorov/mcp-file-tools/releases/latest/download/mcp-file-tools_linux_amd64" -o ~/.local/bin/mcp-file-tools
chmod +x ~/.local/bin/mcp-file-tools
claude mcp add --scope user file-tools -- ~/.local/bin/mcp-file-tools ~/ProjectsGo install (all platforms)
# Requires Go 1.27+
go install github.com/dimitar-grigorov/mcp-file-tools/v4/cmd/mcp-file-tools@latest
# Linux / macOS
claude mcp add --scope user file-tools -- $(go env GOPATH)/bin/mcp-file-tools ~/Projects# Windows PowerShell
claude mcp add --scope user file-tools -- "$(go env GOPATH)\bin\mcp-file-tools.exe" "C:\Projects"Other Clients
For Claude Desktop, VSCode, or Cursor, use the downloaded binary path in your config:
Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json on Windows, ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
Windows:
{
"mcpServers": {
"file-tools": {
"command": "C:\\Users\\YOUR_NAME\\AppData\\Local\\Programs\\mcp-file-tools\\mcp-file-tools.exe",
"args": ["D:\\Projects", "C:\\Users\\YOUR_NAME\\Documents"]
}
}
}macOS / Linux:
{
"mcpServers": {
"file-tools": {
"command": "/Users/YOUR_NAME/.local/bin/mcp-file-tools",
"args": ["/Users/YOUR_NAME/Projects", "/Users/YOUR_NAME/Documents"]
}
}
}args lists the directories the server may access — as many as you need.
VSCode / Cursor (Claude Code extension)
If you already ran claude mcp add --scope user from the installation steps above, the server is already available in VSCode — no extra config needed.
To configure separately for VSCode only:
claude mcp add --scope user file-tools -- "$env:LOCALAPPDATA\Programs\mcp-file-tools\mcp-file-tools.exe" "C:\Projects"Alternatively, create a per-project config by adding .mcp.json to your project root:
{
"mcpServers": {
"file-tools": {
"type": "stdio",
"command": "C:\\Users\\YOUR_NAME\\AppData\\Local\\Programs\\mcp-file-tools\\mcp-file-tools.exe",
"args": ["D:\\Projects", "D:\\Other\\Directory"]
}
}
}Note: type: "stdio" is required here. The VSCode extension does not add the workspace
directory by itself, so args must list every directory you want reachable. Adding one
later means re-running claude mcp add with the full list — it overwrites the previous
config rather than appending.
OpenAI Codex CLI
Codex takes a direct MCP command, so no manual TOML editing is needed.
Windows (PowerShell):
mkdir -Force "$env:LOCALAPPDATA\Programs\mcp-file-tools"
iwr "https://github.com/dimitar-grigorov/mcp-file-tools/releases/latest/download/mcp-file-tools_windows_amd64.exe" -OutFile "$env:LOCALAPPDATA\Programs\mcp-file-tools\mcp-file-tools.exe"
codex mcp add file-tools -- "$env:LOCALAPPDATA\Programs\mcp-file-tools\mcp-file-tools.exe" "C:\Projects"Run codex mcp list to verify it, then start a new Codex session. Add more directory
arguments to grant access outside the current project.
Auto-approve tools (Claude Code)
To skip the permission prompts, add to .claude/settings.local.json in your project root:
{ "permissions": { "allow": ["mcp__plugin_mcp-file-tools_file-tools__*"] } }That prefix is the plugin install; a manual one registered as file-tools is
mcp__file-tools__* instead, and a rule with the wrong prefix matches nothing and fails
quietly. Which modes the rules affect, and keeping delete_file / move_file behind a
prompt, are in docs/extra.md.
Update
The server checks for updates automatically and notifies you through tool responses when a newer version is available; the notice carries the steps for your install. Plugin installs update through Updating the plugin — a re-downloaded binary is ignored there.
For a manual install, re-download the binary over the existing one — the registration does not need repeating:
Close all Claude Code sessions (the binary is locked while running)
Re-download:
iwr "https://github.com/dimitar-grigorov/mcp-file-tools/releases/latest/download/mcp-file-tools_windows_amd64.exe" `
-OutFile "$env:LOCALAPPDATA\Programs\mcp-file-tools\mcp-file-tools.exe"To disable update checks, set the environment variable MCP_NO_UPDATE_CHECK=1.
Verify & Uninstall
# Check which file-tools server is connected (plugin or manual)
claude mcp list
# Remove a manual install
claude mcp remove file-tools
# Remove the plugin
claude plugin uninstall mcp-file-toolsRelated MCP server: ellmos-filecommander-mcp
How to Use
Once installed, just ask Claude:
"List all .pas files in this directory"
"Read config.ini and detect its encoding"
"Show all supported encodings"
"Read MainForm.dfm using CP1251 encoding"
Security: the server reaches only the directories you allowed. It takes them from
args: ["/path/to/project"] first, then MCP_FILE_TOOLS_ALLOWED_DIRS, and failing both
from the directory it was started in — the workspace, when a client launches it there.
Clients that still speak the MCP roots protocol add their roots on top. A drive root or
your home directory is never granted by that last fallback; name it explicitly instead.
Paths are resolved before the check, so a symlink or Windows junction pointing outside is
rejected rather than followed.
Tools
20 tools — every one that touches text content is encoding-aware:
read_text_file- Read files with encoding auto-detection and conversionread_multiple_files- Read multiple files concurrently with encoding supportwrite_file- Write files in specific encodingsedit_file- Line-based edits with diff preview and whitespace-flexible matchingcopy_file- Copy a file to a new locationdelete_file- Delete a filelist_directory- Browse directories with pattern filteringtree- Compact indented tree view, optionally annotated with each file's encodingsearch_files- Recursively search for files matching glob patternsgrep_text_files- Regex search in file contents with encoding supportdetect_encoding- Auto-detect file encoding with confidence scoreconvert_encoding- Convert file between encodingsmanage_line_endings- Detect or convert line endings (CRLF/LF/mixed)manage_bom- Detect, strip, or add Unicode BOMlist_encodings- Show all supported encodingsget_file_info- Get file/directory metadatacreate_directory- Create directories recursively (mkdir -p)move_file- Move or rename files and directorieslist_allowed_directories- Show accessible directoriescheck_for_updates- Check whether a newer release is available
Plus three prompts — audit_encodings, fix_mojibake,
migrate_to_utf8 — surfaced by clients as user commands.
See TOOLS.md for detailed parameters and examples. Calls shaped like Claude Code's built-in Read/Write/Edit/Grep are accepted too — the alias layer translates them where the semantics match exactly, so a model's habits don't fail the call.
Out of scope: binary/media reading (read_media_file). This is a text
tool; agents read images with their built-in tools.
Supported encodings
Every one below reads and writes. Name one explicitly via the encoding parameter, or
leave it to auto-detection.
Script / region | Encodings |
Unicode | UTF-8, UTF-16 LE/BE, UTF-32 LE/BE |
Cyrillic | Windows-1251, KOI8-R, KOI8-U, CP866, CP855, ISO-8859-5, MacCyrillic |
Western European | Windows-1252, ISO-8859-1, ISO-8859-15, MacRoman |
Central European | Windows-1250, ISO-8859-2 |
Greek | Windows-1253, ISO-8859-7 |
Turkish | Windows-1254, ISO-8859-9 |
Baltic and Nordic | Windows-1257, ISO-8859-4, ISO-8859-10, ISO-8859-13 |
Hebrew, Arabic, Vietnamese, Thai | Windows-1255, 1256, 1258, 874, ISO-8859-6, ISO-8859-8 |
Other Latin | ISO-8859-3, ISO-8859-14, ISO-8859-16 |
DOS code pages | CP437, CP850, CP852 |
Chinese | GBK, GB18030, Big5 |
Japanese and Korean | Shift_JIS, EUC-JP, ISO-2022-JP, EUC-KR |
Common aliases are accepted (cp1251, latin1, gb2312, tis-620, …) —
list_encodings prints the whole table with aliases.
Auto-detection never guesses MacRoman, the DOS pages or the rarer ISO tables; name them explicitly. UTF-32 is found only by its BOM.
Configuration
The server can be configured via environment variables:
Variable | Description | Default |
| Default encoding for |
|
| Line endings for | unset (write unchanged) |
| Memory threshold in bytes. Files smaller are loaded into memory for faster I/O; larger files use streaming. Also affects encoding detection mode. |
|
| Comma-separated list pinning what detection may answer, in priority order — e.g. | unset (detection unrestricted) |
| Allowed directories as an OS path list ( | unset |
| Set to turn off granting the working directory when neither | unset (fallback on) |
Set them with an env block in your config (Claude Desktop example):
{
"mcpServers": {
"file-tools": {
"command": "C:\\Users\\YOUR_NAME\\AppData\\Local\\Programs\\mcp-file-tools\\mcp-file-tools.exe",
"args": ["D:\\Projects"],
"env": {
"MCP_DEFAULT_ENCODING": "utf-8"
}
}
}
}Pinning the encodings
Detection is a guess, and guesses have blind spots: Spanish CP1252 like MÓDULO FÍSICAMENTE ÚNICO is plausible GBK — every uppercase accent before an ASCII letter is a
valid hanzi pair — so it reads back as Chinese and edits fail with "gbk cannot represent
2 characters". If you know what the repo contains, say so:
"env": { "MCP_DETECTION_CANDIDATES": "utf-8,windows-1252" }A BOM still wins. A guess inside the list keeps its confidence; one outside it is dropped
and the listed encoding that reads most like text takes over, list order breaking ties. A
file that fits none of them is read as the default and reported as an ODD ENCODING
in read_text_file's hint, so a stray file gets said out loud rather than
guessed at. Unlisted encodings stop appearing in detect_encoding's candidates too. UTF-16/32 are named only by a BOM
or the structural classifier, so listing them cannot make them a catch-all.
Legacy teams (pre-2.0.0 behaviour)
Before 2.0.0 new files defaulted to cp1251; they now default to utf-8. Existing files
are unaffected — their encoding is detected and preserved — so this only matters if your
team creates new non-UTF-8 files, e.g. new Delphi units with Cyrillic literals. To keep
the old behaviour:
"env": { "MCP_DEFAULT_ENCODING": "cp1251" }Commit that in the legacy repo's .mcp.json rather than setting it per machine, and
everyone working in that repo gets the right default with no local setup.
Delphi 2007 and older read UTF-8 only when it carries a BOM, so a UTF-8 file without one
is silently treated as ANSI. Set cp1251 (or your own ANSI code page) for such a repo and
new Cyrillic literals land in the encoding the IDE expects. Files that already exist keep
their own encoding either way, and no tool adds a BOM to them.
Development
Prerequisites: Go 1.27+
make test # go test -race ./...
make lint # go vet, go fmt, staticcheck (same pinned version as CI)
make buildscripts/smoke-test starts the server over stdio and calls the read-only tools, run by CI on each push:
go run ./scripts/smoke-testDebugging
MCP Inspector gives a web UI for calling tools and inspecting responses (needs Node.js 18+):
npx @modelcontextprotocol/inspector go run ./cmd/mcp-file-tools -- /path/to/allowed/dirOr pipe JSON-RPC straight to stdin:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | go run ./cmd/mcp-file-tools /path/to/projectContributing
If it fits the scope and works, it gets merged. Don't ask first — just send the PR.
No CLA, no style review: make test and make lint passing is enough, and tests are
welcome but never required. One-line fixes and half-finished features behind a flag both
count. Out of scope, or breaking a tool contract other people's agents rely on, gets a
comment rather than a close. Not writing the fix yourself?
Open an issue with the file,
its encoding, and what the tool did.
Details in CONTRIBUTING.md. Found a way out of an allowed directory? That one goes to SECURITY.md, privately, not to an issue.
Forking
Forks are welcome; that is what GPL-3.0 is for. If you distribute one (a public repo, a release binary, a registry listing, a product), the license asks you to:
Keep GPL-3.0, LICENSE and the copyright notices (§4, §5c)
Say what you changed and when (§5a)
Give the source to everyone who gets the binary (§6)
Removing the license or the notice, relicensing, or shipping only a binary breaks the license and ends the rights it grants (§8). Unsure whether what you ship complies? Ask in an issue.
Beyond that, please keep a line such as "Fork of mcp-file-tools" so readers know where it came from, and give your fork its own name, so its bugs don't land here. Fixed something? A PR saves you the merge conflicts and puts your name on the commit.
Credits
Ideas that started in someone else's fork or PR and were reimplemented here:
@skyispainted - GBK/GB18030, JSON-string array args,
edit_fileretry hint@haobiao - GBK/GB18030, independently
Hugo Rosário - merging MCP roots with CLI allowed dirs
@zoster81 - UTF-16 line endings and grep, path containment fixes, write durability, BOM policy, ordered concurrency
Mario Rial - pinning detection to known encodings, multi-pattern grep
A PR gets your name on the commit instead of this list.
License
GPL-3.0 - see LICENSE
Copyright (C) 2026 Dimitar Grigorov. Free software, distributed WITHOUT ANY WARRANTY.
Available Tools
20 toolscheck_for_updatesARead-only
Check if a newer version of mcp-file-tools is available. Returns current version, latest version, and update instructions if outdated. Uses a cached result (max 1 GitHub API call per 30 min); force=true bypasses the cache. Call once at the start of each session.
Inputs: force. Returns: installMethod, latestVersion, updateMessage, currentVersion
convert_encodingADestructive
Convert files between encodings. Parameters: path (one file) OR paths (a batch — never both), to (required), from (omit to auto-detect), backup (write .bak first), dryRun (report only), allowLowConfidence, bom ("auto" default, "always", "never", "preserve"). Refuses rather than corrupting: a narrowing conversion (utf-8 to cp1251) names the characters the target lacks with line and column, and an untrusted detection names its best guess — confirm it with from, or pass allowLowConfidence=true. A source BOM is stripped before decoding; one contradicting an explicit from is an error. No-op if the file already holds the target bytes. In a batch one bad file does not stop the rest. Run dryRun over a project first. Examples: {"path": "D:\legacy\data.txt", "to": "utf-8", "backup": true} leaves data.txt.bak; {"paths": ["a.pas", "b.pas"], "to": "utf-8", "dryRun": true} previews a migration.
Inputs: to (required), bom, from, path, +4 more. Returns: dryRun, errors, hasBom, bomType, +8 more
copy_fileA
Copy one file byte for byte, keeping its encoding, BOM, line endings, permissions and mtime. Use it to back up a file before an edit or a conversion. Parameters: source (required), destination (required). Never overwrites: an existing destination is an error and nothing is written, so the same call repeated fails the second time rather than copying again. Source must be a file, a directory is refused. The destination's parent directory has to exist already (create_directory first), both paths must sit inside the allowed directories, and a relative path resolves against the directory the server was started in. Prefer move_file to relocate a file (the source stops existing), write_file to create one from new content, convert_encoding with backup=true for a .bak beside a converted file.
Inputs: source (required), destination (required). Returns: message
create_directoryAIdempotent
Create a directory recursively (mkdir -p). Succeeds silently if already exists. Parameter: path (required).
Inputs: path (required). Returns: message
delete_fileADestructive
Delete a file. Does not delete directories. Parameter: path (required).
Inputs: path (required). Returns: message
detect_encodingARead-only
Auto-detect file encoding with confidence score (0-100) and BOM detection. ALWAYS use this first when encountering garbled text or � characters. Use before read_text_file to determine the correct encoding. Parameters: path (required), mode (sample=fast default, chunked=thorough, full=entire file). When the answer is in doubt the result also ranks candidates, all of them usable; retry the read with one and ask the user if two are plausible. A file the detector cannot place is refused rather than guessed at, with the same ranking in the error.
Inputs: path (required), mode. Returns: has_bom, encoding, candidates, confidence
edit_fileADestructive
Edit one file with replacements or a unified diff. Returns a unified diff and keeps the file's encoding and line endings. PREFER THIS over read+write to modify a file. In 'ask before edits' mode call dryRun=true first, show the diff, then dryRun=false once the user confirms; with auto-edit permissions go straight to dryRun=false. On no match, prefer fixing oldText from the closest-content hint. Alternatively retry that edit with similarity (0.0-1.0) for whitespace/comment drift, not different code. Do NOT re-read the file afterwards to verify: a success with a diff means the edit is on disk, a failed edit changes nothing. A file with mixed line endings is repaired to its dominant style; the result says how many endings changed, so report that to the user. Parameters: path; exactly one of edits [{oldText, newText, similarity?, replaceAll?}] or patch (---/+++/@@ unified diff for one file); dryRun (default false); encoding (auto); expectedHash (the contentHash of the read this edit is based on — the edit fails and changes nothing if the file has since changed). oldText must match ONE place: several matches fail with their line numbers and change nothing — add surrounding lines to pick one, or set replaceAll: true to change them all and report the count to the user. Edits apply in order. Matching ignores per-line leading/trailing whitespace and CRLF/LF, but interior spacing must match; newText is re-indented. Example: {"path": "D:\src\unit1.pas", "edits": [{"oldText": "i: Integer;", "newText": "i: NativeInt;"}, {"oldText": "for i := 0 to 10 do", "newText": "for i := 0 to 20 do"}], "dryRun": true}
Inputs: path (required), edits, patch, dryRun, +3 more.
get_file_infoARead-only
Get file/directory metadata: size, timestamps, permissions, type. Use this to check file size before reading large files with read_text_file. Parameter: path (required).
Inputs: path (required). Returns: size, isFile, created, accessed, +3 more
grep_text_filesARead-only
Regex search in file contents with encoding support. PREFER THIS over built-in Grep for non-UTF-8 files. Skips .gitignore'd files (respectGitignore=false to include). Parameters: pattern (regex) or patterns (array), paths (array of files, or dirs searched recursively), caseSensitive (default true), contextBefore/After, maxMatches (default 1000), offset, include/includes, exclude/excludes, encoding. patterns finds ANY of several regexes in ONE pass — sweeping a codebase for a list of names is one call, not one per name. outputMode: "content" (default, matching lines), "files_with_matches" (paths only, far cheaper when you just need WHICH files), "count" (matching lines per file). contextBefore/After apply to content mode only. matchesOnly=true returns the matched substring instead of the whole line, for extracting values — with patterns it also tells you which one hit. offset skips the first N results, so you can page past maxMatches; the response echoes nextOffset when truncated. Include and exclude patterns are basename-only globs; {a,b} alternatives work and a leading **/ is ignored. Includes match any pattern and excludes reject any match. Do not combine a singular field with its plural. Example: {"patterns": ["TCustomer", "TOrder"], "paths": ["D:\proj\src"], "includes": [".pas", ".dfm"], "outputMode": "files_with_matches"}
Inputs: paths (required), offset, exclude, include, +12 more. Returns: hint, files, counts, matches, +5 more
list_allowed_directoriesARead-only
Returns the list of directories this server is allowed to access, normally the directory it was started in. Subdirectories are also accessible. If empty, the user needs to add paths as args in .mcp.json or set MCP_FILE_TOOLS_ALLOWED_DIRS.
Inputs: no named parameters. Returns: message, directories
list_directoryARead-only
List files and directories with optional glob pattern filtering (e.g., *.pas, *.dfm). Parameters: path (required), pattern (optional, default: *), sortBy ("name" default, "mtime" newest first, "size" largest first), reverse (bool, flips the order).
Inputs: path (required), sortBy, pattern, reverse. Returns: files
list_encodingsARead-only
List all 45 supported encodings with name, aliases, and description. Use this to find the correct encoding name for read/write/convert operations.
Inputs: no named parameters. Returns: encodings
manage_bomADestructiveIdempotent
Detect, strip, or add Unicode BOM (Byte Order Mark). UTF-8 BOM breaks PHP/shell scripts; UTF-16 files need BOMs. Parameters: path (required), action (required: "detect"|"strip"|"add"), encoding (required for "add": utf-8, utf-16-le, utf-16-be, utf-32-le, utf-32-be).
Inputs: path (required), action (required), encoding. Returns: hasBom, bomType, changed, message, +1 more
manage_line_endingsADestructiveIdempotent
Detect or fix line endings. action="detect" reports the dominant style (crlf/lf/mixed/none), total lines, and the line numbers that disagree — use it when a file looks inconsistent. action="convert" rewrites the file to style, per code unit for UTF-16/32 and preserving its BOM; no-op if the file already matches. Parameters: path, action ("detect"|"convert"), style ("lf"|"crlf", required for convert), encoding (auto-detected, including most BOM-less UTF-16 — pass utf-16-le/utf-16-be if a very short or unusual file is misread). Example: {"path": "D:\src\unit1.pas", "action": "convert", "style": "crlf"}
Inputs: path (required), action (required), style, encoding. Returns: style, changed, message, totalLines, +3 more
move_fileADestructive
Move or rename files/directories. Fails if destination exists. Parameters: source (required), destination (required).
Inputs: source (required), destination (required). Returns: message
read_multiple_filesARead-only
Read multiple files concurrently with encoding support. PREFER THIS when reading several non-UTF-8 files at once. Individual failures don't stop the batch — partial results are returned. Parameters: paths (required array), encoding (optional, auto-detected per file).
Inputs: paths (required), encoding. Returns: errors, results, errorCount, successCount
read_text_fileARead-only
Read file with encoding auto-detection, converts to UTF-8. PREFER THIS over built-in Read for non-UTF-8 files (Cyrillic, legacy codebases). Returns totalLines and fileSizeBytes for planning the next read, and contentHash — pass that back as expectedHash on edit_file or write_file and the call fails, changing nothing, if the file moved on since you read it. Parameters: path, encoding (auto-detected), offset (1-indexed start line), limit (max lines), maxCharacters (caps output to avoid token overflow), lineNumbers (default false: prefix lines with "N", absolute numbers — use to locate lines reported by grep or encoding errors; STRIP the prefix before using text as edit_file oldText). Page files >2000 lines: {"path": "D:\src\app.pas", "offset": 1, "limit": 2000}, then offset 2001, until offset exceeds totalLines.
Inputs: path (required), limit, offset, encoding, +2 more. Returns: hint, content, endLine, startLine, +6 more
search_filesARead-only
Recursively search for files matching a glob pattern (*.ext at any depth, /*.ext, several ** and {a,b} alternatives allowed). Returns full paths. Skips .gitignore'd files (respectGitignore=false to include). Parameters: path (required), pattern (required), excludePatterns, maxResults (default 10000), sortBy, reverse. sortBy: "name" (default, lexical), "mtime" (newest first) or "size" (largest first); reverse flips the order. Unlike the built-in Glob there is no mtime default — pass sortBy "mtime" for newest first. With mtime or size the whole tree is ranked before the cap, so a truncated result really is the newest/largest maxResults files. Example: {"path": "D:\proj", "pattern": "/*.pas", "sortBy": "mtime"}
Inputs: path (required), pattern (required), sortBy, reverse, +3 more. Returns: files, truncated
treeARead-only
Compact indented tree view of directory structure. PREFER THIS for directory visualization. Skips .gitignore'd files and .git (respectGitignore=false to include). Set showEncoding=true to detect and display file encodings (e.g., for auditing legacy codebases). Parameters: path (required), maxDepth (0=unlimited), maxFiles (default 1000), dirsOnly (bool), exclude (array of patterns), showEncoding (bool, shows detected encoding per file).
Inputs: path (required), exclude, dirsOnly, maxDepth, +3 more. Returns: tree, dirCount, fileCount, truncated
write_fileADestructiveIdempotent
Write file with encoding conversion from UTF-8. PREFER THIS over built-in Write for non-UTF-8 files. Use after read_text_file to keep the original encoding. Parameters: path, content, encoding (default: the existing file's detected encoding, else utf-8), bom, lineEndings, expectedHash (the contentHash of the read this rewrite is based on — the write fails and changes nothing if the file has since changed). bom: "auto" (default) writes a BOM for utf-16-/utf-32- targets, else keeps one only if the file already had a BOM of the same encoding; "preserve" keeps it even when the encoding changed; "never" strips it; "always" fails on encodings with no BOM (e.g. cp1251). lineEndings: "preserve" (default) converts content to the file's existing style, so sending LF into a CRLF file will NOT leave it mixed; also "crlf", "lf", "asis" (byte for byte). Example — strip a UTF-8 BOM that breaks PHP: {"path": "D:\www\index.php", "content": "<?php ...", "bom": "never"}
Inputs: path (required), content (required), bom, encoding, +2 more. Returns: hasBom, bomType, message, contentHash, +1 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Most tools have a clear resource+action identity, and the descriptions explicitly state when to prefer one over another (read_text_file vs read_multiple_files, search_files vs grep_text_files, tree vs list_directory). The remaining overlap is mild: list_directory/search_files/tree all enumerate paths, and detect_encoding overlaps with manage_bom(action=detect) and manage_line_endings(action=detect). An agent can still resolve these from the descriptions, so no serious misselection risk.
Nearly everything is snake_case verb_noun (read_text_file, create_directory, convert_encoding, manage_bom), which is highly predictable. The only deviations are the bare noun 'tree' and the vaguer 'manage_*' verbs, which are consistent with each other but less descriptive than detect/convert/strip. Minor, readable inconsistency only.
20 tools is slightly above the comfortable band, but for a file-server with a heavy encoding/legacy-codebase focus almost every tool maps to a distinct operation an agent would need. list_encodings and check_for_updates are peripheral reference/meta tools that could arguably live elsewhere or be folded in, pushing the set just past ideal scope.
The surface covers the full file lifecycle: read (single + batch), write, edit, copy, move, delete, directory creation, listing/tree, glob search, content grep, plus encoding detection, conversion, BOM and line-ending management with metadata. The notable gap is directory removal — delete_file explicitly refuses directories and no rmdir equivalent exists — and there is no way to set permissions/mtime even though get_file_info reports them. Agents can work around these but not fully.
Maintenance
Related MCP Connectors
An MCP server that measures MCP client behaviour and converts EBCDIC to ASCII, which nobody needs.
MCP server for Translation Services
MCP server for Speech-to-Text
Related MCP Servers
- AlicenseDqualityDmaintenanceEnables AI models to perform file system operations (reading, creating, and listing files) on a local file system through a standardized Model Context Protocol interface.3ISC
- AlicenseBqualityBmaintenanceComprehensive MCP server for filesystem operations, process management, interactive sessions, and async file search. Includes utilities for JSON repair, encoding fixes, duplicate detection, OCR, ZIP archives, and Markdown export.50178 npm6MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for converting various file formats (PDF, DOCX, images, audio, etc.) to Markdown using Microsoft MarkItDown, with support for large files and Cyrillic text.1MIT
- FlicenseAqualityCmaintenanceMCP server for Microsoft Office file operations. Read, write, and create Excel, Word, and PowerPoint files directly from your local filesystem.12-