Logo di Large File MCP Server

Large File MCP Server

Community
willianpinho

MCP server for intelligent handling of large files — smart chunking, search, navigation, and streaming.

Pubblicato dawillianpinho
Repositorylarge-file-mcp
LinguaTypeScript
Fork
5
Stelle
19
Strumenti disponibili
6
Tipo di trasportostdio
Categorie
LicenzaMIT
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Large File MCP Server mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • Strumenti disponibili: 6

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni se il server li fornisce.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse della comunità open source

    Stelle: 19; fork: 5 (repository collegato).

Large File MCP Server

MCP server for intelligent handling of large files — smart chunking, search, navigation, and streaming.

npm version npm downloads CI codecov License: MIT TypeScript Node.js MCP Documentation GitHub stars GitHub issues

🔗 Live Demo / Landing Page — install with npx @willianpinho/large-file-mcp

📚 Full Documentation | API Reference | Examples

Features

  • Smart Chunking - Automatically determines optimal chunk size based on file type
  • Intelligent Navigation - Jump to specific lines with surrounding context
  • Powerful Search - Regex support with context lines before/after matches
  • File Analysis - Comprehensive metadata and statistical analysis
  • Memory Efficient - Stream files of any size without loading into memory
  • Performance Optimized - Built-in LRU caching for frequently accessed chunks
  • Type Safe - Written in TypeScript with strict typing
  • Cross-Platform - Works on Windows, macOS, and Linux

Installation

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

Or use directly with npx:

bash
npx @willianpinho/large-file-mcp

Quick Start

Claude Code CLI

Add the MCP server using the CLI:

bash
# Add for current project only (local scope)
claude mcp add --transport stdio --scope local large-file-mcp -- npx -y @willianpinho/large-file-mcp

# Add globally for all projects (user scope)
claude mcp add --transport stdio --scope user large-file-mcp -- npx -y @willianpinho/large-file-mcp

Verify installation:

bash
claude mcp list
claude mcp get large-file-mcp

Remove if needed:

bash
# Remove from local scope
claude mcp remove large-file-mcp -s local

# Remove from user scope
claude mcp remove large-file-mcp -s user

MCP Scopes:

  • local - Available only in the current project directory
  • user - Available globally for all projects
  • project - Defined in .mcp.json for team sharing

Claude Desktop

Add to your claude_desktop_config.json:

json
{
  "mcpServers": {
    "large-file": {
      "command": "npx",
      "args": ["-y", "@willianpinho/large-file-mcp"]
    }
  }
}

Config file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Restart Claude Desktop after editing.

Other AI Platforms

Gemini:

json
{
  "tools": [
    {
      "name": "large-file-mcp",
      "command": "npx @willianpinho/large-file-mcp",
      "protocol": "mcp"
    }
  ]
}

Usage

Once configured, you can use natural language to interact with large files:

text
Read the first chunk of /var/log/system.log
text
Find all ERROR messages in /var/log/app.log
text
Show me line 1234 of /code/app.ts with context
text
Get the structure of /data/sales.csv

Available Tools

read_large_file_chunk

Read a specific chunk of a large file with intelligent chunking.

