home / mcp / repomix mcp server

Repomix MCP Server

Provides access to the Repomix tool for packaging repositories into AI-friendly files via MCP.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "aeolun-repomix-mcp": {
      "command": "node",
      "args": [
        "/path/to/repomix-mcp/dist/index.js"
      ]
    }
  }
}

Repomix MCP Server exposes the Repomix tool through MCP so you can pack repositories into AI-friendly single files. It provides safe execution, local output handling, and straightforward integration with MCP clients to automate content packaging workflows.

How to use

You can use Repomix MCP Server with your MCP client to estimate the output size of a pack and then generate the packed file. Start by configuring the server in your MCP client, then run the estimate step to preview size and token usage, followed by the actual packing step when the size fits your needs. If the pack is too large, you can retry with compression to reduce the output size. Always pair estimation with retrieval to ensure the final content meets your constraints.

How to install

Prerequisites: ensure you have Node.js and npm installed on your system.

Install dependencies and build the server.

npm install
npm run build

Configuration and usage notes

Input paths are restricted to the directory where the server starts. Access attempts outside this directory are denied. Output is written to the system temporary directory and cleaned up after retrieval. Remote repository URLs remain supported for processing.

To add this MCP server to Claude Code, you would use a command like the following:

claude mcp add --scope user repomix node /path/to/repomix-mcp/dist/index.js

Additional notes

If you are configuring through Claude Desktop, provide a server entry in your claude_desktop_config.json with the stdio command that launches the MCP server, for example:

{
  "mcpServers": {
    "repomix": {
      "command": "node",
      "args": ["/path/to/repomix-mcp/dist/index.js"]
    }
  }
}

Security considerations

The server confines file access to the startup directory, denies access to outside paths, and uses the system temporary directory for outputs which are cleaned up after retrieval. Remote URLs remain usable for processing.

Troubleshooting tips

If you encounter size or token issues, use repomix-estimate first to gauge output size, then retry repomix with compress enabled if needed. Ensure the output fits your target context window before attempting retrieval.

Available tools

repomix-estimate

Estimate the size, token count, and compression status for a Repomix output without fetching content.

repomix

Pack a repository into a single AI-friendly file and return its contents. Use estimation first to ensure it fits your constraints.