The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Large File MCP listing page.
MCP server for intelligent handling of large files — smart chunking, search, navigation, and streaming.
🔗 Live Demo / Landing Page — install with
npx @willianpinho/large-file-mcp
Or use directly with npx:
Add the MCP server using the CLI:
Verify installation:
Remove if needed:
MCP Scopes:
local - Available only in the current project directoryuser - Available globally for all projectsproject - Defined in .mcp.json for team sharingAdd to your claude_desktop_config.json:
Config file locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonRestart Claude Desktop after editing.
Gemini:
Once configured, you can use natural language to interact with large files:
Read a specific chunk of a large file with intelligent chunking.
Parameters:
filePath (required): Absolute path to the filechunkIndex (optional): Zero-based chunk index (default: 0)linesPerChunk (optional): Lines per chunk (auto-detected if not provided)includeLineNumbers (optional): Include line numbers (default: false)Example:
Search for patterns in large files with context.
Parameters:
filePath (required): Absolute path to the filepattern (required): Search patterncaseSensitive (optional): Case sensitive search (default: false)regex (optional): Use regex pattern (default: false)maxResults (optional): Maximum results (default: 100)contextBefore (optional): Context lines before match (default: 2)contextAfter (optional): Context lines after match (default: 2)Example:
Analyze file structure and get comprehensive metadata.
Parameters:
filePath (required): Absolute path to the fileReturns: File metadata, line statistics, recommended chunk size, and sample lines.
Jump to a specific line with surrounding context.
Parameters:
filePath (required): Absolute path to the filelineNumber (required): Line number to navigate to (1-indexed)contextLines (optional): Context lines before/after (default: 5)Get comprehensive statistical summary of a file.
Parameters:
filePath (required): Absolute path to the fileReturns: File metadata, line statistics, character statistics, and word count.
Stream a file in chunks for processing very large files.
Parameters:
filePath (required): Absolute path to the filechunkSize (optional): Chunk size in bytes (default: 64KB)startOffset (optional): Starting byte offset (default: 0)maxChunks (optional): Maximum chunks to return (default: 10)The server intelligently detects and optimizes for:
Customize behavior using environment variables:
| Variable | Description | Default |
|---|---|---|
CHUNK_SIZE | Default lines per chunk | 500 |
OVERLAP_LINES | Overlap between chunks | 10 |
MAX_FILE_SIZE | Maximum file size in bytes | 10GB |
CACHE_SIZE | Cache size in bytes | 100MB |
CACHE_TTL | Cache TTL in milliseconds | 5 minutes |
CACHE_ENABLED | Enable/disable caching | true |
Example with custom settings (Claude Desktop):
Example with custom settings (Claude Code CLI):
The AI will use the search tool to find patterns and provide context around each match.
Uses regex search to locate function definitions with surrounding code context.
Returns metadata, line count, sample rows, and recommended chunk size.
Uses streaming mode to handle very large files efficiently.
Cache hit-rate depends entirely on your access pattern (how often you re-request
the same chunk), so there's no single universal number — run pnpm run benchmark
to measure it against a documented, repeatable "hot chunk" workload. On that
workload it currently measures 95% (95/100 accesses hit the cache).
Uncached readChunk() latency from scripts/benchmark.mjs, generated fixtures,
Apple M1 Pro laptop — re-run the script on your own hardware for your own numbers:
| File Size | Observed Latency | Method |
|---|---|---|
| ~500KB | ~6-8ms | Direct read |
| ~5MB | ~17-24ms | Streaming |
| ~50MB | ~120-200ms | Streaming |
Larger tiers (100MB-1GB, >1GB) aren't benchmarked here — the streaming
architecture (line-by-line readline, never loading the full file) means time
scales roughly linearly with size, and streamFile() switches to an
AsyncGenerator so memory stays flat regardless of file size.
Ensure the file path is absolute and the file has read permissions:
CHUNK_SIZE environment variableCACHE_ENABLED=falsestream_large_file for very large filesmaxResults parameterstartLine and endLine to limit search rangeCheck if the server is installed:
If not listed, reinstall:
Check server health:
Compatible with Claude Code, Cursor, and Gemini CLI. Available on npm and the Glama.ai registry, and listed in community awesome-MCP directories.
Contributions are welcome! Please feel free to submit issues or pull requests.
See CONTRIBUTING.md for detailed guidelines.
MIT
examples/ directoryBuilt with the Model Context Protocol SDK.
Made for the AI developer community.