Get the FREE Ultimate OpenClaw Setup Guide →

mcp -text-editor

An open source implementation of the Claude built-in text editor tool

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio bhouston-mcp-server-text-editor npx -y mcp-server-text-editor

How to use

This MCP server implements Claude's built-in text editor tool as a standardized MCP service. It exposes an API that lets you view, create, modify, and manage text files through a consistent tool interface. You can start the server locally using npx as shown in the usage examples, then connect to it via the MCP protocol by configuring it in Claude Desktop or your MCP client. The server supports the same operations as Claude’s text editor, including viewing file contents (with optional line ranges), creating new files, performing string replacements, inserting text at a specific line, and undoing the most recent edit.

How to install

Prerequisites:

  • Node.js 18+
  • pnpm (optional but recommended)

Install and run locally:

  1. Install the MCP server package from npm or run via npx:

    npm install -g mcp-server-text-editor

    or run directly without installation

    npx -y mcp-server-text-editor

  2. Start the server (if installed globally, you can simply run the command below):

    mcp-server-text-editor

  3. If you prefer to install and run via pnpm helper, you can set up your environment and then start the server in your project:

    git clone https://github.com/bhouston/mcp-server-text-editor.git cd mcp-server-text-editor pnpm install pnpm build pnpm start

  4. To integrate with Claude Desktop or another MCP client, configure the MCP server reference as shown in the README example (textEditor) within your mcpServers configuration.

Additional notes

Tips:

  • The server implements the following tool commands: view, create, str_replace, insert, and undo_edit. Each command follows the Claude Text Editor API surface so it should be straightforward to integrate into existing workflows.
  • If you run into port or startup issues, verify your Node.js version and ensure npm/pnpm are up to date. Check that your environment allows executing npx commands and accessing the npm registry.
  • When using Claude Desktop, you typically configure the server in the mcpServers section with command: "npx" and args: ["-y", "mcp-server-text-editor"], as shown in the usage example.
  • You may customize file operations by providing appropriate JSON payloads to the tool API, e.g., view with path and an optional view_range, or insert to place new text at a specific line.
  • If you need to revert changes, use undo_edit with the target file path to revert the last modification.

Related MCP Servers

Sponsor this space

Reach thousands of developers