MCP Files
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
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Filesfind the UserService class and show me its implementation"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
{
"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-filesThen:
{
"mcpServers": {
"mcp-files": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp"
}
}
}๐ ๏ธ Available Tools
Tool | Description | Parameters |
| Find and extract code blocks by symbol name(s) from files. Supports multiple symbols via array |
|
| 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 (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 processing2. 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 mode: |
|
| HTTP server port (when |
|
| Enable debug mode and |
๐ฅ๏ธ 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/** */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:
// 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-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 ๐ค
Available Tools
3 toolsinsert_textA
Insert or replace text at precise line ranges in files
Ideal for direct line-number operations (from code citations like 12:15:file.ts) and large files where context-heavy editing is inefficient.
TIP: Combine with read_symbol (must use optimize: false!) to edit any symbol anywhere without knowing its file or line range!
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to the file | |
| from_line | Yes | Starting line number (1-based) | |
| text | Yes | Text to insert | |
| to_line | No | Replace up to this line number (1-based, inclusive). If omitted only inserts |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate this is a write operation (readOnlyHint: false) and not open-world (openWorldHint: false), which the description aligns with by describing text insertion/replacement. The description adds valuable context about efficiency for large files and the need to combine with 'read_symbol' for symbol editing, going beyond what annotations provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose in the first sentence, followed by specific usage scenarios and a tip. Every sentence adds value without redundancy, making it efficient and well-structured for quick understanding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with no output schema, the description provides good contextual completeness by explaining use cases, efficiency considerations, and integration with sibling tools. It could be slightly improved by mentioning error handling or confirmation of changes, but it covers the essential context given the annotations and schema richness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all parameters. The description does not add any parameter-specific details beyond what's in the schema, such as explaining the relationship between 'from_line' and 'to_line' or providing examples. Baseline 3 is appropriate when schema coverage is complete.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Insert or replace text') on a specific resource ('at precise line ranges in files'), distinguishing it from sibling tools like 'os_notification' and 'read_symbol' which serve different purposes. It explicitly mentions the target use case for line-number operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use this tool ('Ideal for direct line-number operations... and large files where context-heavy editing is inefficient') and when to combine it with alternatives ('Combine with read_symbol... to edit any symbol anywhere without knowing its file or line range'), including a specific tip about using 'optimize: false'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
os_notificationBRead-only
Send OS notifications using native notification systems.
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The notification message to display | |
| title | No | Defaults to current project, generally omit |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and openWorldHint=false, indicating a safe, non-destructive operation with limited scope. The description adds minimal behavioral context beyond this, mentioning 'native notification systems' but not detailing platform-specific behaviors, permissions needed, or notification persistence. It doesn't contradict annotations, but adds little value.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple tool and front-loads the core purpose immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity, 2 parameters with full schema coverage, and annotations covering safety, the description is minimally adequate. However, it lacks output information (no output schema) and doesn't explain what happens after sending (e.g., notification display behavior), leaving some gaps for a notification tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with clear descriptions for both parameters in the schema itself. The description adds no additional meaning about parameters beyond what's in the schema, such as format examples or usage tips for 'title' defaults. Baseline 3 is appropriate when schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Send OS notifications') and resource ('using native notification systems'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'insert_text' or 'read_symbol', which are unrelated notification functions, so it doesn't fully distinguish from alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives or in what contexts it's appropriate. There's no mention of prerequisites, limitations, or scenarios where this tool is preferred over other notification methods.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_symbolARead-only
Find and extract symbol block by name from files, supports a lot of file formats (like TS, JS, GraphQL, CSS and most that use braces for blocks). Uses streaming with concurrency control for better performance
| Name | Required | Description | Default |
|---|---|---|---|
| symbols | Yes | Symbol name(s) to find (functions, classes, types, etc.), case-sensitive, supports * for wildcard | |
| file_paths | No | File paths to search (supports relative and glob). Defaults to "." (current directory). IMPORTANT: Be specific with paths when possible, minimize broad patterns like "node_modules/**" to avoid mismatches | |
| limit | No | Maximum number of results to return. Defaults to 5 | |
| optimize | No | Unless explicitly false, this tool will strip comments and spacing to preserve AI's context window, omit unless you REALLY it unchanged (default: true) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate readOnlyHint=true and openWorldHint=false, confirming this is a safe read operation with limited scope. The description adds value by mentioning streaming with concurrency control for performance and the ability to handle multiple file formats, but it does not disclose details like rate limits, authentication needs, or error handling beyond what annotations provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose in the first sentence, followed by supporting details in a second sentence. It avoids unnecessary elaboration, though the second sentence could be slightly more concise by integrating performance notes more tightly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (4 parameters, no output schema) and rich annotations, the description is adequate but lacks details on return values, error cases, or examples of symbol extraction. It covers the what and how but not the full behavioral context needed for optimal agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all four parameters. The description does not add specific meaning or usage details beyond the schema, such as explaining wildcard patterns in 'symbols' or performance implications of 'optimize'. Baseline 3 is appropriate as the schema handles the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Find and extract symbol block by name from files') and resource ('files'), with explicit mention of supported file formats (TS, JS, GraphQL, CSS, etc.). It distinguishes itself from sibling tools like 'insert_text' and 'os_notification' by focusing on symbol extraction rather than text insertion or OS notifications.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use this toolโfor extracting symbol blocks from various file formats using streaming with concurrency control. However, it does not explicitly state when not to use it or name alternatives, such as using 'insert_text' for adding content instead of reading it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
- First observed
insert_text - First observed
os_notification - First observed
read_symbol
TDQS
Each tool has a clearly distinct purpose: insert_text handles line-based file editing, os_notification sends OS notifications, and read_symbol extracts symbol blocks from files. There is no overlap in functionality, making tool selection straightforward for an agent.
The naming follows a consistent verb_noun pattern (insert_text, read_symbol, os_notification), which is predictable and readable. The slight deviation is that os_notification uses an underscore but starts with 'os' as a prefix, which is still coherent with the overall style.
With only 3 tools, the server feels thin for a general-purpose 'MCP Files' domain, as it lacks basic file operations like reading, writing, or deleting entire files. However, the tools are specialized and focused, so it's borderline but not severely mismatched.
The tool set is significantly incomplete for a files-oriented server, missing core operations such as reading file contents, writing files, deleting files, or listing directories. While the provided tools are useful for specific tasks, agents will face gaps in handling common file workflows.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/OrionPotter/flesler-mcp-tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server