Code Editor MCP Server
This server is an MCP code-editing/filesystem tool server exposing file reading, directory operations, file writes, precise search/replace edits, and encoding conversion through MCP tools.
Filesystem metadata/root management: query file/dir metadata (
config_ops/get_file_info); the schema also exposesset_root_path/list_allowed_rootsfor whitelist management, though the README notes the whitelist is removed in favor of absolute path access.Read files:
read_file/read_filessupport absolute paths, line ranges, multi-file reads, auto/forced encoding detection, MIME/image detection, and pagination.Directory operations:
dir_opscreates/lists/deletes directories with tree/flat listing, depth/ignore/max_items options, mtime conflict checks, confirm tokens, recycle-bin deletion, and approval for risky deletes.File operations:
file_opswrites, appends, copies, moves, and deletes files with encoding selection, mtime conflict detection, and atomic-write behavior.Precise editing:
edit_block/edit_blocksperform single or batch search/replace edits with expected replacement counts, whitespace/escape flexibility, and fail-fast/continue/rollback policies.Encoding conversion:
convert_file_encodingbatch-converts files between encodings (utf-8, gbk, gb2312) with error handling and mismatch policies.Safety/control: tools can be independently enabled/disabled via environment variables or config; all paths must be absolute; critical/root directories are protected; deletes go to trash rather than permanent removal.
Implements file and code editing operations with Python-based encoding detection, file manipulation, and batch editing capabilities for Python source files and other text formats.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Code Editor MCP Serverread_file /home/user/project/src/main.py"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
code-editor
面向多客户端并发、安全沙箱、编码感知的代码编辑 MCP 服务器。
路径访问更新:所有参数必须是绝对路径。路径白名单已移除,任意绝对路径均可访问;
CODE_EDIT_ROOT仅作为删除安全标记,不做访问边界或相对路径解析。每个工具可通过环境变量独立开关,关闭后该工具不会被注册,客户端与智能体完全不可见、不可调用。
安装与运行
# 安装(pip 或 uv 均可,包名 code-editor-mcp)
pip install code-editor-mcp # 或 uv pip install code-editor-mcp
# 更新最新版
pip install -U code-editor-mcp
# 直接启动 CLI 入口
code-editor
# 若从源码运行
uv sync
uv run python server.py关键环境变量:
CODE_EDIT_ROOT:安全标记(默认启动时的 CWD),仅用于删除安全校验,不做访问边界,也不参与相对路径解析。CODE_EDIT_TOOL_ENABLED_<TOOL>:工具开关(环境变量方式),1/true/yes启用(默认),0/false/no禁用。禁用后该工具不注册,客户端与智能体完全看不到。CODE_EDIT_TOOL_SWITCHES_FILE:工具开关配置文件路径(默认tools/tool_switches.json)。
工具开关配置(推荐)
本地使用推荐直接编辑 tools/tool_switches.json,无需设置环境变量:
{
"config_ops": false,
"read_files": false,
"dir_ops": false,
"file_ops": false,
"edit_blocks": true,
"convert_file_encoding": false
}值为
true启用、false禁用;未列出的工具默认启用。优先级:配置文件 > 环境变量 > 默认启用。
修改后重启 MCP 服务生效。
环境变量一览:
变量 | 作用 | 默认值 |
| 安全标记(非访问边界,不做路径解析) | 当前工作目录 |
| 开关 | 启用 |
| 开关 | 启用 |
| 开关 | 启用 |
| 开关 | 启用 |
| 开关 | 启用 |
| 开关 | 启用 |
| (legacy)内部 | 1000 |
|
| 50 |
设计要点
路径访问:白名单已移除,任意绝对路径均可访问;相对路径仍被拒绝。
CODE_EDIT_ROOT仅作删除安全标记,不做路径拼接。工具开关:每个工具可通过
CODE_EDIT_TOOL_ENABLED_<TOOL>独立禁用;禁用后不注册,客户端与智能体完全不可见、不可调用。乐观锁:写/删类支持秒或纳秒级
expected_mtime,10ms 容忍;写入走原子写避免部分落盘。默认忽略:
.git、__pycache__、node_modules、.DS_Store、.env*、.venv、*.log、*.pem;ignore_patterns传空字符串/空列表可关闭默认忽略。编码感知:
read_filesv2 默认逐文件auto检测/复用编码(基于最新 mtime 刷新的元信息缓存);如自动结果乱码,可在每个 request 里显式传encoding覆盖。安全删除:禁止删除当前根/其祖先/关键系统目录。
MCP 工具(code-editor)
文件系统工具
名称 | 工具 | 功能 | 主要参数/说明 | 常见误用 |
|
| 元信息查询 |
| 拼错 action;误以为还有 set_root/list_roots |
|
| LLM 友好读取:多文件/同文件多片段 + 分页 |
| 继续传旧的 |
| `dir_ops(action, dir_path, depth=2, format="tree" | "flat", ignore_patterns=None, max_items=1000, expected_mtime=None, confirm_token=None, allow_nonempty=None, approval_token=None)` | 统一目录操作 |
|
|
| 综合文件操作:write/append/copy/move/delete | 所有路径必须绝对;write 覆盖、append 追加;write/append 需 file_path+content;copy/move 需 source_path+destination_path;delete 需 file_path;encoding 仅写入使用;expected_mtime:写/删校验目标文件,拷贝/移动校验源文件;删除返回结构化结果 | action 不支持或参数缺失;copy 目标已存在;delete 目标是目录 |
|
| 批量转码并覆盖写回 | 绝对路径列表;utf-8/gbk/gb2312/gb18030;错误处理 strict/replace/ignore;编码检测( charset-normalizer ),策略 fail-fast / warn-skip(默认) / force;结果返回 detectedEncoding/Confidence/mismatch;内置别名兼容 utf8/utf_8/utf-8-sig/ascii/cp936/gb-2312/gb-18030 | 相对路径;二进制文件 |
dir_ops 参数要点(避免误调用)
create:仅dir_path必须;其余参数会被忽略。list:format仅支持tree/flat;max_items必须为正整数或 None。delete:必须同时提供expected_mtime、confirm_token、allow_nonempty(显式 True/False)。删除行为统一移动到回收站,不支持永久删除。
命中高风险规则时会返回
status=needs_approval,响应内包含approval_token与llm_instruction。盘符根目录(如
C:\/D:\/E:\)会被永久阻断并返回status=blocked_critical。confirm_token生成规则(严格匹配):
from pathlib import Path
import os
normalized = os.path.normcase(str(Path(dir_path).resolve()))
confirm_token = f"delete:{normalized}"代码精准编辑工具
名称 | 工具 | 功能 | 主要参数/说明 | 常见误用 |
|
| 单编辑/批量编辑:搜索替换 |
| 把 |
edit_blocks 返回格式(v0.3.0+)
edit_blocks 返回结构化数据,包含修改位置信息便于验证:
# edit_blocks(单编辑)返回示例
{
"status": "success",
"message": "Applied 2 edit(s) to /path/file.py (lines 10-12, 20-25)",
"file_path": "/path/file.py",
"replacements": 2,
"locations": [
{"start_line": 10, "end_line": 12, "start_col": 5, "end_col": 20},
{"start_line": 20, "end_line": 25, "start_col": 1, "end_col": 15}
]
}
# edit_blocks(批量)返回示例
{
"status": "success", # success/partial/error
"message": "Completed 3/3 edits",
"total_edits": 3,
"successful_edits": 3,
"failed_edits": 0,
"results": [
{"status": "success", "file_path": "...", "replacements": 1, "locations": [...], "message": "..."},
{"status": "success", "file_path": "...", "replacements": 1, "locations": [...], "message": "..."},
{"status": "success", "file_path": "...", "replacements": 1, "locations": [...], "message": "..."}
]
}使用示例
查询元信息:
config_ops(action="get_info", path="/abs/path/src/app.py")。带锁写入:
info = config_ops(action="get_info", path="/abs/path/src/app.py")→file_ops(action="write", file_path="/abs/path/src/app.py", content=content, expected_mtime=info["modified"])。精确替换(单编辑):
edit_blocks(edits={"file_path":"/abs/path/src/app.py","old_string":"old","new_string":"new","expected_replacements":1,"expected_mtime":info["modified"]})。单文件片段读取(range,行号 1-based):
read_files([
{"path": "/abs/path/src/app.py", "mode": "range", "start_line": 10, "line_count": 60}
])同文件多片段 + 跨文件(一次拿齐,减少多次调用):
read_files([
{"path": "/abs/path/src/app.py", "mode": "range", "start_line": 1, "line_count": 80, "id": "app_head"},
{"path": "/abs/path/src/app.py", "mode": "range", "start_line": 200, "line_count": 80, "id": "app_mid"},
{"path": "/abs/path/README.md", "mode": "range", "start_line": 1, "line_count": 120, "id": "readme"},
], max_total_chars=200000, parallelism=4)分页读取整文件(all + cursor):
resp1 = read_files([{"path": "/abs/path/src/app.py", "mode": "all"}], page_line_count=400)
cursor = resp1["results"][0].get("next_cursor")
resp2 = read_files([{"cursor": cursor}], page_line_count=400) # 继续下一页批量编辑(同文件多处修改):
edit_blocks(edits=[
{"file_path": "/abs/app.py", "old_string": "foo", "new_string": "bar"},
{"file_path": "/abs/app.py", "old_string": "hello", "new_string": "world"},
], error_policy="rollback")批量编辑(多文件):
edit_blocks(edits=[
{"file_path": "/abs/a.py", "old_string": "v1", "new_string": "v2"},
{"file_path": "/abs/b.py", "old_string": "v1", "new_string": "v2"},
], error_policy="continue")批量转码:
convert_file_encoding(["/abs/a.txt", "/abs/b.txt"], "gb2312", "utf-8", error_handling="replace", mismatch_policy="warn-skip")。列目录(扁平):
dir_ops(action="list", dir_path="/abs/path", format="flat", ignore_patterns=[".git", "node_modules"])。删除目录(显式确认,统一进回收站):
info = config_ops(action="get_info", path="/abs/path")→normalized = os.path.normcase(str(Path("/abs/path").resolve()))→token = f"delete:{normalized}"→dir_ops(action="delete", dir_path="/abs/path", expected_mtime=info["modified"], confirm_token=token, allow_nonempty=True)。高风险删除二次审批:首次调用 delete 可能返回
status=needs_approval+approval.approval_token,拿到用户明确同意后,带上approval_token再次调用同一 delete。
MCP 客户端快速配置示例
{
"mcpServers": {
"code-editor": {
"command": "code-editor",
"env": {
"CODE_EDIT_ROOT": "."
}
}
}
}[mcp_servers.code-editor]
command = "code-editor"
# 将工作目录指向当前项目,使 CODE_EDIT_ROOT 默认跟随启动时的 CWD
cwd = "."
startup_timeout_sec = 120安全/行为提示
路径验证:所有操作要求绝对路径;白名单已移除,任意绝对路径均可访问;
CODE_EDIT_ROOT仅为删除安全标记。工具开关:通过
CODE_EDIT_TOOL_ENABLED_<TOOL>可独立禁用任意工具;禁用后该工具不注册,客户端与智能体完全不可见、不可调用。删除防护:删除只允许移动到回收站;任何失败都会直接拒绝(不会降级为永久删除)。
盘符根目录阻断:
C:\、D:\、E:\(及其他文件系统根目录)会被永久阻断,并返回极高风险警告。二次审批:仅“重要目录 + 大规模删除”触发;返回会强制提示模型先询问用户并等待批准。
Available Tools
10 toolsconvert_file_encodingA
Convert files between encodings (utf-8, gbk, gb2312).
Args: file_paths: List of absolute file paths. source_encoding: Current encoding. target_encoding: Desired encoding. error_handling: "strict" | "replace" | "ignore" mismatch_policy: "warn-skip" | "fail-fast" | "force"
| Name | Required | Description | Default |
|---|---|---|---|
| file_paths | Yes | ||
| source_encoding | Yes | ||
| target_encoding | Yes | ||
| error_handling | No | strict | |
| mismatch_policy | No | warn-skip |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. The description adds value by explaining error_handling and mismatch_policy, but it does not disclose whether files are modified in place or if backups are created, nor any side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (8 lines) and uses a clear structured args list. Every sentence adds necessary information without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 5 parameters and no schema descriptions; the description adequately explains params but lacks details on return value or whether files are overwritten. The existence of output schema is not reflected.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema coverage, the description fully explains all 5 parameters, including the enum values for error_handling and mismatch_policy, which is essential for correct usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Convert files between encodings'), specifies supported encodings (utf-8, gbk, gb2312), and is distinct from sibling tools like read_file or file_ops.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives (e.g., converting a single file vs batch). Does not explain when to choose error_handling or mismatch_policy options.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
dir_opsA
Directory operations: create, list, or delete.
Args: action: "create" | "list" | "delete" dir_path: Absolute path to the directory. depth: Listing depth (list only). format: "tree" | "flat" (list only). ignore_patterns: Glob patterns to exclude (list only). max_items: Max entries for flat listing. expected_mtime: Required for delete (conflict detection). confirm_token: Required for delete ("delete:"). allow_nonempty: Required for delete (explicit bool).
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| dir_path | Yes | ||
| depth | No | ||
| format | No | tree | |
| ignore_patterns | No | ||
| max_items | No | ||
| expected_mtime | No | ||
| confirm_token | No | ||
| allow_nonempty | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must disclose behaviors. It mentions safety requirements for delete (expected_mtime, confirm_token, allow_nonempty) but lacks details on success/failure returns, side effects, or output format.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Structured as a Python docstring with clear Args: section. Every line is informative, no redundant text. Concise and well-organized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers basic semantics for all parameters and actions, sufficient for correct invocation. Lacks overall context about output schema (though present), error handling, or interaction with sibling tools.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage; description adds meaning for all 9 parameters via the Args section, including constraints like 'list only' for depth, format, etc. Fully compensates for missing schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description states 'Directory operations: create, list, or delete', clearly indicating the tool's scope and actions. It distinguishes from sister tool 'file_ops' by specifying directory-specific operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives like 'file_ops' or 'edit_block'. The description only lists parameters without context for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
edit_blockB
Search and replace text in a file.
Args: file_path: Absolute path to the file. old_string: Text to find. new_string: Replacement text. expected_replacements: Required match count (default 1). expected_mtime: Conflict detection timestamp. ignore_whitespace: Match with flexible whitespace. normalize_escapes: Unescape \n, \t, etc. in search. encoding: File encoding (utf-8, gbk, gb2312).
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| old_string | Yes | ||
| new_string | Yes | ||
| expected_replacements | No | ||
| expected_mtime | No | ||
| ignore_whitespace | No | ||
| normalize_escapes | No | ||
| encoding | No | utf-8 |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses behavioral traits such as conflict detection via expected_mtime and flexible whitespace matching, adding value beyond the schema. However, it does not mention that the tool modifies files in place (destructive behavior) or describe the return value/output, leaving gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is reasonably concise, using a clear docstring format with Args list. Each parameter description is short but informative. It could be slightly more streamlined, but overall efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite covering all parameters, the description lacks information about the tool's return value (especially with an output schema present), error conditions, and the fact that it modifies files (destructive nature). For a mutation tool with no annotations, this is a significant gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description fully compensates by explaining all 8 parameters in the Args block, including their roles (e.g., 'Required match count' for expected_replacements, 'Conflict detection timestamp' for expected_mtime). This adds substantial meaning beyond the schema's types and titles.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Search and replace text in a file,' which is a specific verb+resource combination. However, it does not differentiate from sibling tools like 'edit_blocks' or 'file_ops', leaving potential ambiguity about when to use this tool over others.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus alternatives, nor any exclusions or prerequisites. The description lists parameters but does not explain context or scenarios where specific settings (e.g., ignore_whitespace) are advisable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
edit_blocksA
Apply multiple search/replace edits in a single call.
Args: edits: List of edit specs, each with: - file_path: Absolute path - old_string: Text to find - new_string: Replacement text - expected_replacements: Match count (default 1) - ignore_whitespace: Flexible whitespace (default False) - normalize_escapes: Unescape \n, \t (default False) error_policy: "fail-fast" | "continue" | "rollback" encoding: File encoding for all edits (utf-8, gbk, gb2312).
| Name | Required | Description | Default |
|---|---|---|---|
| edits | Yes | ||
| error_policy | No | fail-fast | |
| encoding | No | utf-8 |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry behavioral transparency. It explains error policy and encoding, but does not disclose side effects, permissions, or what happens on success/failure. Adequate but not thorough.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with an Args section, each parameter listed clearly. It is moderately concise; every sentence adds value, though slightly lengthy but justified by parameter complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the existence of an output schema (unseen), the description need not cover return values. It covers all three parameters, error handling choices, and encoding options. Lacks prerequisites or limitations but is fairly complete for a batch operation tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description fully compensates by detailing each field of 'edits' (file_path, old_string, new_string, etc.) and explaining error_policy and encoding with examples. Adds significant value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Apply multiple search/replace edits in a single call,' which is specific and distinguishes from the sibling tool 'edit_block' that handles single edits.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not explicitly guide when to use this tool versus alternatives like 'edit_block'. It only implies batching by saying 'multiple', but lacks clear usage context or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
file_opsA
File operations: write, append, copy, move, or delete.
Args: action: "write" | "append" | "copy" | "move" | "delete" file_path: Target path (write/append/delete). content: File content (write/append). source_path: Source path (copy/move). destination_path: Destination path (copy/move). expected_mtime: Conflict detection timestamp. encoding: Text encoding for write/append (utf-8, gbk, gb2312).
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| file_path | No | ||
| content | No | ||
| source_path | No | ||
| destination_path | No | ||
| expected_mtime | No | ||
| encoding | No | utf-8 |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must disclose behavior. It mentions actions and parameters but omits details like error handling, atomicity, or path resolution behavior. The conflict detection timestamp is mentioned but not explained.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is front-loaded with a purpose sentence, then uses a clear list format for parameters. Every sentence adds value with no redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 7 parameters and no annotations, the description covers all actions and parameter uses. Missing details like error handling or default behavior, but output schema (present) may supplement. Adequate for the complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description adds complete meaning for each parameter: outlines which actions use which parameters, enumerates encoding options, and specifies parameter roles (e.g., source_path for copy/move).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'File operations: write, append, copy, move, or delete' with specific verb+resource. Distinguishes itself from sibling tools like read_file and dir_ops by focusing on file manipulation actions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description lists actions but provides no explicit guidance on when to use this vs alternatives (e.g., read_file for reading). Usage context is implied but lacks when-not or comparison to siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_file_infoB
Get metadata for a file or directory.
Args: file_path: Absolute path to the target.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the full disclosure burden. It only states 'get metadata' which implies read-only, but does not confirm read-only behavior, error handling (e.g., file not found), or whether it works on directories. Minimal behavioral insight.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very short: one sentence plus an Args line. It is efficient and gets straight to the point. However, it could be improved with a bit more context without adding much length.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool is simple and has no output schema, the description should explain what 'metadata' includes (e.g., size, type, permissions) and potential errors. It does not, leaving the agent without essential information about return values or failure modes.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, but the description adds 'Absolute path to the target.' This provides crucial semantic meaning (must be absolute, refers to file or directory) beyond the type and name in the schema. Effectively compensates for the schema gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Get metadata for a file or directory.' It uses a specific verb ('Get') and resource ('metadata') that distinguishes it from sibling tools like 'read_file' (which reads content) and 'file_ops' (which performs operations). The scope is well-defined.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. It does not mention prerequisites (e.g., root path must be set), nor does it indicate when to prefer this over reading file content. The description lacks context for decision-making.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_allowed_rootsA
Return the current whitelist of allowed directories.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It declares a read operation (return) but lacks details on authentication, side effects, or rate limits. The behavior is straightforward, but the description could be more transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one short sentence with no unnecessary words. It is front-loaded with the action and resource, making it efficient and concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has no parameters and an output schema exists, the description is minimally adequate. However, it lacks context about the meaning of 'allowed directories' or how the whitelist is managed, leaving some room for improvement.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and the input schema covers 100% of the parameters (none). With no parameters, the description does not need to add parameter details, earning the baseline score of 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns the current whitelist of allowed directories, using a specific verb and resource. It distinguishes itself from sibling tools that perform file encoding and editing operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for retrieving allowed directories, but it does not provide explicit guidance on when to use it or mention any alternatives. The simplicity of the tool partially mitigates this lack.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_fileA
Read file content with optional line range.
Args: file_path: Absolute path to the file. offset: Start line (negative reads from end). length: Max lines to return. encoding: "auto"/None for auto-detection, or specify: utf-8, gbk, gb2312.
Returns: dict with keys: - content: File content as string - mimeType: MIME type of the file - isImage: Boolean indicating if file is an image - encoding: Detected encoding (e.g., "utf_8", "gbk", "gb2312") - encodingConfidence: Confidence score for encoding detection (float or None)
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| offset | No | ||
| length | No | ||
| encoding | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It explains encoding detection behavior and return value structure (content, mimeType, etc.). It does not disclose error handling or side effects, but covers core behaviors.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Structured with Args/Returns format, but slightly verbose. Every sentence adds value; no waste. Could be slightly more concise but still efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, so description includes return keys. Covers all parameters. Lacks mention of error handling or file size limits, but is otherwise complete for a read tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but description adds meaning: offset (negative for end), length (max lines), encoding (auto or specific). It clarifies file_path as absolute. Adds significant value beyond bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Read file content with optional line range', specifying the verb (read) and resource (file content). It distinguishes from siblings like read_files (plural) and get_file_info, showing specific scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use for reading files with optional line range but gives no guidance on when to use alternatives like convert_file_encoding or edit_block. No explicit when-not-to-use or sibling differentiation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_filesA
Read multiple files in a single call.
Args: file_paths: List of absolute file paths. encoding: "auto"/None for auto-detection, or specify: utf-8, gbk, gb2312.
Returns: list of dicts, each with keys: - path: File path - content: File content as string - mimeType: MIME type of the file - isImage: Boolean indicating if file is an image - encoding: Detected encoding (e.g., "utf_8", "gbk", "gb2312") - encodingConfidence: Confidence score for encoding detection (float or None) - error: Error message (only present if read failed)
| Name | Required | Description | Default |
|---|---|---|---|
| file_paths | Yes | ||
| encoding | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries the full burden, disclosing return structure (list of dicts with keys like path, content, mimeType, isImage, encoding, encodingConfidence, error) and encoding auto-detection behavior. It implies read-only, but no mention of limits or performance.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-formatted with Args and Returns sections, but slightly verbose. Front-loads purpose, but some lines (like encoding confidence) could be shortened.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema (described), the description covers input, output, and key behaviors. Missing context about allowed roots (sibling 'list_allowed_roots') but otherwise sufficient for a read operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description compensates by explaining 'file_paths' as absolute paths and 'encoding' with common values ('utf-8', 'gbk', 'gb2312') and auto-detection, adding significant meaning beyond the raw schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool reads multiple files in a single call, with a specific verb ('read') and resource ('files'). It distinguishes from siblings like 'read_file' (singular) and other file operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this versus alternatives (e.g., 'read_file' for single files) or when to specify encoding. The description lacks explicit context for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
set_root_pathB
Add a directory to the allowed whitelist.
Args: root_path: Absolute path to an existing directory.
| Name | Required | Description | Default |
|---|---|---|---|
| root_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description implies a mutation ('add') but fails to disclose side effects, permission requirements, or behavior on duplicates. With no annotations provided, the tool's safety profile and behavioral nuances are inadequately communicated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is the minimal viable length of two sentences, with the parameter note separated. It is front-loaded and efficient, though the parameter detail could arguably be integrated into the schema's description field.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema (not shown), the description should cover edge cases like duplicate entries or invalid paths. The current text is overly simple for a tool that modifies system state, leaving many queries unanswered.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The documentation for the parameter 'root_path' adds critical constraints ('absolute path', 'existing directory') beyond the schema's type-only definition. This significantly aids the AI in correctly invoking the tool, though format and validation details are omitted.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Add a directory to the allowed whitelist' with a specific verb and resource. It effectively distinguishes this tool from siblings like 'list_allowed_roots' (read-only) and general file operations, making the tool's purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives, such as 'dir_ops' for adding directories. There is no mention of prerequisites (e.g., the directory must exist) or exclusive contexts, leaving the AI agent to infer usage patterns.
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 tool update
v0.2.5- Added
get_file_info
1 tool update
v0.2.4- Removed
get_file_info
10 tool updates
- First observed
convert_file_encoding - First observed
dir_ops - First observed
edit_block - First observed
edit_blocks - First observed
file_ops - First observed
get_file_info - First observed
list_allowed_roots - First observed
read_file - First observed
read_files - First observed
set_root_path
TDQS
Most tools have distinct purposes, but edit_block and edit_blocks are very similar in function, differing only in whether they apply a single or multiple edits. This overlap could cause an agent to select the wrong one. Other tools like dir_ops and file_ops are clear.
Naming is a mix of verb_noun (convert_file_encoding, edit_block, read_file) and noun_verb (dir_ops, file_ops). The 'ops' suffix is not a verb, breaking the pattern. Also singular/plural vary (edit_block vs edit_blocks, read_file vs read_files) but are consistent in context.
10 tools is well-scoped for a code editor server, covering file reading/writing/editing, directory ops, encoding, and configuration. Each tool earns its place without bloat or deficiency.
The tool set covers most core code editing operations: read, write, edit, directory listing, encoding conversion, and root management. A notable gap is the lack of a content search across files, which would be useful for a code editor. Otherwise, the surface is solid.
Maintenance
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
Manage files and folders directly from your workspace. Read and write files, list directories, cre…
Securely search and manage workspace context files for AI agents and teams.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Manage websites, help documents and customer-support conversations with safe, scoped tools.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables secure filesystem operations with directory sandboxing and optional read-only mode. Supports file reading/writing, directory management, file searching, and text operations while restricting access to specified directories.12-
- FlicenseNot gradedqualityDmaintenanceEnables safe file system operations including reading, writing, updating, and deleting files with built-in security safeguards, automatic backups, and comprehensive error handling. Provides directory listing, file metadata extraction, and protects against operations on system-critical paths.-
- FlicenseNot gradedqualityNot gradedmaintenanceEnables comprehensive filesystem operations including reading/writing files, directory management, file searching, editing with diff preview, compression, hashing, and merging with dynamic directory access control.668,809-
- AlicenseNot gradedqualityDmaintenanceEnables 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.1675ISC
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/TripQi/code-editor'
If you have feedback or need assistance with the MCP directory API, please join our Discord server