fileditor-mcp

v1.0.104
fileditor-mcp Checked 2 days ago Published 1 month ago

MCP server for file operations

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

set_workspace

Set the workspace root directory. All relative path operations will be based on this directory. You must call this tool to set the correct workspace before performing any file operations.

ParameterTypeDescription
path *stringThe absolute path to the workspace root directory (e.g., the directory opened by VSCode)

read_files

Read the entire or partial content of the specified file(s). Supports reading single or multiple files at once. The returned content includes line numbers in the format 'line | content'.

ParameterTypeDescription
path *
line_rangestringOptional line range, format 'start-end' (only for single file)

write_files

Create new files or completely overwrite existing files. Supports single or multiple files at once.

ParameterTypeDescription
content *
line_count *
path *

list_files

List the files and subdirectories in the specified directory.

ParameterTypeDescription
path *stringThe directory path to list contents of. The path can be an absolute path or a workspace-relative path.
recursivebooleanWhether to recursively list subdirectory contents

insert_contents

Insert new content at the specified position in the file. Supports editing single or multiple files at once. Negative line numbers are supported for insertion from the end.

ParameterTypeDescription
content *
line *
path *

apply_diffs

Perform precise block-based search and replace operations on existing files. Supports single or multiple diff operations on a single file. When processing multiple diffs, the tool automatically handles line number offsets - all start_line values should be based on the original file structure. By default, operates in atomic mode for safe batch operations.

ParameterTypeDescription
path *stringThe path of the file to modify. The path can be an absolute path or a workspace-relative path.
replace_content *
search_content *
start_line *
atomicbooleanWhether to use atomic mode (all-or-nothing). When true (default), validates all diffs before applying any. When false, applies diffs one by one, continuing on failures.
trimbooleanWhether to trim whitespace from the beginning and end of each line when comparing search_content with file content. Only affects search and matching - replace_content is inserted exactly as provided.…

search_and_replace

Search and replace text or regular expressions in a single file.

ParameterTypeDescription
path *stringThe target file path. The path can be an absolute path or a workspace-relative path.
replace *stringThe text to replace with
search *stringThe text or regular expression to search for
end_lineintegerThe ending line of the search range
ignore_casebooleanWhether to ignore case when searching
start_lineintegerThe starting line of the search range
use_regexbooleanWhether to use regular expressions for searching