Home / MCP / Repomix MCP Server
Packs repositories into an AI-friendly format and exposes it via MCP for AI-assisted analysis.
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.
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.
Prerequisites: ensure you have Node.js installed (recommended) or use Docker to run the MCP server container.
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.xmlThe 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.
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.
# Start MCP server in stdout mode (example)
repomix --mcp
# Start MCP server using Docker (example)
docker run -i --rm ghcr.io/yamadashy/repomix --mcpPackage a local code directory into a consolidated XML file for AI analysis, with optional compression and include/exclude patterns.
Attach an existing packed output file for AI analysis, supporting directory or direct file paths.
Fetch, clone, and package a remote GitHub repository into a consolidated XML file for AI analysis.
Read the contents of a Repomix-generated output file, with optional line-range access for partial reads.
Search within a packed output using RegExp with configurable context lines.
Read a file from the local file system with security checks to prevent access to sensitive information.
List the contents of a directory with clear indicators for files and subdirectories.