Used as the runtime environment for the MCP server, with version 16 or higher required as a prerequisite.
Manages Edit's TUI (Text User Interface) interactions programmatically, allowing AI systems to work with Microsoft Edit's text-based interface for complex editing operations.
Edit-MCP: Model Context Protocol Server for Microsoft Edit
Edit-MCP is a Model Context Protocol (MCP) server that integrates with Microsoft's Edit tool to provide advanced file editing capabilities to AI systems. It follows a hybrid architecture that combines direct file system operations for performance with Microsoft Edit integration for complex editing tasks.
Overview
The Edit-MCP server acts as a sophisticated coordinator between AI systems and file editing operations. It exposes a standardized MCP interface that allows AI models to:
Read and write files
Search and replace text
Format code
Perform complex editing operations
Coordinate multi-file edits
And more...
Architecture
Edit-MCP follows a hybrid architecture with the following components:
1. Core MCP Server
Handles MCP protocol communication
Routes operations to appropriate subsystems
Manages file state and metadata
Coordinates between multiple Edit instances
Provides caching and optimization
2. File System Manager
Performs direct file operations for simple tasks
Handles basic CRUD operations
Provides text search and simple find/replace
Manages file metadata operations
Supports batch operations across multiple files
3. Edit Instance Manager
Manages Microsoft Edit processes for complex operations
Handles complex editing scenarios
Coordinates multi-file operations
Manages Edit's TUI interactions programmatically
4. Operation Router
Decides which subsystem handles each operation
Routes simple operations to File System Manager
Routes complex operations to Edit Instance Manager
Coordinates hybrid operations between both subsystems
Installation
Prerequisites
Node.js 16 or higher
Microsoft Edit installed and available in your PATH
Install from Source
Usage
Starting the Server
You can start the Edit-MCP server using either stdio or HTTP transport:
Command Line Options
Configuration
You can configure Edit-MCP using a JSON configuration file:
Available Tools
Edit-MCP provides the following tools:
File System Tools
read_file
: Read the contents of a filewrite_file
: Write content to a filelist_files
: List files in a directoryfind_in_file
: Find occurrences of a pattern in a file
Edit Tools
format_code
: Format code in a filecomplex_find_replace
: Perform advanced find and replace operationsinteractive_edit_session
: Start an interactive editing session
Hybrid Tools
smart_refactor
: Intelligently refactor code across multiple filesbackup_and_edit
: Create backups of files before editing them
HTTP Transport
Edit-MCP now supports HTTP transport in addition to stdio, allowing remote access and REST API endpoints.
Starting with HTTP Transport
REST API Endpoints
Health Check
JSON-RPC Endpoint
REST API Endpoints
GET /api/tools
- List available toolsPOST /api/tools/:toolName
- Call a specific toolGET /api/files/:path
- Read file contentPUT /api/files/:path
- Write file contentGET /api/list/:directory
- List files in directoryPOST /api/search
- Search for patterns in filesPOST /api/format
- Format codePOST /api/refactor
- Refactor symbols across filesGET /api/docs
- API documentation
Authentication
Enable API key authentication by setting authEnabled: true
in your config:
Include the API key in requests:
Header:
X-API-Key: your-secure-api-key
Query parameter:
?apiKey=your-secure-api-key
CORS Configuration
Configure allowed origins in your config file:
Rate Limiting
Configure rate limiting to prevent abuse:
Development
Building the Project
Running in Development Mode
License
MIT
Acknowledgements
Microsoft for the Edit tool
The Model Context Protocol community
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
A Model Context Protocol server that integrates with Microsoft's Edit tool, allowing AI systems to perform file operations from simple reads/writes to complex code editing and refactoring.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides tools for code modification and generation via Large Language Models, allowing users to create, modify, rewrite, and delete files using structured XML instructions.Last updated -122MIT License
Appwrite MCP Serverofficial
AsecurityAlicenseAqualityA Model Context Protocol server that allows AI assistants to interact with Appwrite's API, providing tools to manage databases, users, functions, teams, and other resources within Appwrite projects.Last updated -54MIT License- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants to create, read, edit, and format Microsoft Word documents through standardized tools and resources.Last updated -54752MIT License
- -securityAlicense-qualityA simple Model Context Protocol server that enables AI assistants to interact with local file systems, allowing them to read, write, update, and delete files within a specified project directory.Last updated -MIT License