home / mcp / repomix mcp server

Repomix MCP Server

๐Ÿ“ฆ Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "yamadashy-repomix": {
      "command": "npx",
      "args": [
        "-y",
        "repomix",
        "--mcp"
      ]
    }
  }
}

The MCP Server lets you run Repomix as a dedicated service that AI agents can talk to directly. It packages codebases on demand so assistants can analyze, search, and reason about your repository without requiring you to manually prepare files.

How to use

You run Repomix as an MCP server and connect your AI tool to its endpoints. The server exposes tooling to pack local or remote repositories, attach existing packed outputs, search within packed data, and read files securely. When you start the MCP server, you can request AI assistants to pack a project and then query or analyze the resulting packed output with builtโ€‘in helpers.

How to install

Prerequisites: ensure Node.js and npm are installed on your system. You may also run the MCP server via Docker if you prefer containerized deployment.

# Install Node.js and npm if needed (follow your platform)
# Example: verify installation
node -v
npm -v

# Install the MCP server package locally (example name shown in commands from the docs)
npm install -D repomix

# Or install globally for easy access
npm install -g repomix

# Start the MCP server (the command in the docs is an MCP start for Repomix)
repomix --mcp

MCP server configuration

Configure how your AI tools connect to Repomix as an MCP server. The server can be run as a local stdio process or via a Docker container. The following stdio configuration starts Repomix as an MCP server using a direct CLI invocation.

{
  "mcpServers": {
    "repomix_mcp": {
      "type": "stdio",
      "name": "repomix",
      "command": "repomix",
      "args": ["--mcp"]
    }
  }
}

Examples of MCP workflows

With Repomix running as an MCP server, your AI assistant can pack a repository and then analyze the packed output using the server's tools. You can request packing of a local directory or a remote repository, attach prepacked outputs, or read specific portions of a packed file.

Troubleshooting and notes

If you encounter connection issues, verify that the MCP server process is running and reachable by your AI tool. Check that the start command used for the MCP server matches the configuration above and that any required environment variables are provided by your integration layer.

Security considerations

Treat packed outputs as sensitive data. Use the server's security features to scan for secrets and restrict access to packed data to trusted AI tools and users.

Available tools

pack_codebase

Package a local code directory into a consolidated XML file for AI analysis. Options include enabling compression, including or excluding patterns, and controlling the amount of metadata returned.

attach_packed_output

Attach an existing Repomix packed output file for AI analysis. Accepts either a directory containing repomix-output.xml or a direct path to a packed repository XML file.

pack_remote_repository

Fetch, clone, and package a remote GitHub repository into a consolidated XML file for AI analysis. Supports compression and include/ignore patterns.

read_repomix_output

Read the contents of a Repomix-generated output file, with optional line-range specification for partial reads.

grep_repomix_output

Search for patterns in a Repomix output file using JavaScript RegExp syntax, with configurable context lines.

file_system_read_file

Read a file from the local file system with security validation to prevent access to sensitive information.

file_system_read_directory

List directory contents with clear indicators for files and subdirectories, using absolute paths and safe traversal.