Repomix
Packages entire codebases into consolidated, AI-friendly formats that optimize token usage for analysis by LLMs with intelligent Tree-sitter compression and secret filtering.
About this Server
Repomix is a powerful tool that packs entire codebases into consolidated, AI-friendly formats (XML, Markdown, JSON, Plain text) that optimize token usage for analysis by ChatGPT, Claude, and other AI models. It supports packaging local project directories as well as cloning and bundling remote GitHub repositories. Key capabilities include Tree-sitter AST compression, token counting, built-in security filtering for credentials and secrets, grep pattern search over packed bundles, and automatic generation of Claude Agent Skills with SKILL.md and reference docs.
Direct low-latency RPC protocol communication with structured JSON schemas.
Restricted capability bounds to prevent accidental modifications or leakage.
Security & Best Practices
When to Use (and When Not To)
- •AI-assisted code review, refactoring, and comprehensive architectural audits
- •Packing entire local or remote GitHub repositories into single token-optimized files for LLM analysis
- •Generating structured Claude Agent Skills with SKILL.md and reference documentation directly from codebases
- •Large multi-repository migrations where intelligent Tree-sitter code compression is required
- •Live interactive database querying or SQL schema migrations (use Supabase, Neon, or PostgreSQL MCP instead)
- •Live browser DOM manipulation or end-to-end web interaction (use Playwright or Browser MCP instead)
- •Single-file quick edits where full repository consolidation is unnecessary
Install & Setup
claude mcp add repomix -- npx -y repomix --mcpExposed Tools & Endpoints
8 toolsFunctions your AI agent can invoke via this Model Context Protocol server
Package a local code directory into a consolidated file (XML, Markdown, JSON, Plain text) for AI analysis with metrics, file tree, and Tree-sitter compression.
Fetch, clone, and package a remote GitHub repository into a consolidated file for AI analysis with security filtering against sensitive data.
Attach an existing Repomix packed output file for AI analysis, supporting XML, Markdown, JSON, and text with automatic content refresh.
Read the contents of a Repomix-generated output file with line range support for large codebases.
Search for patterns in a Repomix output file using RegExp syntax with optional surrounding context lines.
Read a file from the local file system using an absolute path with built-in security detection against secret leakage.
List the contents of a directory using an absolute path with clear file and directory indicators.
Generate a Claude Agent Skill from a local code directory with SKILL.md entry point and structured reference documentation in .claude/skills/.
