Repomix — Claude Code MCP server: pack a repo into one file
Packs an entire repository into a single file your coding agent can read or search. Handy when the model needs the whole codebase at once.
claude mcp add repomix -- npx -y repomixWhat Repomix does
Repomix walks the project and writes every file into one document shaped for language models. It handles a local folder or a remote repository. Along the way it counts tokens per file and for the whole repo, so you can tell whether the code fits the model's context.
You control what goes in and what stays out. The tool respects .gitignore, .ignore and .repomixignore, so build output and junk usually drop out on their own. Secretlint scans for credential formats and leaves matching files out of the result. The --compress option uses Tree-sitter to pull key code elements and cut the token count while keeping structure.
The MCP server starts with npx -y repomix, so you need Node.js and npm. If your project holds live .env files, read the output before handing it to a model: Secretlint catches known credential formats, not everything.
What it helps with
- pack a repository into one file for a model
- count tokens across a project before hitting the context limit
- keep build output and junk out via
.gitignorerules - stop credential files from reaching the model
- compress a large project while keeping code structure
Example prompts for the agent
- Pack this repo with Repomix and tell me the token count
- Bundle the project into one file, skip the
distfolder - Read the packed code and suggest what to refactor
How to install Repomix
Platform CLI
claude mcp add repomix -- npx -y repomixPlatform CLI
codex mcp add repomix -- npx -y repomixConfig file
{
"mcpServers": {
"repomix": {
"command": "npx",
"args": [
"-y",
"repomix"
]
}
}
}Config file
{
"servers": {
"repomix": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"repomix"
]
}
}
}Platform CLI
gemini mcp add repomix npx -y repomixStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Repomix
How do I install Repomix in Claude?
Run claude mcp add repomix -- npx -y repomix. That registers the MCP server in your Claude config, and the tool becomes available to the agent.
What does Repomix do?
It combines repository files into one document a language model can read, and reports token counts. It can also compress the output down to key code elements.
Do I need anything installed first?
The server runs through npx -y repomix, so Node.js with npm is required. No separate global install is needed.