Skip to content

Large File MCP ServerIntelligent Large File Handling

Production-ready MCP server with smart chunking, navigation, and streaming capabilities

Large File MCP Server

Quick Example

typescript
// Read a specific chunk of a large file
{
  "tool": "read_large_file_chunk",
  "arguments": {
    "filePath": "/var/log/system.log",
    "chunkIndex": 0,
    "includeLineNumbers": true
  }
}

// Search for patterns with context
{
  "tool": "search_in_large_file",
  "arguments": {
    "filePath": "/var/log/error.log",
    "pattern": "ERROR.*database",
    "regex": true,
    "contextBefore": 3,
    "contextAfter": 3
  }
}

// Navigate to specific line
{
  "tool": "navigate_to_line",
  "arguments": {
    "filePath": "/code/app.ts",
    "lineNumber": 1234,
    "contextLines": 10
  }
}

Why Large File MCP Server?

Working with large files in AI applications presents unique challenges:

  • Memory Constraints: Loading entire files into memory is impractical for large datasets
  • Context Windows: LLMs have limited context windows that can't accommodate entire files
  • Navigation: Finding specific information in massive files requires intelligent search
  • Performance: Processing must be fast enough for interactive AI applications

Large File MCP Server solves these problems with:

Smart Chunking - Automatically optimizes chunk size based on file type ✅ Streaming Architecture - Process files of any size without memory issues ✅ Intelligent Caching - LRU cache with 80-90% hit rates for repeated access ✅ Powerful Search - Regex support with contextual results ✅ Type Safety - Full TypeScript support prevents runtime errors

Performance Benchmarks

File SizeOperationTimeMethod
< 1MBRead chunk< 100msDirect read
1-100MBSearch< 500msStreaming
100MB-1GBNavigate1-3sStreaming + cache
> 1GBStreamProgressiveAsyncGenerator

Supported File Types

The server intelligently detects and optimizes for:

  • Text files (.txt) - 500 lines/chunk
  • Log files (.log) - 500 lines/chunk
  • Code files (.ts, .js, .py, .java, etc.) - 300 lines/chunk
  • CSV files (.csv) - 1000 lines/chunk
  • JSON files (.json) - 100 lines/chunk
  • XML files (.xml) - 200 lines/chunk
  • Markdown files (.md) - 500 lines/chunk
  • Config files (.yml, .yaml, .sh) - 300 lines/chunk

Get Started

Install via npm:

bash
npm install -g @willianpinho/large-file-mcp

Or use with npx:

bash
npx @willianpinho/large-file-mcp

Community

License

MIT

Released under the MIT License.