The MCP Tools server enables AI agents to perform surgical code editing and system notifications with precision across codebases.
Find and extract code symbols: Search for functions, classes, types, and other symbols across multiple file formats (TypeScript, JavaScript, GraphQL, CSS, and other brace-based languages) using
read_symbol
with wildcard support and specific file pathsSurgical text editing: Insert or replace text at specific line ranges using
insert_text
for precise modifications without manual file navigationSend OS notifications: Display native system notifications with custom messages and optional titles to alert users of progress or events
Advanced code intelligence: Combine
read_symbol
withinsert_text
for cross-codebase operations, enabling zero-error refactoring and targeted edits with streaming performance optimization and concurrency control
Offers tools to find and extract JavaScript code blocks by symbol name and import/inspect JavaScript modules and their properties.
Enables inspection of Lodash modules and properties through the import_symbol tool, allowing AI agents to analyze and utilize Lodash functionality.
Built for Node.js environment, providing programmatic file operations, module inspection, and OS notifications that leverage Node.js capabilities.
Provides tools for finding and extracting TypeScript code blocks by symbol name and importing/inspecting TypeScript modules and their properties.
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
- 🛠️ Available Tools
- ⚡ Surgical Code Editing: Surgical Precision
- 🎛️ Environment Variables
- 🖥️ Server Usage
- 💻 CLI Usage
- 🏗️ Architecture
- 🧪 Development
- 🛠️ Troubleshooting
- 📝 License
- 🔗 Links
🚀 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 |
---|---|---|
read_symbol | Find and extract code blocks by symbol name(s) from files. Supports multiple symbols via array | symbols (string[]), file_paths[]? , limit? , optimize? |
import_symbol | Import and inspect JavaScript/TypeScript modules and their properties | module_path , property? |
search_replace | Search and replace with intelligent whitespace handling and automation-friendly multiple match resolution | file_path , old_string , new_string , allow_multiple_matches? |
insert_text | Insert/replace text at precise line ranges. Perfect for direct line operations from code citations (12:15.ts) and surgical edits in large files | file_path , from_line , text , to_line |
os_notification | Send OS notifications using native notification systems | message , title? |
⚡ 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 (read_symbol
) - Find ANY symbol(s) ANYWHERE in your codebase:
2. Surgical Editing (insert_text
) - 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 | stdio | Transport mode: stdio or http |
PORT | 4657 | HTTP server port (when TRANSPORT=http ) |
DEBUG | false | Enable debug mode and utils_debug 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/** */
comments - Collapses 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 npx mcp-files
- Problem: Error like
Cannot find module '@modelcontextprotocol/sdk/dist/esm/server/index.js'
when runningnpx mcp-files
- Cause: Corrupt or incomplete npx cache preventing proper dependency resolution
- Solution: Clear the npx cache and try again:
- Note: 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
Built for AI agents 🤖
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A comprehensive MCP server providing tools for AI agents to interact with code, including reading symbols, importing modules, replacing text, and sending OS notifications.
Related MCP Servers
- -securityAlicense-qualityAn MCP server that bridges AI agents with GUI automation capabilities, allowing them to control mouse, keyboard, windows, and take screenshots to interact with desktop applications.Last updated -9MIT License
- AsecurityFlicenseAqualityAn MCP server that supercharges AI assistants with powerful tools for software development, enabling research, planning, code generation, and project scaffolding through natural language interaction.Last updated -113978
- -securityFlicense-qualityA MCP server that allows AI assistants to interact with the browser, including getting page content as markdown, modifying page styles, and searching browser history.Last updated -82
- AsecurityAlicenseAqualityA powerful MCP server that provides interactive user feedback and command execution capabilities for AI-assisted development, featuring a graphical interface with text and image support.Last updated -139MIT License