MCP server de diffchunk
Commit 7 nov 2026Permite que los LLM naveguen y analicen archivos diff de gran tamaño dividiendo los cambios en fragmentos para evitar el agotamiento del límite de contexto.
También conocido como peteretelej/diffchunk
- Stars
- 8
- Herramientas
- —
- Descargas, 30 días
- —
- Última versión
- —
- Último commit
- 7 nov 2026
- Licencia
- MIT
¿Qué es diffchunk MCP?
Permite que los LLM naveguen y analicen archivos diff de gran tamaño dividiendo los cambios en fragmentos para evitar el agotamiento del límite de contexto.
Resumen generado a partir del README del proyecto
Acerca del MCP server de diffchunk
diffchunk permite a los desarrolladores que utilizan asistentes de IA analizar conjuntos de cambios de código masivos sin alcanzar los límites de contexto. Cuando un archivo diff crece hasta decenas de miles de líneas, puede bloquear las herramientas o agotar el presupuesto de tokens. Este MCP server resuelve ese problema dividiendo los diffs grandes en fragmentos manejables, lo que permite a un LLM navegar por secciones específicas en lugar de leer todo el archivo secuencialmente.
Los usuarios pueden configurarlo localmente añadiéndolo a la configuración de un cliente MCP mediante el comando uvx. Funciona con rutas de archivos absolutas tanto en sistemas Windows como Unix. El servidor proporciona cinco herramientas especializadas: load_diff para un análisis personalizado, list_chunks para obtener una visión general de los mapeos de archivos, get_chunk para contenido específico, find_chunks_for_files para búsquedas basadas en patrones y get_file_diff para extraer los cambios de un solo archivo.
Es particularmente útil para desarrolladores que usan Cline, Roocode o Cursor y necesitan realizar revisiones profundas en ramas o commits grandes. El sistema incluye optimizaciones integradas, como omitir cambios que solo consisten en espacios en blanco o archivos generados, para mantener un uso de tokens eficiente.
Qué puedes hacer con él
- 1Revisión de diferencias en ramas grandesPide a tu asistente que identifique errores o nuevas funcionalidades comparando dos ramas distintas.
- 2Realización de auditorías de seguridad y estabilidadUtiliza la herramienta para escanear una rama de funciones en busca de posibles vulnerabilidades de seguridad o cambios disruptivos.
- 3Análisis dirigido por patrones de archivosLocaliza y examina únicamente los cambios relacionados con tipos de archivos específicos, como archivos Python.
- 4Gestión de presupuestos de tokens con vistas compactasSolicita una vista de cambios eficiente en tokens que solo muestre las líneas añadidas para ahorrar espacio de contexto.
Escrito a partir del README del proyecto. Cada caso de uso se verifica con una cita del mismo.
Verificaciones automáticas
Ejecutado 14 nov 2026Informe completo →Aún no verificado. Un servidor necesita una puntuación de 80, ningún hallazgo grave y suficientes datos para que podamos revisarlo. Cómo funcionan las verificaciones · Qué corregir para obtener más puntos
- Repositorio de origen vinculado y accesiblepeteretelej/diffchunk is public and reachablegithub.com/peteretelej/diffchunk ↗Aprobado
- El paquete indica este repositorio como su origenNo verificado
- Procedencia de la compilación (atestación de Sigstore)No verificado
- Licencia de código abierto (OSI)MITspdx.org/licenses/MIT.html ↗Aprobado
- Commit o lanzamiento en el último añoLast commit or release 2026-11-07github.com/peteretelej/diffchunk ↗Aprobado
- OpenSSF ScorecardNo verificado
- El nombre del paquete no es similar a un paquete popularNo verificado
- No hay avisos críticos en el paquete ni en sus dependenciasNo verificado
- Sin instrucciones ocultas para el modelo0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersAprobado
- Las herramientas destructivas están etiquetadasNo verificado
- El endpoint remoto responde al handshake de MCPNo verificado
README
Ver en GitHubdiffchunk
MCP server that enables LLMs to navigate large diff files efficiently. Instead of reading entire diffs sequentially, LLMs can jump directly to relevant changes using pattern-based navigation.
Problem
Large diffs exceed LLM context limits and waste tokens on irrelevant changes. A 50k+ line diff can't be processed directly and manual splitting loses file relationships.
Solution
MCP server with 5 navigation tools:
load_diff- Parse diff file with custom settings (optional)list_chunks- Show chunk overview with file mappings and per-file line counts (auto-loads)get_chunk- Retrieve specific chunk content (auto-loads)find_chunks_for_files- Locate chunks by file patterns (auto-loads)get_file_diff- Extract the complete diff for a single file (auto-loads)
Setup
Prerequisite: Install uv (an extremely fast Python package manager) which provides the uvx command.
Add to your MCP client configuration:
{
"mcpServers": {
"diffchunk": {
"command": "uvx",
"args": ["--from", "diffchunk", "diffchunk-mcp"]
}
}
}
Usage
Your AI assistant can now handle massive changesets that previously caused failures in Cline, Roocode, Cursor, and other tools.
Using with AI Assistant
Once configured, your AI assistant can analyze large commits, branches, or diffs using diffchunk.
Here are some example use cases:
Branch comparisons:
- "Review all changes in develop not in the main branch for any bugs"
- "Tell me about all the changes I have yet to merge"
- "What new features were added to the staging branch?"
- "Summarize all changes to this repo in the last 2 weeks"
Code review:
- "Use diffchunk to check my feature branch for security vulnerabilities"
- "Use diffchunk to find any breaking changes before I merge to production"
- "Use diffchunk to review this large refactor for potential issues"
Change analysis:
- "Use diffchunk to show me all database migrations that need to be run"
- "Use diffchunk to find what API changes might affect our mobile app"
- "Use diffchunk to analyze all new dependencies added recently"
Direct file analysis:
- "Use diffchunk to analyze the diff at /tmp/changes.diff and find any bugs"
- "Create a diff of my uncommitted changes and review it"
- "Compare my local branch with origin and highlight conflicts"
Tip: AI Assistant Rules
Add to your AI assistant's custom instructions for automatic usage:
When reviewing large changesets or git commits, use diffchunk to handle large diff files.
Create temporary diff files and tracking files as needed and clean up after analysis.
How It Works
When you ask your AI assistant to analyze changes, it uses diffchunk's tools strategically:
- Creates the diff file (e.g.,
git diff main..develop > /tmp/changes.diff) based on your question - Uses
list_chunksto get an overview of the diff structure and total scope, including per-file line counts viafile_details - Uses
find_chunks_for_filesto locate relevant sections when you ask about specific file types - Uses
get_file_diffto fetch the complete diff for one specific file without loading an entire chunk - Uses
get_chunkto examine specific sections without loading the entire diff into context - Tracks progress systematically through large changesets, analyzing chunk by chunk
- Cleans up temporary files after completing the analysis
This lets your AI assistant handle massive diffs that would normally crash other tools, while providing thorough analysis without losing context.
Tool Usage Patterns
Overview first:
list_chunks("/tmp/changes.diff")
# -> 5 chunks across 12 files, 3,847 total lines, ~15,420 tokens
# Each chunk includes token_count and file_details with per-file line counts
# Response includes total_token_count for context-budget planning
Target specific files:
find_chunks_for_files("/tmp/changes.diff", "*.py")
# → [1, 3, 5] - Python file chunks
get_chunk("/tmp/changes.diff", 1)
# → Content of first Python chunk
Single-file diff:
get_file_diff("/tmp/changes.diff", "src/main.py")
# → Complete diff for src/main.py (header + all hunks)
# Glob patterns work when they match exactly one file
get_file_diff("/tmp/changes.diff", "*.config")
# → Complete diff for the single matching config file
Systematic analysis:
# Process each chunk in sequence
get_chunk("/tmp/changes.diff", 1)
get_chunk("/tmp/changes.diff", 2)
# ... continue through all chunks
Configuration
Path Requirements
- Absolute paths only:
/home/user/project/changes.diff - Cross-platform: Windows (
C:\path) and Unix (/path) - Home expansion:
~/project/changes.diff
Auto-Loading Defaults
Tools auto-load with optimized settings:
max_chunk_lines: 1000skip_trivial: true (whitespace-only)skip_generated: true (lock files, build artifacts)
Custom Settings
Use load_diff for non-default behavior:
load_diff(
"/tmp/large.diff",
max_chunk_lines=2000,
include_patterns="*.py,*.js",
exclude_patterns="*test*",
context_lines=2
)
Format Options
Use the format parameter on get_chunk to transform output for LLM consumption:
# Default - raw diff output
get_chunk("/tmp/changes.diff", 1, format="raw")
# Annotated - structured with line numbers, file headers, hunk separation
get_chunk("/tmp/changes.diff", 1, format="annotated")
# Compact - token-efficient, only new hunks (context + added lines)
get_chunk("/tmp/changes.diff", 1, format="compact")
Annotated format adds ## File: headers, __new hunk__/__old hunk__ sections with new-file line numbers, and function context from @@ headers.
Compact format shows only what was added or kept, omitting removed lines and __old hunk__ sections entirely. Useful when you only need to see the final state.
Context Reduction
Use context_lines on load_diff to reduce context lines per hunk at load time:
# Keep only 2 lines of context around each change
load_diff("/tmp/large.diff", context_lines=2)
# Keep only changes, no context
load_diff("/tmp/large.diff", context_lines=0)
This composes with format - context is reduced at load time, then formatting is applied at display time.
Supported Formats
- Git diff output (
git diff,git show) - Unified diff format (
diff -u) - Multiple files in single diff
- Binary file change indicators
Performance
- Efficiently handles 100k+ line diffs
- Memory efficient streaming
- Auto-reload on file changes
Documentation
- Design - Architecture and implementation details
- Contributing - Contributing guidelines and development setup
License
Preguntas sobre diffchunk MCP
¿Cómo ayuda diffchunk con los archivos diff grandes?
Permite que los LLM salten directamente a los cambios relevantes mediante una navegación basada en patrones en lugar de leer diffs completos de forma secuencial, lo que evita exceder los límites de contexto.
¿Puedo usar patrones de archivos específicos para encontrar cambios?
Sí, puedes usar la herramienta find_chunks_for_files para localizar fragmentos mediante patrones de archivos, como buscar todos los fragmentos de archivos Python.