home / mcp / 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.
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.
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.
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 --mcpConfigure 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"]
}
}
}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.
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.
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.
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 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.
Fetch, clone, and package a remote GitHub repository into a consolidated XML file for AI analysis. Supports compression and include/ignore patterns.
Read the contents of a Repomix-generated output file, with optional line-range specification for partial reads.
Search for patterns in a Repomix output file using JavaScript RegExp syntax, with configurable context lines.
Read a file from the local file system with security validation to prevent access to sensitive information.
List directory contents with clear indicators for files and subdirectories, using absolute paths and safe traversal.