Mcp Files MCP Server
A comprehensive MCP server providing helpful tools for AI agents like Cursor
Mcp Files scores 37 (Limited), licensed MIT and written in TypeScript. It installs as a local process. It declares 5 tools. Filed under File systems. GitHub shows 10 stars. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Limited trust
37 of 100 from six public signals. Nobody can buy a point.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade B
75/100 for listing completeness. Lost points: no install config, short summary, no docs link.
How quality is graded
Where the 37 comes from
0 + 10 + 3 + 10 + 4 + 10 = 37. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 0 of 30 points.How recently the repository saw a commit or release.
Maintenance: 10 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 3 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 10 of 10 points.Install
Pick your client, copy the config, paste it in.
This server has no package or remote URL yet.
Environment variables
This server does not declare environment variables.
Tools5Tool docs quality grade C
All capabilitiesimport_symboltoolImport and inspect JavaScript/TypeScript modules and their properties
insert_texttoolInsert/replace text at precise line ranges. Perfect for direct line operations from code citations (12:15:file.ts) and surgical edits in large files
os_notificationtoolSend OS notifications using native notification systems
read_symboltoolFind and extract code blocks by symbol name(s) from files. Supports multiple symbols via array
search_replacetoolSearch and replace with intelligent whitespace handling and automation-friendly multiple match resolution
About
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.
{
"mcpServers": {
"mcp-files": {
"command": "npx",
"args": ["-y", "mcp-files"]
}
}
}
Option 2: Docker
{
"mcpServers": {
"mcp-files": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"flesler/mcp-files"
]
}
}
}
Option 3: HTTP transport
First run the server:
TRANSPORT=http PORT=3000 npx mcp-files
Then:
{
"mcpServers": {
"mcp-files": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp"
}
}
}
๐ ๏ธ 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:file.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:
// Find single function/class/interface anywhere in repo
read_symbol({symbols: ["generateApiKey"]})
// โ Returns: exact location (lines 45-52 in src/auth/tokens.ts)
// Find multiple symbols at once
read_symbol({symbols: ["User", "UserService", "UserInterface"]})
// โ Returns: all matching symbols with their locations
// Optimize code for AI context (strips comments, normalizes indentation)
read_symbol({symbols: ["complexFunction"], optimize: true})
// โ Returns: clean, tab-indented code without comments for AI processing
2. Surgical Editing (insert_text) - Make precise modifications using exact line ranges:
// Replace specific lines with surgical precision
insert_text(file: "src/auth/tokens.ts", from_line: 45, to_line: 52, text: "improved implementation")
// Insert new code without disruption
insert_text(file: "src/auth/tokens.ts", from_line: 45, text: "// Added security enhancement")
๐ 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
# Find and enhance any function
read_symbol("validateEmail") โ lines 23-35 in utils/validation.ts
insert_text(from_line: 23, to_line: 35, text: "enhanced validation with regex")
# Add documentation to any symbol
read_symbol("processPayment") โ line 87 in payment/processor.ts
insert_text(from_line: 87, text: "/** Secure payment processing with fraud detection */")
# Fix bugs anywhere in codebase
read_symbol("parseUserInput") โ lines 156-162 in input/parser.ts
insert_text(from_line: 156, to_line: 162, text: "sanitized parsing logic")
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.
# Show help
mcp-files --help
# Default: stdio transport
mcp-files
# HTTP transport
TRANSPORT=http mcp-files
TRANSPORT=http PORT=8080 mcp-files
# With debug mode
DEBUG=true mcp-files
๐ป CLI Usage
All tools can be used directly from the command line:
# Find single symbol in code (specific file)
mcp-files read_symbol "MyInterface" src/types.ts
# Find multiple symbols at once (comma-separated)
mcp-files read_symbol "User,UserService,UserInterface" src/
# Find symbol in current directory (default)
mcp-files read_symbol "MyInterface"
# Use wildcards for pattern matching
mcp-files read_symbol "get*,User*" src/
# Inspect imports
mcp-files import_symbol lodash get
# Replace text with smart whitespace handling
mcp-files replace_text config.json "old_value" "new_value"
# Send notifications
mcp-files os_notification "Task completed"
๐๏ธ 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
# Install dependencies
npm install
# Build
npm run build
# Development mode
npm run dev
# Lint
npm run lint:full
# Test
npm run ts test/index.test.ts
# CLI testing
node dist/index.js read_symbol "functionName" file.ts
# Multiple symbols (comma-separated in CLI)
node dist/index.js read_symbol "func1,func2,Class*" file.ts
# Or search current directory
node dist/index.js read_symbol "functionName"
๐งน 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:
// MCP mode - explicit control
read_symbol({symbols: ["MyClass"], optimize: true}) // optimized
read_symbol({symbols: ["MyClass"], optimize: false}) // raw code (default)
// CLI mode - always optimized
mcp-files read_symbol "MyClass" src/
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:
npx clear-npx-cache npx mcp-files - 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
- ๐ฆ NPM Package
- ๐ GitHub Repository
- ๐ Report Issues
- ๐ MCP Specification
Built for AI agents ๐ค
Frequently asked questions
What is Mcp Files MCP Server?
A comprehensive MCP server providing helpful tools for AI agents like Cursor
Is Mcp Files MCP Server free and open source?
Yes. Mcp Files MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
What tools does Mcp Files MCP Server provide?
Mcp Files MCP Server provides 5 tools, including import_symbol, insert_text, os_notification, and read_symbol. See the full tool list for descriptions and parameters.
How is Mcp Files MCP Server's trust score calculated?
Mcp Files MCP Server scores 37 out of 100 (Limited). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yetโBe the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.