mcp-editor
mcp 编辑器
这是将 Anthropic 的文件系统编辑工具从其计算机使用演示直接移植到 TypeScript MCP 服务器的版本。它主要由 Claude Sonnet 3.5 在 Roo Cline(现为 Roo Code)上编写,可能缺乏足够的直接监督。我检查了代码并每天都使用此服务器,但可能存在错误或 AI 异常。
我建议将此服务器与mcp-server-commands一起使用
警告:此 MCP 服务器没有访问控制,完全依赖于您客户端的批准机制。使用风险自负。请勿自动批准写入操作,否则相当于授予 LLM 销毁您计算机的权限。
警告:此 MCP 服务器并非主动维护,仅供参考(例如,创建您自己的具有适当访问控制的 MCP 服务器)。我可能会不时更新它。
用法
获取计算机上的文件。运行:
npm install
npm build如果您使用的是 Claude 桌面应用程序,请将其粘贴到“mcpServers”下的配置中,并编辑路径以匹配您放置 mcp-editor 的位置:
{
"mcpServers":
... your existing servers ...
"mcp-editor": {
"command": "node",
"args": ["/absolute/path/to/mcp-editor/dist/server.js"]
}
}
}如果您正在使用MCP 安装程序,则只需向您的 LLM 提供磁盘上 mcp-editor 的路径。
Available Tools
5 toolscreateC
Create a new file with specified content
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path where file should be created | |
| file_text | Yes | Content to write to the file |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates a file but doesn't mention critical behaviors like whether it overwrites existing files, requires specific permissions, handles errors, or what happens on success/failure. This is inadequate for a mutation tool with zero annotation coverage.
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 a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core action, making it easy to parse quickly, and every part of the sentence contributes essential information.
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?
For a file creation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., overwrite behavior, error handling), usage context compared to siblings, and expected outcomes, making it insufficient for safe and effective agent use.
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 schema description coverage is 100%, with clear descriptions for both parameters ('path' and 'file_text'). The description adds no additional semantic context beyond what the schema provides, such as file format expectations or path validation rules, so it meets the baseline score when the schema does the heavy lifting.
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 ('Create a new file') and the resource ('with specified content'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'insert' or 'string_replace', which might also involve file content manipulation, so it doesn't reach the highest score.
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 provides no guidance on when to use this tool versus alternatives like 'insert' or 'string_replace'. It doesn't mention prerequisites, such as whether the path must exist or if it overwrites existing files, leaving the agent without contextual usage information.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
insertC
Insert text at a specific line in the file
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the file | |
| insert_line | Yes | Line number where text should be inserted | |
| new_str | Yes | Text to insert |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool inserts text but doesn't mention whether this is a destructive operation (e.g., modifies the file permanently), what permissions are required, error handling (e.g., if line number is out of bounds), or side effects. This leaves significant gaps in understanding the tool's behavior beyond its basic function.
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 a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It is appropriately sized and front-loaded, making it easy to understand at a glance, with every part contributing to clarity.
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 complexity of a file editing tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like safety, permissions, or error handling, nor does it explain return values or side effects. For a tool that modifies files, this lack of context makes it inadequate for safe and effective use.
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 100% description coverage, clearly documenting all three parameters (path, insert_line, new_str). The description adds no additional meaning beyond what the schema provides, such as formatting details or usage examples. According to the rules, with high schema coverage, the baseline score is 3, as the schema does the heavy lifting.
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 ('Insert text') and target ('at a specific line in the file'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'create' (which might create files) or 'string_replace' (which might replace text rather than insert), leaving some ambiguity about when to choose this over alternatives.
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 provides no guidance on when to use this tool versus alternatives like 'create', 'string_replace', or 'undo_edit'. It lacks context about prerequisites (e.g., file must exist), exclusions, or typical scenarios for insertion versus other editing operations, offering only a basic functional statement.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
string_replaceC
Replace a string in a file with a new string
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the file | |
| old_str | Yes | String to replace | |
| new_str | No | Replacement string (empty string if omitted) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Replace a string in a file') but doesn't mention critical behaviors such as whether the operation is destructive, requires file permissions, handles errors (e.g., if the string isn't found), or affects file encoding. This leaves significant gaps for safe and effective use.
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 a single, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse for an AI agent.
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's complexity (a file mutation operation) and the lack of annotations and output schema, the description is insufficient. It doesn't cover behavioral aspects like safety, error handling, or output format, which are crucial for a tool that modifies files. This leaves the agent with incomplete context for reliable use.
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 100% description coverage, clearly documenting all three parameters (path, old_str, new_str). The description adds no additional meaning beyond what the schema provides, such as examples or edge cases (e.g., handling empty strings or special characters). Thus, it meets the baseline score when schema coverage is high.
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's purpose with a specific verb ('Replace') and resource ('a string in a file'), making it immediately understandable. However, it doesn't differentiate from sibling tools like 'insert' or 'undo_edit', which might also modify files, so it doesn't reach the highest score.
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 provides no guidance on when to use this tool versus alternatives like 'insert' or 'undo_edit'. It lacks context about scenarios where string replacement is preferred over other editing operations, leaving the agent to infer usage from the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
undo_editC
Undo the last edit to a file
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the file |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool 'undoes' an edit, implying mutation/reversal, but doesn't specify whether this is destructive, requires specific permissions, has limitations (e.g., only one undo level), or what happens on failure. This leaves significant behavioral gaps for a mutation tool.
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 a single, efficient sentence that directly states the tool's purpose with zero wasted words. It's appropriately front-loaded and earns its place by clearly communicating the core functionality.
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?
For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't address critical context like what 'undo' entails (revert to previous state? delete last change?), error conditions, or return values. Given the complexity of file editing operations, more behavioral detail is needed.
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 100%, with the single parameter 'path' clearly documented in the schema. The description doesn't add any parameter-specific details beyond what the schema provides (e.g., it doesn't clarify path format requirements or edit history implications), so it meets the baseline for high schema coverage.
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 ('undo') and target ('last edit to a file'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'create' or 'insert', which are also file operations but with different purposes.
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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., requires an edit history), exclusions (e.g., cannot undo deletions), or suggest when other tools like 'string_replace' might be more appropriate for different editing needs.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
viewB
View file contents or directory listing
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the file or directory | |
| view_range | No | Optional range of lines to view [start, end] |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool is for viewing, implying read-only behavior, but doesn't disclose other traits like error handling (e.g., what happens if the path doesn't exist), permissions required, or output format. For a tool with no annotations, this leaves significant gaps in understanding its behavior beyond the basic purpose.
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 extremely concise with 'View file contents or directory listing', a single sentence that front-loads the core purpose without any wasted words. It efficiently communicates the tool's function, making it easy to parse and understand quickly.
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 no annotations and no output schema, the description is incomplete for a tool with 2 parameters. It lacks details on behavioral traits, error handling, and what the output looks like (e.g., text content vs. structured listing). For a read operation with no structured output info, more context is needed to fully understand how to use and interpret results.
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 100% description coverage, with clear docs for 'path' and 'view_range'. The description adds no additional meaning beyond the schema, such as examples or edge cases. Since schema coverage is high, the baseline score is 3, as the description doesn't compensate but also doesn't detract from the well-documented parameters.
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's purpose with 'View file contents or directory listing', specifying both verb ('View') and resources ('file contents', 'directory listing'). It distinguishes from siblings like 'create', 'insert', and 'string_replace' by indicating read-only access, though it doesn't explicitly differentiate from 'undo_edit' which might also involve viewing. The description is specific but could be more precise about sibling differentiation.
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 usage for viewing files or directories, suggesting when to use it (e.g., to inspect content or list items). However, it lacks explicit guidance on when not to use it or alternatives, such as using other tools for editing or creation. No prerequisites or exclusions are mentioned, leaving usage context somewhat vague.
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.
5 tool updates
- First observed
create - First observed
insert - First observed
string_replace - First observed
undo_edit - First observed
view
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose with no overlap: create makes new files, insert adds text at lines, string_replace modifies content, undo_edit reverses changes, and view reads content or lists directories. The descriptions make it easy to differentiate between file creation, editing operations, and viewing.
Most tools follow a consistent verb-based naming pattern (create, insert, view, undo_edit), but 'string_replace' deviates slightly by using a compound term instead of a simple verb like 'replace'. This minor inconsistency is still readable and doesn't hinder usability significantly.
With 5 tools, this server is well-scoped for basic file editing operations. Each tool earns its place by covering essential functions like creation, insertion, replacement, undo, and viewing, making it neither too sparse nor overloaded for its domain.
The tool set covers core file editing workflows well, including create, modify (insert and replace), undo, and view. A minor gap is the lack of a delete or rename tool, which agents might need for full file management, but the existing tools allow effective editing without dead ends.
Maintenance
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
A simple Typescript MCP server built using the official MCP Typescript SDK and smithery/cli. This…
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA TypeScript-based MCP server that provides tools for making precise line-based edits to text files within allowed directories.34MIT
- AlicenseAqualityBmaintenanceAn MCP server that implements Claude Code-like functionality, allowing the AI to analyze codebases, modify files, execute commands, and manage projects through direct file system interactions.15304MIT
- AlicenseAqualityDmaintenanceA TypeScript-based MCP server that enables Claude Desktop to perform file operations and retrieve system information, with built-in security features that restrict access to safe directories only.65 npmMIT
- AlicenseNot gradedqualityDmaintenanceStandalone TypeScript MCP server for filesystem operations with robust security, encoding support, and cross-platform path handling.1 npmMIT