Repomix logo

Repomix

Packages local directories and GitHub repositories into searchable, AI-friendly files for code analysis.

Install Repomix

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "repomix": {
      "command": "npx",
      "args": [
        "-y",
        "repomix@latest"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

Repomix MCP server packages local directories or GitHub repositories into consolidated XML that coding agents can inspect. Its tools support selective file inclusion, exclusions, optional Tree-sitter compression, line-range reads, and regular-expression searches over generated output. Use it when an agent needs structured context from a repository without loading every file at once. Sandbox-only filesystem tools can also list directories and read files within a bounded workspace.

Use cases

  • Pack a local repository for AI-assisted code review
  • Package a GitHub project for architectural analysis
  • Search generated repository output with regular expressions
  • Read selected sections of a large packed codebase
  • Restrict packing to source files and exclude tests or build artifacts

Key features

  • Local directory and GitHub repository packing
  • Fast-glob include and ignore patterns
  • Tree-sitter code compression
  • Line-range reading of packed output
  • Regular-expression search with context lines
  • Sandbox-bounded file and directory access

Tools23

What Repomix lets your agent do. Expand a tool for its parameters.

Self-reported~785 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

44/44 checks healthy over the last 44d

Supply-chain signal

1 high-severity advisory on record for this package. Most advisories affect transitive dependencies and may not be exploitable in this server's actual usage — this is a directional signal, not a security audit.

Critical 0High 1Medium 1Low 0

Scanned 13d ago via OSV.dev · repomix@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars29kStargazers on the source repository.
npm downloads422kPackage downloads in the last 30 days.
Last commit4d agoMost recent push to the default branch.
Tools exposed23Callable tools this server registers over MCP.
Directory activity6 viewsConfig copies, upvotes, and views on AllMCPs.

How Repomix works

What Repomix does

Repomix turns a codebase into an AI-readable artifact and exposes that workflow through MCP tools. Local directories can be packed into a consolidated XML file, while GitHub repositories can be fetched, cloned, and packaged from either a repository URL or a user/repo reference. Existing Repomix output files can also be attached for analysis.

The generated output is intended for repository review, code search, refactoring work, and other tasks where an agent needs broad project context. Repomix also records token counts and repository metrics in its normal workflow, including a configurable list of the largest files.

How it works

pack_codebase accepts an absolute local directory and produces a Repomix output. pack_remote_repository performs the equivalent operation for a GitHub repository. attach_packed_output makes an existing repomix-output.xml file, or a directly specified XML file, available for analysis.

Large outputs can be explored incrementally. read_repomix_output reads the full result or a selected one-based line range, while grep_repomix_output searches with JavaScript regular-expression syntax. Searches can include context before and after each match, with separate settings taking precedence over the shared context value.

Packing follows repository-aware exclusions, including .gitignore, .ignore, and built-in exclusions. Repomix also uses Secretlint to detect files matching known credential formats and omit them from output.

Setup and configuration

The underlying Repomix CLI can be run without a global installation with:

Terminal
npx repomix@latest

For repeated use, the package can be installed globally through npm, Yarn, Bun, or Homebrew. Running repomix in a project directory creates repomix-output.xml in that directory. Repomix can also be used through its website, which accepts a repository name and supports XML, Markdown, and plain-text output.

MCP calls can refine the packed content with comma-separated fast-glob patterns. includePatterns limits processing to matching files, while ignorePatterns adds exclusions alongside the repository’s ignore files. outputPatterns assigns per-pattern handling such as compression or directory-structure-only output; the first matching pattern determines the result.

Tools and capabilities

  • pack_codebase packages a local directory and accepts inclusion, exclusion, output, compression, and metrics options.
  • pack_remote_repository packages a GitHub repository from a URL, user/repo value, or branch path.
  • attach_packed_output attaches an existing Repomix XML output.
  • read_repomix_output reads complete output or selected line ranges.
  • grep_repomix_output performs regular-expression searches with configurable context.
  • file_system_read_file reads a file inside the sandbox workspace.
  • file_system_read_directory lists entries in the sandbox workspace.

The optional compress setting uses Tree-sitter to retain code signatures and structure while removing implementation details. The documented estimate is about a 70% token reduction, although incremental search and reading can often avoid packing all retrieved content into one operation. The two filesystem tools are available only when the server runs in sandbox mode, and access is bounded by the workspace root.

Limitations and notes

Remote packaging is centered on GitHub repositories. Compression changes the amount of implementation detail available to the agent, so it should be selected according to the analysis task. File reads and directory listings are restricted to the sandbox workspace when sandbox mode is used. Packed output may be large; line ranges and regular-expression searches provide narrower retrieval paths for those cases.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Repomix

Repomix is an MCP server that connects AI agents to local code directories, GitHub repositories, and Repomix output files. Its main tools package codebases, attach existing outputs, read selected line ranges, and search packed content with JavaScript regular expressions for repository analysis.

Install the underlying Repomix CLI with `npx repomix@latest`, or install the package globally with npm, Yarn, Bun, or Homebrew. Running `repomix` in a project directory creates `repomix-output.xml`; MCP-specific client configuration is not described here.

Yes. Use `pack_remote_repository` with a GitHub URL, a `user/repo` value, or a URL containing a branch path. The tool fetches, clones, and packages the repository into consolidated XML.

Use `grep_repomix_output` with a JavaScript regular expression and an output ID. Add context, before-line, or after-line options to inspect surrounding matches; `read_repomix_output` can retrieve a specific line range.

Yes. Set `compress` to enable Tree-sitter compression, which extracts key signatures and structure while removing implementation details. The option is intended to reduce token usage, while search and partial reads provide another way to limit retrieved content.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewRepomix AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/repomix?style=directory)](https://allmcps.com/mcp/repomix)
HTML Embed
<a href="https://allmcps.com/mcp/repomix"><img src="https://allmcps.com/api/badge/repomix?style=directory" alt="Repomix on AllMCPs" /></a>