Code Editor MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CODE_EDIT_ROOT | No | 安全标记(默认启动时的 CWD),不做访问边界,也不参与相对路径解析。 | . |
| CODE_EDIT_ALLOWED_ROOTS | No | 逗号分隔允许目录列表(已被 CODE_EDIT_ALLOWED_DIRECTORIES 替代,保留兼容性) | |
| CODE_EDIT_ALLOWED_ROOTS_FILE | No | 允许目录持久化 JSON 文件路径 | tools/.code_edit_roots.json |
| CODE_EDIT_ALLOWED_DIRECTORIES | No | 逗号分隔允许目录列表(兼容旧的 CODE_EDIT_ALLOWED_ROOTS) | |
| CODE_EDIT_FILE_READ_LINE_LIMIT | No | read_file 最大行数限制 | 1000 |
| CODE_EDIT_FILE_WRITE_LINE_LIMIT | No | file_ops 写入行数警戒值 | 50 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| set_root_pathB | Add a directory to the allowed whitelist. Args: root_path: Absolute path to an existing directory. |
| get_file_infoB | Get metadata for a file or directory. Args: file_path: Absolute path to the target. |
| list_allowed_rootsA | Return the current whitelist of allowed directories. |
| 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) |
| 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) |
| 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). |
| 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). |
| 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). |
| 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). |
| 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" |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 10 tools
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.