Skip to main content
Glama
TripQi

Code Editor MCP Server

by TripQi

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 服务生效。

环境变量一览:

变量

作用

默认值

CODE_EDIT_ROOT

安全标记(非访问边界,不做路径解析)

当前工作目录

CODE_EDIT_TOOL_ENABLED_CONFIG_OPS

开关 config_ops 工具

启用

CODE_EDIT_TOOL_ENABLED_READ_FILES

开关 read_files 工具

启用

CODE_EDIT_TOOL_ENABLED_DIR_OPS

开关 dir_ops 工具

启用

CODE_EDIT_TOOL_ENABLED_FILE_OPS

开关 file_ops 工具

启用

CODE_EDIT_TOOL_ENABLED_EDIT_BLOCKS

开关 edit_blocks 工具

启用

CODE_EDIT_TOOL_ENABLED_CONVERT_FILE_ENCODING

开关 convert_file_encoding 工具

启用

CODE_EDIT_FILE_READ_LINE_LIMIT

(legacy)内部 read_file 默认行数上限;read_files v2 使用 page_line_count/max_lines_per_snippet 控制输出

1000

CODE_EDIT_FILE_WRITE_LINE_LIMIT

file_ops 写入行数警戒

50

设计要点

  • 路径访问:白名单已移除,任意绝对路径均可访问;相对路径仍被拒绝。CODE_EDIT_ROOT 仅作删除安全标记,不做路径拼接。

  • 工具开关:每个工具可通过 CODE_EDIT_TOOL_ENABLED_<TOOL> 独立禁用;禁用后不注册,客户端与智能体完全不可见、不可调用。

  • 乐观锁:写/删类支持秒或纳秒级 expected_mtime,10ms 容忍;写入走原子写避免部分落盘。

  • 默认忽略:.git__pycache__node_modules.DS_Store.env*.venv*.log*.pemignore_patterns 传空字符串/空列表可关闭默认忽略。

  • 编码感知:read_files v2 默认逐文件 auto 检测/复用编码(基于最新 mtime 刷新的元信息缓存);如自动结果乱码,可在每个 request 里显式传 encoding 覆盖。

  • 安全删除:禁止删除当前根/其祖先/关键系统目录。

MCP 工具(code-editor)

文件系统工具

名称

工具

功能

主要参数/说明

常见误用

config_ops

config_ops(action, path=None)

元信息查询

action=get_infopath 为文件/目录绝对路径

拼错 action;误以为还有 set_root/list_roots

read_files

read_files(requests, default_encoding="auto", page_line_count=400, max_snippets=64, max_total_chars=200000, max_chars_per_snippet=50000, max_lines_per_snippet=2000, parallelism=4)

LLM 友好读取:多文件/同文件多片段 + 分页

requestslist[dict]:支持 mode=range/tail/all;行号 1-based;可用 cursor 继续分页;返回结构化 results[],每项含 content(纯内容)、start_line/end_linecore_*encodingsha256_utf8、可选 next_cursorencoding 支持 auto/utf-8/gbk/gb2312/gb18030;任意绝对路径均可读取

继续传旧的 file_paths;把 start_line 当 0-based;一次请求太多片段触发 max_total_chars;对图片用 range/tail

dir_ops

`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)`

统一目录操作

action=create/list/delete;绝对路径;list: tree 返回字符串列表、flat 返回字典列表;ignore_patterns 为 None 用默认忽略,空字符串/空列表关闭默认忽略;flat 下 max_items 限制返回条数;delete: 必须提供 expected_mtimeconfirm_tokenallow_nonemptyconfirm_token=delete:<normalized_abs_path>(Path.resolve + os.path.normcase);高风险删除会返回结构化 needs_approval 并要求 approval_token 二次提交

file_ops

file_ops(action, file_path=None, content=None, source_path=None, destination_path=None, expected_mtime=None, encoding="utf-8", 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 目标是目录

convert_file_encoding

convert_file_encoding(file_paths, source_encoding, target_encoding, error_handling="strict", mismatch_policy="warn-skip")

批量转码并覆盖写回

绝对路径列表;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 必须;其余参数会被忽略。

  • listformat 仅支持 tree/flatmax_items 必须为正整数或 None。

  • delete:必须同时提供 expected_mtimeconfirm_tokenallow_nonempty(显式 True/False)。

  • 删除行为统一移动到回收站,不支持永久删除。

  • 命中高风险规则时会返回 status=needs_approval,响应内包含 approval_tokenllm_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

edit_blocks(edits, error_policy="fail-fast", encoding="auto")

单编辑/批量编辑:搜索替换

edits 支持 dict(单编辑,支持大文件)或 list[dict](批量,支持同文件多处与多文件);每个 edit 必须有 file_path(注意不是 path);支持 encoding="auto" 自动检测;批量模式支持 error_policy: fail-fast/continue/rollback

read_filespath 当成 file_path;传了不支持的编码;批量模式传空列表;大文件用批量模式(应改为单编辑 dict)

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 tools
convert_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"

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathsYes
source_encodingYes
target_encodingYes
error_handlingNostrict
mismatch_policyNowarn-skip

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYes
dir_pathYes
depthNo
formatNotree
ignore_patternsNo
max_itemsNo
expected_mtimeNo
confirm_tokenNo
allow_nonemptyNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYes
old_stringYes
new_stringYes
expected_replacementsNo
expected_mtimeNo
ignore_whitespaceNo
normalize_escapesNo
encodingNoutf-8

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.4/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters5/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
editsYes
error_policyNofail-fast
encodingNoutf-8

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYes
file_pathNo
contentNo
source_pathNo
destination_pathNo
expected_mtimeNo
encodingNoutf-8

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYes

TDQS

B3.3/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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)

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYes
offsetNo
lengthNo
encodingNo

TDQS

A4.2/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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)

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathsYes
encodingNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
root_pathYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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. 1 tool updatev0.2.5
    • Addedget_file_info
  2. 1 tool updatev0.2.4
    • Removedget_file_info
  3. 10 tool updates
    • First observedconvert_file_encoding
    • First observeddir_ops
    • First observededit_block
    • First observededit_blocks
    • First observedfile_ops
    • First observedget_file_info
    • First observedlist_allowed_roots
    • First observedread_file
    • First observedread_files
    • First observedset_root_path

TDQS

A3.7/5.0
Disambiguation4/5

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 Consistency3/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessSyncing

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

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Enables 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
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
    -
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables 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
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
    16
    75
    ISC

Latest Blog Posts

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