{"$schema":"https://wellknown.network/schemas/agent-record-v1.json","schemaVersion":"1","id":"ag_k7yva7pdjrfd","handle":"code-editor-mcp","url":"https://wellknown.network/agents/code-editor-mcp","links":{"self":"https://wellknown.network/agents/code-editor-mcp/record.json","html":"https://wellknown.network/agents/code-editor-mcp","markdown":"https://wellknown.network/agents/code-editor-mcp/record.md","api":"https://wellknown.network/api/v1/agents/code-editor-mcp","status":"https://wellknown.network/api/v1/agents/code-editor-mcp/status","claim":"https://wellknown.network/agents/code-editor-mcp/claim","claimApi":"https://wellknown.network/api/v1/claims","claimDescriptor":"https://wellknown.network/agents/code-editor-mcp/claim.json","badge":"https://wellknown.network/agents/code-editor-mcp/badge.svg","openapi":"https://wellknown.network/openapi.json","history":"https://wellknown.network/api/v1/agents/code-editor-mcp/history","tools":"https://wellknown.network/api/v1/agents/code-editor-mcp/tools"},"ard":{"identifier":"urn:air::server:code-editor-mcp","type":"application/mcp-server-card+json"},"kind":"mcp_server","declared":{"name":"code-editor-mcp","summary":"Code editor MCP server with sandboxing, optimistic locking, and path whitelists.","description":"## code-editor\n\n面向多客户端并发、安全沙箱、编码感知的代码编辑 MCP 服务器。\n> 路径访问更新：**所有参数必须是绝对路径**。除 `read_files` 外，其余文件/目录工具仍校验是否落在允许目录列表内。`CODE_EDIT_ROOT` 只是安全标记，不做访问边界或相对路径解析；访问新目录请用 `config_ops(action=\"set_root\", path=\"...\")` 加入允许列表。\n\n### 安装与运行\n```bash\n# 安装（pip 或 uv 均可，包名 code-editor-mcp）\npip install code-editor-mcp         # 或 uv pip install code-editor-mcp\n\n# 更新最新版\npip install -U code-editor-mcp\n\n# 直接启动 CLI 入口\ncode-editor\n\n# 若从源码运行\nuv sync\nuv run python server.py\n```\n\n关键环境变量：\n- `CODE_EDIT_ROOT`：安全标记（默认启动时的 CWD），不做访问边界，也不参与相对路径解析。\n- `CODE_EDIT_ALLOWED_ROOTS_FILE`：允许目录持久化 JSON，默认 `tools/.code_edit_roots.json`。\n- `CODE_EDIT_ALLOWED_DIRECTORIES`：逗号分隔允许目录列表（兼容旧的 `CODE_EDIT_ALLOWED_ROOTS`）。\n\n环境变量一览：\n\n| 变量 | 作用 | 默认值 |\n| --- | --- | --- |\n| `CODE_EDIT_ROOT` | 安全标记（非访问边界，不做路径解析） | 当前工作目录 |\n| `CODE_EDIT_ALLOWED_ROOTS_FILE` | 允许目录持久化文件 | `tools/.code_edit_roots.json` |\n| `CODE_EDIT_ALLOWED_DIRECTORIES` (兼容 `CODE_EDIT_ALLOWED_ROOTS`) | 额外允许目录（逗号分隔） | 空 |\n| `CODE_EDIT_FILE_READ_LINE_LIMIT` | （legacy）内部 `read_file` 默认行数上限；`read_files` v2 使用 `page_line_count/max_lines_per_snippet` 控制输出 | 1000 |\n| `CODE_EDIT_FILE_WRITE_LINE_LIMIT` | `file_ops` 写入行数警戒 | 50 |\n\n### 设计要点\n- 允许目录列表：默认允许用户主目录；路径需落在允许目录内，否则拒绝。`config_ops(action=\"set_root\")` 仅将目录加入允许列表并更新安全标记，不做路径拼接。\n- 持久允许目录：`config_ops(action=\"set_root\")` 成功后写入 JSON，可跨会话复用。\n- 乐观锁：写/删类支持秒或纳秒级 `expected_mtime`，10ms 容忍；写入走原子写避免部分落盘。\n- 默认忽略：`.git`、`__pycache__`、`node_modules`、`.DS_Store`、`.env*`、`.venv`、`*.log`、`*.pem`；`ignore_patterns` 传空字符串/空列表可关闭默认忽略。\n- 编码感知：`read_files` v2 默认逐文件 `auto` 检测/复用编码（基于最新 mtime 刷新的元信息缓存）；如自动结果乱码，可在每个 request 里显式传 `encoding` 覆盖。\n- 安全删除：禁止删除当前根/其祖先/关键系统目录。\n\n### MCP 工具（code-editor）\n\n#### 文件系统工具\n\n| 名称 | 工具 | 功能 | 主要参数/说明 | 常见误用 |\n| --- | --- | --- | --- | --- |\n| `config_ops` | `config_ops(action, path=None)` | 允许目录管理 + 元信息 | `action`=set_root/list_roots/get_info；`path` 仅 set_root/get_info 需要 | 拼错 action；误以为 list_roots 需要 path |\n| `read_files` | `read_files(requests, default_encoding=\"auto\", page_line_count=400, max_snippets=64, max…","publisher":{"name":"TripQi","url":null},"homepage":"https://github.com/TripQi/code-editor","repository":"https://github.com/TripQi/code-editor","version":"0.2.5","license":null,"protocols":["mcp"],"tags":["mcp","文件编辑"],"pricing":null,"endpoints":[{"url":"pypi:code-editor-mcp","type":"package_pypi","auth":null,"probeable":false}],"skills":null,"tools":null,"extra":null,"attribution":{"kind":"pypi","name":"pypi","repoUrl":"pypi","summary":"pypi","version":"pypi","description":"pypi","homepageUrl":"pypi","publisherName":"pypi"}},"derived":{"capabilities":[{"slug":"dev.filesystem","name":"Filesystem","confidence":0.802,"provenance":"derived"}],"categories":["dev"],"language":"en"},"observed":{"status":"unknown","statusReason":"Distributed as a package to run locally; no network endpoint to check.","lastOkAt":null,"lastProbedAt":null,"statusComputedAt":null,"reliability30d":null,"latestObservations":[],"tools":null,"package":{"name":"code-editor-mcp","registry":"pypi","observedAt":"2026-09-15T11:23:10.799Z","publishedAt":"2026-04-18T05:56:36.827850Z","latestVersion":"0.2.5"},"toolSurface":null,"endpointFacts":[]},"verification":{"claimed":false,"claimedAt":null,"proofs":[]},"provenance":{"sources":[{"source":"pypi","key":"code-editor-mcp","url":"https://pypi.org/project/code-editor-mcp/","firstSeenAt":"2026-09-09T11:31:31.168Z","fetchedAt":"2026-09-15T11:22:34.200Z","normalizedAt":"2026-09-15T11:22:34.200Z"}]},"firstSeenAt":"2026-09-09T11:31:31.168Z","updatedAt":"2026-09-15T11:23:10.799Z"}