repomix-mcp
An MCP server that provides intelligent context gathering capabilities using repomix. This tool helps AI assistants understand your codebase better by automatically analyzing project structure and gathering relevant context.
Features
- Smart directory detection and context gathering
- Project type detection (React, Vue, Angular)
- Configurable file patterns and exclusions
- Automatic configuration file inclusion
- Project structure analysis for optimal context gathering
- Concise summaries for users with full context for AI
Installation
You can use repomix-mcp directly with npx without installing:
npx repomix-mcp
Or install globally:
npm install -g repomix-mcp
Usage
As an MCP Server
Add to your MCP settings configuration file (e.g., claude_desktop_config.json):
{
"mcpServers": {
"repomix": {
"command": "npx",
"args": ["repomix-mcp"],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
Or if installed globally:
{
"mcpServers": {
"repomix": {
"command": "repomix-mcp",
"args": [],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
Available Tools
1. gather_context
Gathers context from specified directories using repomix.
Parameters:
baseDir
(required): Base directory to search in
targetDirs
(optional): Target directories to find (e.g. ['translations', 'src'])
patterns
(optional): File patterns to include
depth
(optional): Context gathering depth ('shallow', 'dependencies', 'full')
includeConfigs
(optional): Include configuration files
excludePatterns
(optional): Patterns to exclude
Example:
await mcp.use("repomix", "gather_context", {
baseDir: "/path/to/project",
targetDirs: ["src", "translations"],
patterns: ["*.ts", "*.tsx"],
includeConfigs: true,
excludePatterns: ["**/*.test.*"],
});
Output:
📦 Context Summary:
Total Files: 2
Total Lines: 150
Total Characters: 4500
Files Included:
- src/index.ts (100 lines, 3000 chars)
- translations/en.ts (50 lines, 1500 chars)
2. analyze_project
Analyzes project structure and suggests context gathering strategy.
Parameters:
projectDir
(required): Project directory to analyze
Example:
await mcp.use("repomix", "analyze_project", {
projectDir: "/path/to/project",
});
Output:
{
"projectType": "react",
"suggestedConfig": {
"baseDir": "/path/to/project",
"targetDirs": ["src", "components", "pages", "hooks"],
"patterns": ["*.tsx", "*.jsx"],
"includeConfigs": true,
"depth": "dependencies",
"excludePatterns": ["**/*.test.*", "**/*.spec.*", "**/node_modules/**"]
}
}
Development
- Clone the repository:
git clone https://github.com/yourusername/repomix-mcp.git
cd repomix-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
- Run locally:
npm start
License
MIT