dimitar-grigorov/mcp-file-tools
MCP server for file operations on non-UTF-8 text: detects the encoding from the bytes, hands the model UTF-8, and writes back in the original encoding with BOM and CRLF/LF intact. 24 encodings — Cyrillic/CP1251, CP1252, KOI8, ISO-8859, UTF-16, GBK/GB18030.
f6328bbf260dio.github.dimitar-grigorov/mcp-file-toolsPaths from tool input into commands, SQL, files and URLs
How much power the tools give an agent over the machine
Hidden instructions and poisoning in text for the model
Known vulnerabilities in the packages the server uses
How the server reads credentials and where they can go
Whether the tools do only what their descriptions say
How far the analysis went
The scanner traces each tool from its input to the operations its code performs, and here it could not follow every path. Code Safety is shown as partly traced instead of a score: no finding there is not a clean result. The score of Capability Exposure counts only what it could follow.
- Some paths pass through more than 8 functions one inside another; the scanner stops there
- In 67 places a tool's input is handed to a function whose name matches several definitions in the code; the scanner could not tell which one runs, so it stopped there
- 1 source file could be read only in part
- 23 of 45 tools, prompts and resources could not be followed through the code
- 20 places in the code register tools whose names are computed at run time; how many tools that makes cannot be read from the code
- 2 tools, prompts and resources registered only in the repository's tests are not counted on this page
Top risks in plain words
- HIGHTools
convert_encoding,copy_file,move_fileread or write any file path by design: an agent steered by prompt injection can use them that way.
How to use it safely
Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.
- Give it only the folder it needs
convert_encoding,copy_file,move_filecan read or write any file path. Mount a single project folder, read-only where you can. - Turn off the tools you do not use
Most MCP clients let you disable single tools. If you do not need
convert_encoding,copy_file,move_file, switch them off. - Keep confirmations on
Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.
What its tools can do on your machine
The server offers 40 tools, 3 prompts. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.
convert_encoding, copy_file, detect_encoding, edit_file, grep_text_files, manage_bom and 5 moreNo tool was seen to: start other programs on the machine; connect to the internet or other hosts; read passwords, tokens or keys; read environment variables; touch sensitive locations.
Where its requests and secrets go
Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.
The literal addresses the tools' requests name.
- None: no request names a fixed host.
Constants or settings that start an address; the value comes from configuration.
- None seen.
Credential-like environment variables. Give the server a key with the least access it needs.
- None: no credential-like variable is read by the tools.
Text it brings in from outside
Text that reaches the model from outside: an instruction hidden in it can steer the agent (prompt injection). Treat what these tools return as data, not as orders.
- files11 tools · convert_encoding, copy_file, detect_encoding +8
Tool annotations
19 of 43 tools declare annotations. readOnlyHint 10, idempotentHint 4.
Tools, prompts and resources (43: 40 tools, 3 prompts)
Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.
convert_encodingtool Filesoutside textReads/writes files
No description.
copy_filetool Filesoutside textReads/writes files
No description.
move_filetool Move or rename files/directories. Fails if destination exists. Parameters: source (required), destination (required).Reads/writes files
Move or rename files/directories. Fails if destination exists. Parameters: source (required), destination (required).
audit_encodingsprompt Survey a directory tree and report the encoding, BOM and line-ending situation.
Survey a directory tree and report the encoding, BOM and line-ending situation.
fix_mojibakeprompt Diagnose and repair a file showing � characters or garbled Cyrillic/accented text.
Diagnose and repair a file showing � characters or garbled Cyrillic/accented text.
migrate_to_utf8prompt Convert a legacy-encoded tree to UTF-8 with a dry run first.
Convert a legacy-encoded tree to UTF-8 with a dry run first.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
(name computed at run time)tool
No description.
check_for_updatestool 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
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.
create_directorytool Create a directory recursively (mkdir -p). Succeeds silently if already exists. Parameter: path (required).
Create a directory recursively (mkdir -p). Succeeds silently if already exists. Parameter: path (required).
delete_filetool Delete a file. Does not delete directories. Parameter: path (required).
Delete a file. Does not delete directories. Parameter: path (required).
detect_encodingtool Filesoutside textread-only (declared)
No description.
edit_filetool Filesoutside text
No description.
get_file_infotool Get file/directory metadata: size, timestamps, permissions, type. Use this to check file size before reading large files with read_text_file. Parameter: path (rread-only (declared)
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).
grep_text_filestool Filesoutside textread-only (declared)
No description.
list_allowed_directoriestool 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 usread-only (declared)
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.
list_directorytool List files and directories with optional glob pattern filtering (e.g., *.pas, *.dfm). Parameters: path (required), pattern (optional, default: *), sortBy ("nameread-only (declared)
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).list_encodingstool read-only (declared)
No description.
manage_bomtool 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: Filesoutside text
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).
manage_line_endingstool Filesoutside text
No description.
read_multiple_filestool 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 — parread-only (declared)
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).
read_text_filetool Filesoutside textread-only (declared)
No description.
search_filestool Filesoutside textread-only (declared)
No description.
treetool Compact indented tree view of directory structure. PREFER THIS for directory visualization. Skips .gitignore'd files and .git (respectGitignore=false to includeFilesoutside textread-only (declared)
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).
write_filetool Filesoutside text
No description.
Text the model reads (43)
Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.
tree tool
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).
(name computed at run time) tool
list_directory tool
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).(name computed at run time) tool
search_files tool
(name computed at run time) tool
grep_text_files tool
(name computed at run time) tool
get_file_info tool
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).
(name computed at run time) tool
list_allowed_directories tool
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.
(name computed at run time) tool
read_text_file tool
(name computed at run time) tool
read_multiple_files tool
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).
(name computed at run time) tool
edit_file tool
(name computed at run time) tool
write_file tool
(name computed at run time) tool
detect_encoding tool
(name computed at run time) tool
convert_encoding tool
(name computed at run time) tool
manage_line_endings tool
(name computed at run time) tool
manage_bom tool
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).
(name computed at run time) tool
list_encodings tool
(name computed at run time) tool
create_directory tool
Create a directory recursively (mkdir -p). Succeeds silently if already exists. Parameter: path (required).
(name computed at run time) tool
move_file tool
Move or rename files/directories. Fails if destination exists. Parameters: source (required), destination (required).
(name computed at run time) tool
copy_file tool
(name computed at run time) tool
delete_file tool
Delete a file. Does not delete directories. Parameter: path (required).
(name computed at run time) tool
check_for_updates tool
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.
(name computed at run time) tool
audit_encodings prompt
Survey a directory tree and report the encoding, BOM and line-ending situation.
fix_mojibake prompt
Diagnose and repair a file showing � characters or garbled Cyrillic/accented text.
migrate_to_utf8 prompt
Convert a legacy-encoded tree to UTF-8 with a dry run first.
What we checked
The same checks run on every server. Each line below has one of these marks:
- 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injectionChecked on every scan. Results in this category are published only after a person has verified them.
- Runs programs the caller choosesNo tool runs a command or program the caller supplies — 22 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Executes caller-supplied codeNo tool evaluates code the caller supplies — 22 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Reads or writes any file path MEDIUM3 findings in convert_encoding, copy_file, move_file; 3 more to review
- Requests any addressNo tool sends a request to an address the caller supplies — 22 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Runs caller-supplied SQLNo tool executes a query the caller supplies — 22 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Tools that start processesNot seen in the traced code of 43 capabilities; 22 more call code the scanner could not follow, where it may happen
- Tools that touch files11 of 43 capabilities touch files; 11 more call code the scanner could not follow, where it may happen
- Tools that call the networkNot seen in the traced code of 43 capabilities; 22 more call code the scanner could not follow, where it may happen
Where the code is: 43 handlers in 21 files at commit f6328bbf260d
filetoolsserver/prompts.goaudit_encodings, fix_mojibake, migrate_to_utf8filetoolsserver/handler/tree.gotreefiletoolsserver/server.go(name computed at run time), (name computed at run time), (name computed at run time), (name computed at run time), (name computed at run time), (name computed at run time), (name computed at run time), (name computed at run time), (name computed at run time), (name computed at run time), (name computed at run time), (name computed at run time) +9filetoolsserver/handler/directory.golist_directoryfiletoolsserver/handler/search_files.gosearch_filesfiletoolsserver/handler/grep.gogrep_text_filesfiletoolsserver/handler/fileinfo.goget_file_infofiletoolsserver/handler/allowed_dirs.golist_allowed_directoriesfiletoolsserver/handler/read.goread_text_filefiletoolsserver/handler/read_multiple.goread_multiple_filesfiletoolsserver/handler/edit_file.goedit_filefiletoolsserver/handler/write.gowrite_filefiletoolsserver/handler/detect.godetect_encodingfiletoolsserver/handler/convert_encoding.goconvert_encodingfiletoolsserver/handler/manage_line_endings.gomanage_line_endingsfiletoolsserver/handler/manage_bom.gomanage_bomfiletoolsserver/handler/encoding.golist_encodingsfiletoolsserver/handler/create_directory.gocreate_directoryfiletoolsserver/handler/move_file.gomove_filefiletoolsserver/handler/copy_file.gocopy_filefiletoolsserver/handler/delete_file.godelete_file
- 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrityChecked on every scan. Results in this category are published only after a person has verified them.
- Dependency manifests2 manifests: go.mod, tools/go.mod
- Lockfiles checked against OSV2 files resolved and checked against the OSV database
- Known vulnerabilities in production dependenciesNo production dependency with a known advisory
- Known vulnerabilities in other dependenciesNo package used only for development, tests or examples has a known advisory
- MCP SDK versiongithub.com/modelcontextprotocol/go-sdk v1.8.0
- 3 checks: credential harvesting, undeclared credential access, credentials sent over the networkChecked on every scan. Results in this category are published only after a person has verified them.
- Tools that read credentialsNot seen in the traced code of 43 capabilities; 22 more call code the scanner could not follow, where it may happen
- Authentication declaredNot checked: needs the live server's tools/list (a remote server declares how clients authenticate)
- 3 checks: undeclared network access, undeclared file access, undeclared process executionChecked on every scan. Results in this category are published only after a person has verified them.
- Tool descriptions presentEvery tool has a description the model and the user can read (10 only in code no tool reaches)
- Statically known namesEvery tool's name could be read from the code
- Input schemasNot checked: needs the live server's tools/list (every tool declares an input schema)
- Destructive tools annotatedNot checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)
Dependencies with known vulnerabilities (0 in production)
No known vulnerabilities in the production dependencies that could be checked.
Past security advisories
Vulnerabilities published for this server itself, from the GitHub Advisory Database.
No security advisories have been published for this server in the GitHub Advisory Database.
How it runs
| Where it runs | On your machine, started by your MCP client from this repository or its package |
|---|---|
| Transport | not stated in the code the scanner read; most local servers talk over stdio |
| Sign-in | not checked needs the live server |
| MCP SDK | github.com/modelcontextprotocol/go-sdk v1.8.0 |
The project's own security
| Security policy | yes SECURITY.md |
|---|---|
| Private reporting | mentioned the policy names a private channel |
| Past advisories | none in the GitHub Advisory Database |
| Last push | 2026-11-14 |
| Signed releases | not checked yet |
Where it is published
| MCP Registry | io.github.dimitar-grigorov/mcp-file-tools |
|---|---|
| Listed in | 4 catalogs (github_search, glama, mcp_registry, mcp_toplist) |
| License | GPL-3.0 |
| Created | 2026-01-24 |
| Topics | bom claude cp1251 cp1252 cyrillic delphi gbk golang iso-8859 koi8 |
Attack map
How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.