Home / MCP / Repomix MCP Server
Provides on-demand codebase packaging for AI tools via an MCP endpoint, enabling secure, structured analysis of local and remote repositories.
Configuration
View docs{
"mcpServers": {
"repomix_mcp": {
"command": "repomix",
"args": [
"--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 document for AI analysis. Supports options like compress, include/exclude patterns, and git-context features.
Attach an existing repomix-packed XML file for AI analysis without re-packing.
Fetch, clone, and package a remote GitHub repository into a single consolidated XML file for AI analysis.
Read the contents of a packed output file, with optional partial reading by line ranges.
Search within a packed output using regex patterns, with configurable context lines.
Read a file from the local file system with security validation to prevent access to sensitive data.
List directory contents with clear indicators and safe traversal.