Provides Docker deployment option for the MCP server with containerized execution of file operations and code editing tools
Enables importing and inspecting JavaScript modules and their properties with the import_symbol tool
Demonstrates module inspection capabilities by showing how to inspect Lodash library properties
Requires Node.js runtime for execution and leverages Node.js ecosystem for file operations and module inspection
Available as an npm package for installation and distribution, with npx execution support
Enables importing and inspecting TypeScript modules and their properties with the import_symbol tool
Uses Zod for type-safe validation of tool parameters and ensuring robust input handling
MCP Tools
Enables agents to quickly find and edit code in a codebase with surgical precision. Find symbols, edit them everywhere.
๐ Table of Contents
๐ Quick Start
Option 1: NPX (Recommended)
Add this to ~/.cursor/mcp.json for Cursor, ~/.config/claude_desktop_config.json for Claude Desktop.
Option 2: Docker
Option 3: HTTP transport
First run the server:
Then:
๐ ๏ธ Available Tools
Tool | Description | Parameters |
| Find and extract code blocks by symbol name(s) from files. Supports multiple symbols via array |
(string[]),
,
,
|
| Import and inspect JavaScript/TypeScript modules and their properties |
,
|
| Search and replace with intelligent whitespace handling and automation-friendly multiple match resolution |
,
,
,
|
| Insert/replace text at precise line ranges. Perfect for direct line operations from code citations (12:15:file.ts) and surgical edits in large files |
,
,
,
|
| Send OS notifications using native notification systems |
,
|
โก Surgical Code Editing: Surgical Precision
The combination of read_symbol + insert_text unlocks revolutionary code editing capabilities that transform how AI agents work with codebases.
๐ฏ The Power Combo
1. Symbol Discovery ( - Find ANY symbol(s) ANYWHERE in your codebase:
2. Surgical Editing ( - Make precise modifications using exact line ranges:
๐ Superpowers Unlocked
๐ Cross-Codebase Intelligence
Find any symbol across entire repositories instantly
No manual searching through files and folders
Perfect accuracy even in massive codebases
โ๏ธ Precision Surgery
Edit exact functions, classes, or code blocks
Replace implementations without affecting surrounding code
Insert enhancements at perfect locations
๐๏ธ Zero-Error Refactoring
Update function signatures everywhere they exist
Modify APIs across all files simultaneously
Fix bugs with surgical precision across entire codebase
๐ก Real-World Magic
This transforms AI from "helpful assistant" to "surgical code surgeon" ๐ฆพ
๐๏ธ Environment Variables
Variable | Default | Description |
|
| Transport mode:
or
|
|
| HTTP server port (when
) |
|
| Enable debug mode and
tool |
๐ฅ๏ธ Server Usage
You can either install and use mcp-files or npx mcp-files.
๐ป CLI Usage
All tools can be used directly from the command line:
๐๏ธ Architecture
Type-safe tools with Zod validation
Self-contained modules in
src/tools/Cross-platform support (Linux, macOS, Windows, WSL)
Performance optimized with memoization
Clear error handling with descriptive messages
๐งช Development
๐งน Code Optimization
The read_symbol tool includes an optimize parameter that cleans up code for AI processing:
What it does:
Strips comments: Removes
//,/* */, and/** */commentsCollapses newlines: Multiple consecutive newlines become single newlines
Normalizes indentation: Converts spaces to tabs (detects indentation token size automatically)
Removes base indentation: Eliminates common leading whitespace
Usage:
Perfect for: Reducing token count in AI context windows while preserving code structure and readability.
๐ ๏ธ Troubleshooting
Requirements
Node.js โฅ20 - This package requires Node.js version 20 or higher
Common Issues
ERR_MODULE_NOT_FOUND when running
Problem: Error like
Cannot find module '@modelcontextprotocol/sdk/dist/esm/server/index.js'when runningnpx mcp-filesCause: Corrupt or incomplete npx cache preventing proper dependency resolution
Solution: Clear the npx cache and try again:
npx clear-npx-cache npx mcp-filesNote: This issue can occur on both Node.js v20 and v22, and the cache clear resolves it
Tools not showing up in MCP client:
Verify Node.js version is 20 or higher
Try restarting your MCP client after configuration changes
File operations failing:
Ensure proper file permissions for the files you're trying to read/modify
Use absolute paths when possible for better reliability
Check that the target files exist and are accessible
๐ License
MIT - see LICENSE file.
๐ Links
๐ฆ NPM Package
๐ GitHub Repository
๐ Report Issues
๐ MCP Specification
Built for AI agents ๐ค
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables agents to quickly find and edit code in a codebase with surgical precision. Find symbols, edit them everywhere with tools for reading code blocks, searching/replacing text, and making precise line-based modifications.