Home / MCP / Repomix MCP Server

Repomix MCP Server

Packs repositories into an AI-friendly format and exposes it via MCP for AI-assisted analysis.

typescript
20.5kstars
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "repomix_mcp": {
            "command": "repomix",
            "args": [
                "--mcp"
            ]
        }
    }
}

You can run Repomix as an MCP server to package codebases and expose AI-ready outputs to AI assistants. This enables seamless, programmatic analysis and integration with AI tooling without manually preparing files each time.

How to use

Run Repomix in MCP mode to let AI assistants package local or remote repositories on demand. Start the MCP server in your environment and connect your MCP client to access the available pack and read capabilities.

How to install

Prerequisites: ensure you have Node.js installed (recommended) or use Docker to run the MCP server container.

Configuration and usage notes

The MCP server supports commands to pack local or remote repositories and to read, search, or attach packed outputs. You can run the server directly in MCP mode or use containerized execution. The key commands you will use are the MCP entrypoint invocation and the optional Docker variant.

# Run MCP server locally (example)
repomix --mcp

# Run MCP server via Docker (example)
docker run -i --rm ghcr.io/yamadashy/repomix --mcp

# Attach a pre-packed output for AI analysis (example)
repomix server attach_output /path/to/repomix-output.xml

Security and privacy considerations

The MCP server can integrate with security checks to detect potentially sensitive information before sharing packed outputs. Use appropriate security options and validate any credentials or secrets before exposing outputs to AI tools.

Troubleshooting

If the MCP server fails to start, verify your environment has the necessary runtime (Node.js or Docker) and that no port conflicts or firewall rules block client connections. Check logs for error messages related to MCP initialization or output packaging.

Examples

# Start MCP server in stdout mode (example)
repomix --mcp

# Start MCP server using Docker (example)
docker run -i --rm ghcr.io/yamadashy/repomix --mcp

Available tools

pack_codebase

Package a local code directory into a consolidated XML file for AI analysis, with optional compression and include/exclude patterns.

attach_packed_output

Attach an existing packed output file for AI analysis, supporting directory or direct file paths.

pack_remote_repository

Fetch, clone, and package a remote GitHub repository into a consolidated XML file for AI analysis.

read_repomix_output

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

grep_repomix_output

Search within a packed output using RegExp with configurable context lines.

file_system_read_file

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

file_system_read_directory

List the contents of a directory with clear indicators for files and subdirectories.