Skip to main content
Glama
Repomix MCP Server

Repomix MCP Server

by Aeolun

Repomix MCP Server

A Model Context Protocol (MCP) server that provides access to the repomix tool for packing repositories into AI-friendly files.

Security

  • Input paths: The server restricts file access to the directory from which it was started. Any attempts to access files outside this directory (like /etc/) will be denied.

  • Output files: All output is written to the system's temporary directory and automatically cleaned up after the contents are returned.

  • Remote URLs: Remote repository URLs are still allowed for processing.

Related MCP server: MCP-Repo2LLM

Installation

npm install
npm run build

Usage

Claude Code

claude mcp add --scope user repomix node /path/to/repomix-mcp/dist/index.js

Claude Desktop

Add this server to your MCP client configuration in your claude_desktop_config.json:

{
  "mcpServers": {
    "repomix": {
      "command": "node",
      "args": ["/path/to/repomix-mcp/dist/index.js"]
    }
  }
}

Available Tools

Both tools accept the same parameters:

Parameters

Parameter

Type

Required

Description

Examples

path

string

No

Directory path to pack

/path/to/repo

style

enum

No

Output format style

xml, markdown, plain

compress

boolean

No

Compress output to reduce token count

true, false

include

string

No

Files to include (glob pattern)

*.md,*.ts,*.js, *.py, src/**/*.go

ignore

string

No

Files to exclude (glob pattern)

*test*,*spec*,dist/**,build/**

remote

string

No

Remote repository URL to process

https://github.com/user/repo

repomix-estimate

Estimate the size of repomix output without retrieving the content. Use this first to check if the output will fit in your context window.

Returns:

  • File size in KB/MB

  • Estimated token count (~4 characters per token)

  • Whether compression is enabled

repomix-estimate output

Repomix output size estimate:
- Size: 5.27 KB (0.01 MB)
- Estimated tokens: ~1,349
- Compression: disabled

Use the repomix tool with these same parameters to retrieve the actual content.

repomix

Pack a repository into a single, AI-friendly file. Returns the contents of the generated file.

Best Practice: Always use repomix-estimate first to check the output size, then use repomix with appropriate parameters (especially compress=true for large repos).

Example usage in Claude:

  1. First check size: use repomix-estimate tool

  2. If size is reasonable: use repomix tool

  3. If too large, try with compression: use repomix-estimate tool with compress=true

  4. Then retrieve: use repomix tool with compress=true

Workflow: Always estimate first, then retrieve only if the size fits your needs.

repomix output (first 15 lines)

This file is a merged representation of a subset of the codebase, containing specifically included files, combined into a single document by Repomix.

<file_summary>
This section contains a summary of this file.

<purpose>
This file contains a packed representation of the entire repository's contents.
It is designed to be easily consumable by AI systems for analysis, code review,
or other automated processes.
</purpose>

<file_format>
The content is organized as follows:
1. This summary section
2. Repository information

Available Tools

2 tools
repomixA

Pack repository files into a single AI-friendly file. Use at session start to load context efficiently. IMPORTANT: Always use the "include" parameter to filter only relevant files (e.g., ".md,.ts,.js" for a TypeScript project, or ".md,*.py" for Python). Start with root-level *.md files and source files in the language being worked on. Always use repomix-estimate first to check size.

Inputs: path, style, compress, include, +2 more.

repomix-estimateA

Estimate repomix output size before retrieval. ALWAYS use this first with the "include" parameter to filter only relevant files (e.g., ".md,.ts,.js" for TypeScript, ".md,*.py" for Python). If estimated tokens are reasonable (<50K), proceed with repomix using the same filters. This helps load the entire relevant context efficiently.

Inputs: path, style, compress, include, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: repomix-estimate is for estimating output size before retrieval, while repomix is for actually packing repository files. There is no overlap or ambiguity between them, as one is a preparatory check and the other is the main action.

    Naming Consistency5/5

    Both tools follow a consistent naming pattern with the 'repomix' prefix and descriptive suffixes ('-estimate' vs. no suffix for the base tool). This creates a clear hierarchy and makes the relationship between the tools immediately apparent.

    Tool Count3/5

    With only 2 tools, the server feels thin for a repository management domain. While the tools cover a specific workflow (estimation and packing), typical repository operations like listing, searching, or updating files are missing, making the scope narrow and potentially limiting for agents.

    Completeness2/5

    The server is severely incomplete for repository management. It only supports packing and estimating repository files, with no tools for creating, reading, updating, or deleting repository content, nor for common operations like cloning, branching, or committing. This will cause significant agent failures in broader repository tasks.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Repomix MCP Server enables AI models to efficiently analyze codebases by packaging local or remote repositories into optimized single files, with intelligent compression via Tree-sitter to significantly reduce token usage while preserving code structure and essential signatures.
      163,830 npm
      29,385
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      A MCP server that transforms code repositories from GitHub, GitLab, or local directories into LLM-friendly formats, preserving context and structure for better AI processing.
      3
      11
      Apache 2.0