home / mcp / repomix mcp server
Exposes repository packing and analysis tools for AI assistants to process codebases via MCP endpoints.
Configuration
View docs{
"mcpServers": {
"yamadashy-repomix": {
"command": "npx",
"args": [
"-y",
"repomix",
"--mcp"
]
}
}
}You can run Repomix as a Model Context Protocol (MCP) server to let AI tools pack, inspect, and analyze codebases directly through an API-like interface. This server enables seamless AI-assisted code analysis by packaging repositories into an AI-friendly format and exposing functions that AI assistants can invoke without manual file handling.
To use the MCP server, start Repomix in MCP mode and connect your MCP client or integration. The server offers actions like packing local or remote repositories, attaching existing packed outputs, reading and searching outputs, and reading files or directories securely. Your AI tool can request these operations and receive structured results suitable for analysis, code reviews, refactoring suggestions, or documentation generation.
Prerequisites: ensure Node.js and npm are installed on your system. You can also use Docker if you prefer containerized execution.
Option A: Run MCP server via npx (no global install)
npx -y repomix --mcpOption B: Install Repomix globally and run MCP server
# Install globally via npm
npm install -g repomix
# Start MCP server
repomix --mcpOption C: Run Repomix as a Docker container in MCP mode
# Basic run in MCP mode
docker run -v $(pwd):/app -it --rm ghcr.io/yamadashy/repomix --mcpIn MCP mode, you expose a server that AI tools can call to perform repository packing, output reading, and related operations. You can combine MCP with the official configuration guides and plugin ecosystems to tailor how AI assistants interact with your codebase.
Packages a local code directory into a consolidated XML file for AI analysis. Supports optional compression to reduce token usage.
Attaches an existing Repomix packed output file for AI analysis, usable with an existing repomix-output.xml.
Fetches, clones, and packages a remote GitHub repository into a consolidated XML file for AI analysis.
Reads the contents of a Repomix output file, with optional line-range support for partial reads.
Searches a Repomix output file using JavaScript RegExp syntax, with configurable context lines.
Reads a file from the local file system with built-in security validation to prevent access to sensitive information.
Lists directory contents with clear indicators for files and folders, using absolute paths.