MCP/Repomix
Repomix logo

Repomix

Verified Golden (1000+ GitHub stars)

Packages entire codebases into consolidated, AI-friendly formats that optimize token usage for analysis by LLMs with intelligent Tree-sitter compression and secret filtering.

ai-ml•Codebase Packaging & LLM Context
GitHub16.5k
License:MIT
VERIFIED

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.

Real-time Interaction

Direct low-latency RPC protocol communication with structured JSON schemas.

Scoped Sandboxing

Restricted capability bounds to prevent accidental modifications or leakage.

Security & Best Practices

Built-in Secret Filtering: Repomix automatically scans and redacts API keys, credentials, tokens, and sensitive private files before packing code.
Local Sandboxed Execution: Codebase inspection and bundling run locally on your workstation without transmitting source files to remote third-party servers.
Tree-sitter Parsing Safety: Syntax tree parsing and comment stripping occur in-memory without mutating the original source code files on disk.
Controlled File System Access: Absolute path reads are constrained to targeted project workspace directories to protect sensitive system locations.

When to Use (and When Not To)

Best For
  • •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
Not For / Limitations
  • •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

terminal command
$claude mcp add repomix -- npx -y repomix --mcp

Exposed Tools & Endpoints

8 tools

Functions your AI agent can invoke via this Model Context Protocol server

pack_codebase

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.

pack_remote_repository

Fetch, clone, and package a remote GitHub repository into a consolidated file for AI analysis with security filtering against sensitive data.

attach_packed_output

Attach an existing Repomix packed output file for AI analysis, supporting XML, Markdown, JSON, and text with automatic content refresh.

read_repomix_output

Read the contents of a Repomix-generated output file with line range support for large codebases.

grep_repomix_output

Search for patterns in a Repomix output file using RegExp syntax with optional surrounding context lines.

file_system_read_file

Read a file from the local file system using an absolute path with built-in security detection against secret leakage.

file_system_read_directory

List the contents of a directory using an absolute path with clear file and directory indicators.

generate_skill

Generate a Claude Agent Skill from a local code directory with SKILL.md entry point and structured reference documentation in .claude/skills/.