mcp-text-editor-server
The MCP Text Editor Server is a versatile server implementation following the Model Context Protocol. It allows clients like Claude to interact with and manipulate files within a defined directory using a variety of commands for editing, viewing, and creating content. The server ensures security with path validation and automatic backups.
MCP Text Editor Server
A Model Context Protocol (MCP) server that offers capabilities similar to Anthropic's text editor tool, allowing clients like Claude to read and modify files in a specific directory.
Features
- View: Examine file content or list directory contents.
- Str_replace: Perform targeted text replacements.
- Edit: Modify code blocks by line numbers.
- Insert: Add new content at specified line numbers.
- Create: Make new files or overwrite existing ones.
- Undo_edit: Restore files from backups.
Installation
Requires Node.js 16+, TypeScript. Set up by creating a project, installing dependencies, configuring TypeScript, saving source code, and compiling.
Usage
Run the server using a specified command; integrate with Claude by adding to configuration.
Security Features
Includes path validation, automatic backups, error handling, and directory creation.
Example Conversations
Enables creation of scripts, fixing code, adding docstrings, and refactoring code with Claude.
Usage Rules
Guidance provided for Claude on file operations including view, edit, str_replace, insert, create, and undo_edit.