Parameters:

  • filePath (required): Absolute path to the file
  • chunkIndex (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:

json
{
  "filePath": "/var/log/system.log",
  "chunkIndex": 0,
  "includeLineNumbers": true
}

search_in_large_file

Search for patterns in large files with context.

Parameters:

  • filePath (required): Absolute path to the file
  • pattern (required): Search pattern
  • caseSensitive (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:

json
{
  "filePath": "/var/log/error.log",
  "pattern": "ERROR.*database",
  "regex": true,
  "maxResults": 50
}

get_file_structure

Analyze file structure and get comprehensive metadata.

Parameters:

  • filePath (required): Absolute path to the file

Returns: File metadata, line statistics, recommended chunk size, and sample lines.

navigate_to_line

Jump to a specific line with surrounding context.

Parameters:

  • filePath (required): Absolute path to the file
  • lineNumber (required): Line number to navigate to (1-indexed)
  • contextLines (optional): Context lines before/after (default: 5)

get_file_summary

Get comprehensive statistical summary of a file.

Parameters:

  • filePath (required): Absolute path to the file

Returns: File metadata, line statistics, character statistics, and word count.

stream_large_file

Stream a file in chunks for processing very large files.

Parameters:

  • filePath (required): Absolute path to the file
  • chunkSize (optional): Chunk size in bytes (default: 64KB)
  • startOffset (optional): Starting byte offset (default: 0)
  • maxChunks (optional): Maximum chunks to return (default: 10)

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, .cpp, .go, .rs, 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
  • Configuration files (.yml, .yaml, .sh, .bash) - 300 lines/chunk

Configuration

Customize behavior using environment variables:

VariableDescriptionDefault
CHUNK_SIZEDefault lines per chunk500
OVERLAP_LINESOverlap between chunks10
MAX_FILE_SIZEMaximum file size in bytes10GB
CACHE_SIZECache size in bytes100MB
CACHE_TTLCache TTL in milliseconds5 minutes
CACHE_ENABLEDEnable/disable cachingtrue

Example with custom settings (Claude Desktop):

json
{
  "mcpServers": {
    "large-file": {
      "command": "npx",
      "args": ["-y", "@willianpinho/large-file-mcp"],
      "env": {
        "CHUNK_SIZE": "1000",
        "CACHE_ENABLED": "true"
      }
    }
  }
}

Example with custom settings (Claude Code CLI):

bash
claude mcp add --transport stdio --scope user large-file-mcp \
  --env CHUNK_SIZE=1000 \
  --env CACHE_ENABLED=true \
  -- npx -y @willianpinho/large-file-mcp

Examples

Analyzing Log Files

text
Analyze /var/log/nginx/access.log and find all 404 errors

The AI will use the search tool to find patterns and provide context around each match.

Code Navigation

text
Find all function definitions in /project/src/main.py

Uses regex search to locate function definitions with surrounding code context.

CSV Data Exploration

text
Show me the structure of /data/sales.csv

Returns metadata, line count, sample rows, and recommended chunk size.

Large File Processing

text
Stream the first 100MB of /data/huge_dataset.json

Uses streaming mode to handle very large files efficiently.

Performance

Caching

  • LRU Cache with configurable size (default 100MB)
  • TTL-based expiration (default 5 minutes)
  • Speeds up repeated access to the same file chunk or structure lookup

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).

Memory Management

  • Streaming architecture - files are read line-by-line, never fully loaded
  • Configurable chunk sizes - adjust based on your use case
  • Smart buffering - minimal memory footprint for search operations

Read Latency (measured)

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 SizeObserved LatencyMethod
~500KB~6-8msDirect read
~5MB~17-24msStreaming
~50MB~120-200msStreaming

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.

Development

Building from Source

bash
git clone https://github.com/willianpinho/large-file-mcp.git
cd large-file-mcp
pnpm install
pnpm build

Development Mode

bash
pnpm dev    # Watch mode
pnpm lint   # Run linter
pnpm start  # Run server

Project Structure

text
src/
├── index.ts          # Entry point
├── server.ts         # MCP server implementation
├── fileHandler.ts    # Thin barrel — delegates to src/file-handler/*
├── file-handler/      # Chunking, search, navigation, streaming (split by concern)
├── cacheManager.ts   # Caching implementation
└── types.ts          # TypeScript type definitions

Troubleshooting

File not accessible

Ensure the file path is absolute and the file has read permissions:

bash
chmod +r /path/to/file

Out of memory

  1. Reduce CHUNK_SIZE environment variable
  2. Disable cache with CACHE_ENABLED=false
  3. Use stream_large_file for very large files

Slow search performance

  1. Reduce maxResults parameter
  2. Use startLine and endLine to limit search range
  3. Ensure caching is enabled

Claude Code CLI: MCP server not found

Check if the server is installed:

bash
claude mcp list

If not listed, reinstall:

bash
claude mcp add --transport stdio --scope user large-file-mcp -- npx -y @willianpinho/large-file-mcp

Check server health:

bash
claude mcp get large-file-mcp

Designed For

  • Log Analysis: Processing multi-GB log files with search and navigation
  • Data Processing: Reading large CSV/JSON files in manageable chunks
  • Code Review: Navigating large codebases efficiently
  • System Monitoring: Analyzing system logs and debug outputs
  • Document Analysis: Processing large text documents

Compatible with Claude Code, Cursor, and Gemini CLI. Available on npm and the Glama.ai registry, and listed in community awesome-MCP directories.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Ensure code builds and lints successfully
  5. Submit a pull request

See CONTRIBUTING.md for detailed guidelines.

License

MIT

Support

  • Issues: GitHub Issues
  • Documentation: This README and inline code documentation
  • Examples: Check the examples/ directory

Acknowledgments

Built with the Model Context Protocol SDK.


Made for the AI developer community.

Installazione

TypingMind
Prerequisiti:

Node.js 18+

{
  "mcpServers": {
    "willianpinho-large-file-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@willianpinho/large-file-mcp"
      ]
    }
  }
}

Strumenti disponibili

  • read_large_file_chunk

    Read a specific chunk of a large file with intelligent chunking based on file type. Automatically determines optimal chunk size.

  • search_in_large_file

    Search for a pattern in a large file with context lines. Supports regex and case-sensitive search.

  • get_file_structure

    Analyze file structure and get comprehensive metadata including line statistics, recommended chunk size, and samples from start and end.

  • navigate_to_line

    Jump to a specific line in a large file with surrounding context lines. Highlights the target line.

  • get_file_summary

    Get comprehensive statistical summary of a file including line stats, character stats, and word count.

  • stream_large_file

    Stream a large file in chunks. Returns multiple chunks for processing very large files efficiently.

Usa Large File MCP Server MCP con più modelli AI

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Large File MCP Server, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura connettore.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura connettore e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con l’opzione «Questo dispositivo» selezionata
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Large File MCP Server come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Large File MCP Server.
  4. Salva l'elenco dei server.
  5. Se vuoi verificare che il connettore sia ancora pronto, aggiorna la pagina.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "willianpinho-large-file-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@willianpinho/large-file-mcp"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Large File MCP Server, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Large File MCP Server.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Large File MCP Server per aiutarmi con questa attività?
Large File MCP Server
Certo. L’ho letto.
Ecco cosa ho trovato con Large File MCP Server.

Domande frequenti

A cosa serve il server MCP Large File MCP Server?

Large File MCP Server è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare il server MCP Large File MCP Server con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Large File MCP Server con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Large File MCP Server con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Large File MCP Server, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego il server MCP Large File MCP Server a TypingMind?

Large File MCP Server funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre il server MCP Large File MCP Server in TypingMind?

Strumenti MCP disponibili per Large File MCP Server: 6. Puoi attivarli dalla pagina Plugin di TypingMind e usarli in chat o assegnarli agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare il server MCP Large File MCP Server?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Large File MCP Server richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