Get the FREE Ultimate OpenClaw Setup Guide →

mcp -file-modifier

Model Context Protocol server for file modifications and control

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jpinillagoshawk-mcp-server-file-modifier mcp-server-file-modifier \
  --env PORT="3000"

How to use

This MCP server provides file modification capabilities accessible via MCP. It allows AI assistants to perform edits on text files by adding content at a specific line, replacing existing content, or deleting content that matches a target. It supports UTF-8 encoded files, enabling reliable handling of various languages and characters. To use it, run the server locally and connect to its MCP endpoints using the supported operations: add, replace, and delete. The server defaults to port 3000, so ensure your client is pointed to http://localhost:3000 (or the configured port) to issue MCP commands. Once running, you can issue an add action to insert content at a given line, a replace action to swap out matching content, or a delete action to remove target content. The tool is designed to integrate with Claude or other AI assistants to streamline content modification workflows within codebases or text documents.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Access to a terminal or command prompt

Step-by-step:

  1. Install the MCP server globally via npm: npm install -g mcp-server-file-modifier

  2. Start the server: mcp-server-file-modifier

  3. Verify the server is running by visiting http://localhost:3000 or checking the terminal output for a listening message.

  4. Optional: configure environment variables or port if needed (PORT can be changed if your environment requires a different port).

Additional notes

Notes and tips:

  • Default port is 3000; adjust PORT as needed via environment variables.
  • Ensure target files are UTF-8 encoded to avoid character misinterpretation.
  • The API supports three operations: add (insert at a specific line), replace (target-based replacement), and delete (target-based deletion).
  • If running behind a firewall or proxy, ensure the MCP endpoints are accessible from your AI assistant integration.
  • When integrating with automation, consider wrapping calls with error handling for scenarios where targets are not found or line numbers are out of range.
  • Since the server is CLI-based, ensure the executable is in your system PATH when installed globally.

Related MCP Servers

Sponsor this space

Reach thousands of developers