能力标签
Repomix仓库打包工具
🔌
MCP工具

Repomix仓库打包工具

基于 TypeScript · 让 AI 助手直接操作你的系统与工具
英文名:repomix
⭐ 24.9k Stars 🍴 1.3k Forks 💻 TypeScript 📄 MIT 🏷 AI 8.5分
8.5AI 综合评分
代码仓库文件打包AI工程MCP协议上下文管理
✦ AI Skill Hub 推荐

AI Skill Hub 强烈推荐:Repomix仓库打包工具 是一款优质的MCP工具。在 GitHub 上收获超过 24.9k 颗 Star,AI 综合评分 8.5 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。

📚 深度解析
Repomix仓库打包工具 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 Repomix仓库打包工具,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。Repomix仓库打包工具 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 Repomix仓库打包工具 评为 AI 评分 8.5 分,属于同类工具中的优质选择。
📋 工具概览

将整个代码仓库打包成单一文件的强大工具,支持MCP协议,便于将项目上下文发送给AI模型。适合开发者、AI工程师快速共享项目信息,提高AI辅助编程效率。

Repomix仓库打包工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 24.9k
开发语言
TypeScript
支持平台
Windows / macOS / Linux
维护状态
活跃维护,更新频繁
开源协议
MIT
AI 综合评分
8.5 分
工具类型
MCP工具
Forks
1.3k
📖 中文文档
以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

将整个代码仓库打包成单一文件的强大工具,支持MCP协议,便于将项目上下文发送给AI模型。适合开发者、AI工程师快速共享项目信息,提高AI辅助编程效率。

Repomix仓库打包工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/yamadashy/repomix

# 方式二:手动配置 claude_desktop_config.json
{
  "mcpServers": {
    "repomix------": {
      "command": "npx",
      "args": ["-y", "repomix"]
    }
  }
}

# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 Claude 对话中直接使用
# 示例:
用户: 请帮我用 Repomix仓库打包工具 执行以下任务...
Claude: [自动调用 Repomix仓库打包工具 MCP 工具处理请求]

# 查看可用工具列表
# 在 Claude 中输入:"列出所有可用的 MCP 工具"
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
// claude_desktop_config.json 配置示例
{
  "mcpServers": {
    "repomix______": {
      "command": "npx",
      "args": ["-y", "repomix"],
      "env": {
        // "API_KEY": "your-api-key-here"
      }
    }
  }
}

// 保存后重启 Claude Desktop 生效
📑 README 深度解析 真实文档 完整度 81/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

Special thanks to:

Warp sponsorship

🌟 Features

  • AI-Optimized: Formats your codebase in a way that's easy for AI to understand and process.
  • Token Counting: Provides token counts for each file and the entire repository, useful for LLM context limits.
  • Simple to Use: You need just one command to pack your entire repository.
  • Customizable: Easily configure what to include or exclude.
  • Git-Aware: Automatically respects your .gitignore, .ignore, and .repomixignore files.
  • Security-Focused: Incorporates Secretlint for robust security checks to detect and prevent inclusion of sensitive information.
  • Code Compression: The --compress option uses Tree-sitter to extract key code elements, reducing token count while preserving structure.

Install using npm

npm install -g repomix

Docker Usage 🐳

You can also run Repomix using Docker. This is useful if you want to run Repomix in an isolated environment or prefer using containers.

Basic usage (current directory):

docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix

To pack a specific directory:

docker run -v .:/app -it --rm ghcr.io/yamadashy/repomix path/to/directory

Process a remote repository and output to a output directory:

docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote https://github.com/yamadashy/repomix

Install commands plugin (extends functionality)

/plugin install repomix-commands@repomix

Install repository explorer plugin (AI-powered analysis)

/plugin install repomix-explorer@repomix


**Note**: The `repomix-mcp` plugin is recommended as a foundation. The `repomix-commands` plugin provides convenient slash commands, while `repomix-explorer` adds AI-powered analysis capabilities. While you can install them independently, using all three provides the most comprehensive experience.

**Alternatively, use the interactive plugin installer:**
text /plugin

This will open an interactive interface where you can browse and install available plugins.

#### Available Plugins

**1. repomix-mcp** (MCP Server Plugin)

Foundation plugin that provides AI-powered codebase analysis through MCP server integration.

**Features:**
- Pack local and remote repositories
- Search through packed outputs
- Read files with built-in security scanning (Secretlint)
- Automatic Tree-sitter compression (~70% token reduction)

**2. repomix-commands** (Slash Commands Plugin)

Provides convenient slash commands for quick operations with natural language support.

**Available Commands:**
- `/repomix-commands:pack-local` - Pack local codebase with various options
- `/repomix-commands:pack-remote` - Pack and analyze remote GitHub repositories

**Example usage:**
text /repomix-commands:pack-local Pack this project as markdown with compression

/repomix-commands:pack-remote yamadashy/repomix Pack only TypeScript files from the yamadashy/repomix repository


**3. repomix-explorer** (AI Analysis Agent Plugin)

AI-powered repository analysis agent that intelligently explores codebases using Repomix CLI.

**Features:**
- Natural language codebase exploration and analysis
- Intelligent pattern discovery and code structure understanding
- Incremental analysis using grep and targeted file reading
- Automatic context management for large repositories

**Available Commands:**
- `/repomix-explorer:explore-local` - Analyze local codebase with AI assistance
- `/repomix-explorer:explore-remote` - Analyze remote GitHub repositories with AI assistance

**Example usage:**
text /repomix-explorer:explore-local ./src Find all authentication-related code

/repomix-explorer:explore-remote facebook/react Show me the main component architecture ```

The agent automatically: 1. Runs npx repomix@latest to pack the repository 2. Uses Grep and Read tools to efficiently search the output 3. Provides comprehensive analysis without consuming excessive context

Benefits

  • Seamless Integration: Claude can directly analyze codebases without manual preparation
  • Natural Language: Use conversational commands instead of remembering CLI syntax
  • Always Latest: Automatically uses npx repomix@latest for up-to-date features
  • Security Built-in: Automatic Secretlint scanning prevents sensitive data exposure
  • Token Optimization: Tree-sitter compression for large codebases

For more details, see the plugin documentation in the .claude/plugins/ directory.

🚀 Quick Start

📊 Usage

To pack your entire repository:

repomix

To pack a specific directory:

repomix path/to/directory

To pack specific files or directories using glob patterns:

repomix --include "src/**/*.ts,**/*.md"

To exclude specific files or directories:

repomix --ignore "**/*.log,tmp/"

To pack a remote repository:

```bash repomix --remote https://github.com/yamadashy/repomix

Prompt Examples

Once you have generated the packed file with Repomix, you can use it with AI tools like ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more. Here are some example prompts to get you started:

Code Review and Refactoring

For a comprehensive code review and refactoring suggestions:

This file contains my entire codebase. Please review the overall structure and suggest any improvements or refactoring opportunities, focusing on maintainability and scalability.

Documentation Generation

To generate project documentation:

Based on the codebase in this file, please generate a detailed README.md that includes an overview of the project, its main features, setup instructions, and usage examples.

Test Case Generation

For generating test cases:

Analyze the code in this file and suggest a comprehensive set of unit tests for the main functions and classes. Include edge cases and potential error scenarios.

Code Quality Assessment

Evaluate code quality and adherence to best practices:

Review the codebase for adherence to coding best practices and industry standards. Identify areas where the code could be improved in terms of readability, maintainability, and efficiency. Suggest specific changes to align the code with best practices.

Library Overview

Get a high-level understanding of the library

This file contains the entire codebase of library. Please provide a comprehensive overview of the library, including its main purpose, key features, and overall architecture.

Feel free to modify these prompts based on your specific needs and the capabilities of the AI tool you're using.

Basic usage

repomix

Send output to stdout, then pipe into another command (for example, simonw/llm)

repomix --stdout | llm "Please explain what this code does."

Full non-interactive example

repomix --remote user/repo --skill-generate my-skill --skill-output ./output --force


#### Generated Structure

The Skills are generated with the following structure:
text .claude/skills/<skill-name>/ ├── SKILL.md # Main Skills metadata & documentation └── references/ ├── summary.md # Purpose, format, and statistics ├── project-structure.md # Directory tree with line counts ├── files.md # All file contents (grep-friendly) └── tech-stacks.md # Languages, frameworks, dependencies

#### What's Included

- **SKILL.md**: Contains Skills metadata, file/line/token counts, overview, and usage instructions
- **summary.md**: Explains the Skills' purpose, usage guidelines, and provides statistics breakdown by file type and language
- **project-structure.md**: Directory tree with line counts per file for easy file discovery
- **files.md**: All file contents with syntax highlighting headers, optimized for grep-friendly searching
- **tech-stacks.md**: Auto-detected tech stack per package from dependency files (`package.json`, `requirements.txt`, `Cargo.toml`, etc.)

#### Auto-Generated Skills Names

If no name is provided, Repomix auto-generates one:
bash repomix src/ --skill-generate # → repomix-reference-src repomix --remote user/repo --skill-generate # → repomix-reference-repo repomix --skill-generate CustomName # → custom-name (normalized to kebab-case)

#### Integration with Repomix Features

Skills generation respects all standard Repomix options:
bash

Example Configuration

Example configuration:

{
  "$schema": "https://repomix.com/schemas/latest/schema.json",
  "input": {
    "maxFileSize": 50000000
  },
  "output": {
    "filePath": "repomix-output.xml",
    "style": "xml",
    "parsableStyle": false,
    "compress": false,
    "headerText": "Custom header information for the packed file.",
    "fileSummary": true,
    "directoryStructure": true,
    "files": true,
    "removeComments": false,
    "removeEmptyLines": false,
    "topFilesLength": 5,
    "tokenCountTree": false, // or true, or a number like 10 for minimum token threshold
    "showLineNumbers": false,
    "truncateBase64": false,
    "copyToClipboard": false,
    "splitOutput": null, // or a number like 1000000 for ~1MB per file
    "includeEmptyDirectories": false,
    "git": {
      "sortByChanges": true,
      "sortByChangesMaxCommits": 100,
      "includeDiffs": false,
      "includeLogs": false,
      "includeLogsCount": 50
    }
  },
  "include": ["**/*"],
  "ignore": {
    "useGitignore": true,
    "useDefaultPatterns": true,
    // Patterns can also be specified in .repomixignore
    "customPatterns": [
      "additional-folder",
      "**/*.log"
    ],
  },
  "security": {
    "enableSecurityCheck": true
  },
  "tokenCount": {
    "encoding": "o200k_base"
  }
}

Command Line Options

#### Basic Options - -v, --version: Show version information and exit

CLI Input/Output Options

OptionDescription
--verboseEnable detailed debug logging (shows file processing, token counts, and configuration details)
--quietSuppress all console output except errors (useful for scripting)
--stdoutWrite packed output directly to stdout instead of a file (suppresses all logging)
--stdinRead file paths from stdin, one per line (specified files are processed directly)
--copyCopy the generated output to system clipboard after processing
--token-count-tree [threshold]Show file tree with token counts; optional threshold to show only files with ≥N tokens (e.g., --token-count-tree 100)
--top-files-len <number>Number of largest files to show in summary (default: 5)

Repomix Output Options

OptionDescription
-o, --output <file>Output file path (default: repomix-output.xml, use "-" for stdout)
--style <style>Output format: xml, markdown, json, or plain (default: xml)
--parsable-styleEscape special characters to ensure valid XML/Markdown (needed when output contains code that breaks formatting)
--compressExtract essential code structure (classes, functions, interfaces) using Tree-sitter parsing
--output-show-line-numbersPrefix each line with its line number in the output
--no-file-summaryOmit the file summary section from output
--no-directory-structureOmit the directory tree visualization from output
--no-filesGenerate metadata only without file contents (useful for repository analysis)
--remove-commentsStrip all code comments before packing
--remove-empty-linesRemove blank lines from all files
--truncate-base64Truncate long base64 data strings to reduce output size
--header-text <text>Custom text to include at the beginning of the output
--instruction-file-path <path>Path to file containing custom instructions to include in output
--split-output <size>Split output into multiple numbered files (e.g., repomix-output.1.xml); size like 500kb, 2mb, or 1.5mb
--include-empty-directoriesInclude folders with no files in directory structure
--include-full-directory-structureShow complete directory tree in output, including files not matched by --include patterns
--no-git-sort-by-changesDon't sort files by git change frequency (default: most changed files first)
--include-diffsAdd git diff section showing working tree and staged changes
--include-logsAdd git commit history with messages and changed files
--include-logs-count <count>Number of recent commits to include with --include-logs (default: 50)

File Selection Options

OptionDescription
--include <patterns>Include only files matching these glob patterns (comma-separated, e.g., "src/**/*.js,*.md")
-i, --ignore <patterns>Additional patterns to exclude (comma-separated, e.g., "*.test.js,docs/**")
--no-gitignoreDon't use .gitignore rules for filtering files
--no-dot-ignoreDon't use .ignore rules for filtering files
--no-default-patternsDon't apply built-in ignore patterns (node_modules, .git, build dirs, etc.)

Remote Repository Options

OptionDescription
--remote <url>Clone and pack a remote repository (GitHub URL or user/repo format)
--remote-branch <name>Specific branch, tag, or commit to use (default: repository's default branch)
--remote-trust-configTrust and load config files from remote repositories (disabled by default for security)

Configuration Options

OptionDescription
-c, --config <path>Use custom config file instead of repomix.config.json
--initCreate a new repomix.config.json file with defaults
--globalWith --init, create config in home directory instead of current directory

#### Security Options - --no-security-check: Skip scanning for sensitive data like API keys and passwords

#### Token Count Options - --token-count-encoding <encoding>: Tokenizer model for counting: o200k_base (GPT-4o), cl100k_base (GPT-3.5/4), etc. (default: o200k_base)

#### MCP - --mcp: Run as Model Context Protocol server for AI tool integration

Agent Skills Generation

OptionDescription
--skill-generate [name]Generate Claude Agent Skills format output to .claude/skills/<name>/ directory (name auto-generated if omitted)
--skill-output <path>Specify skill output directory path directly (skips location prompt)
-f, --forceSkip all confirmation prompts (e.g., skill directory overwrite)

Examples

```bash

Using --remote-branch option

repomix --remote https://github.com/yamadashy/repomix --remote-branch main

Using --remote-branch option

repomix --remote https://github.com/yamadashy/repomix --remote-branch 935b695

⚙️ Configuration

Repomix supports multiple configuration file formats for flexibility and ease of use.

Configuration File Formats

Repomix will automatically search for configuration files in the following priority order:

  1. TypeScript (repomix.config.ts, repomix.config.mts, repomix.config.cts)
  2. JavaScript/ES Module (repomix.config.js, repomix.config.mjs, repomix.config.cjs)
  3. JSON (repomix.config.json5, repomix.config.jsonc, repomix.config.json)

JSON Configuration

Create a repomix.config.json file in your project root:

repomix --init

This will create a repomix.config.json file with default settings.

TypeScript Configuration

TypeScript configuration files provide the best developer experience with full type checking and IDE support.

Installation:

To use TypeScript or JavaScript configuration with defineConfig, you need to install Repomix as a dev dependency:

npm install -D repomix

Example:

// repomix.config.ts
import { defineConfig } from 'repomix';

export default defineConfig({
  output: {
    filePath: 'output.xml',
    style: 'xml',
    removeComments: true,
  },
  ignore: {
    customPatterns: ['**/node_modules/**', '**/dist/**'],
  },
});

Benefits: - ✅ Full TypeScript type checking in your IDE - ✅ Excellent IDE autocomplete and IntelliSense - ✅ Use dynamic values (timestamps, environment variables, etc.)

Dynamic Values Example:

// repomix.config.ts
import { defineConfig } from 'repomix';

// Generate timestamp-based filename
const timestamp = new Date().toISOString().slice(0, 19).replace(/[:.]/g, '-');

export default defineConfig({
  output: {
    filePath: `output-${timestamp}.xml`,
    style: 'xml',
  },
});

JavaScript Configuration

JavaScript configuration files work the same as TypeScript, supporting defineConfig and dynamic values.

Configuration Options

Here's an explanation of the configuration options:

OptionDescriptionDefault
input.maxFileSizeMaximum file size in bytes to process. Files larger than this will be skipped50000000
output.filePathThe name of the output file"repomix-output.xml"
output.styleThe style of the output (xml, markdown, json, plain)"xml"
output.parsableStyleWhether to escape the output based on the chosen style schema. Note that this can increase token count.false
output.compressWhether to perform intelligent code extraction to reduce token countfalse
output.headerTextCustom text to include in the file headernull
output.instructionFilePathPath to a file containing detailed custom instructionsnull
output.fileSummaryWhether to include a summary section at the beginning of the outputtrue
output.directoryStructureWhether to include the directory structure in the outputtrue
output.filesWhether to include file contents in the outputtrue
output.removeCommentsWhether to remove comments from supported file typesfalse
output.removeEmptyLinesWhether to remove empty lines from the outputfalse
output.showLineNumbersWhether to add line numbers to each line in the outputfalse
output.truncateBase64Whether to truncate long base64 data strings (e.g., images) to reduce token countfalse
output.copyToClipboardWhether to copy the output to system clipboard in addition to saving the filefalse
output.splitOutputSplit output into multiple numbered files by maximum size per part (e.g., 1000000 for ~1MB). Keeps each file under the limit and avoids splitting files across partsNot set
output.topFilesLengthNumber of top files to display in the summary. If set to 0, no summary will be displayed5
output.tokenCountTreeWhether to display file tree with token count summaries. Can be boolean or number (minimum token count threshold)false
output.includeEmptyDirectoriesWhether to include empty directories in the repository structurefalse
output.includeFullDirectoryStructureWhen using include patterns, whether to display the complete directory tree (respecting ignore patterns) while still processing only the included files. Provides full repository context for AI analysisfalse
output.git.sortByChangesWhether to sort files by git change count (files with more changes appear at the bottom)true
output.git.sortByChangesMaxCommitsMaximum number of commits to analyze for git changes100
output.git.includeDiffsWhether to include git diffs in the output (includes both work tree and staged changes separately)false
output.git.includeLogsWhether to include git logs in the output (includes commit history with dates, messages, and file paths)false
output.git.includeLogsCountNumber of git log commits to include50
includePatterns of files to include (using [glob patterns](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax))[]
ignore.useGitignoreWhether to use patterns from the project's .gitignore filetrue
ignore.useDotIgnoreWhether to use patterns from the project's .ignore filetrue
ignore.useDefaultPatternsWhether to use default ignore patternstrue
ignore.customPatternsAdditional patterns to ignore (using [glob patterns](https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#pattern-syntax))[]
security.enableSecurityCheckWhether to perform security checks on filestrue
tokenCount.encodingToken count encoding for OpenAI-compatible tokenization (e.g., o200k_base for GPT-4o, cl100k_base for GPT-4/3.5). Powered by [gpt-tokenizer](https://github.com/nicolo-ribaudo/gpt-tokenizer)."o200k_base"

The configuration file supports JSON5 syntax, which allows: - Comments (both single-line and multi-line) - Trailing commas in objects and arrays - Unquoted property names - More relaxed string syntax

Global Configuration

To create a global configuration file:

repomix --init --global

The global configuration file will be created in:

  • Windows: %LOCALAPPDATA%\Repomix\repomix.config.json
  • macOS/Linux: $XDG_CONFIG_HOME/repomix/repomix.config.json or `~/.co

Using the CLI Tool `>_`

You can try Repomix instantly in your project directory without installation:

npx repomix@latest

Or install globally for repeated use:

```bash

Using The Browser Extension 🧩

Get instant access to Repomix directly from any GitHub repository! Our Chrome extension adds a convenient "Repomix" button to GitHub repository pages.

Repomix Browser Extension

#### Install - Chrome Extension: Repomix - Chrome Web Store - Firefox Add-on: Repomix - Firefox Add-ons

#### Features - One-click access to Repomix for any GitHub repository - More exciting features coming soon!

Using The VSCode Extension ⚡️

A community-maintained VSCode extension called Repomix Runner (created by massdo) lets you run Repomix right inside your editor with just a few clicks. Run it on any folder, manage outputs seamlessly, and control everything through VSCode's intuitive interface.

Want your output as a file or just the content? Need automatic cleanup? This extension has you covered. Plus, it works smoothly with your existing repomix.config.json.

Try it now on the VSCode Marketplace! Source code is available on GitHub.

Find files by extension

cat repomix-output.json | jq -r '.files | keys[] | select(endswith(".ts"))'

MCP Server Integration

Repomix supports the Model Context Protocol (MCP), allowing AI assistants to directly interact with your codebase. When run as an MCP server, Repomix provides tools that enable AI assistants to package local or remote repositories for analysis without requiring manual file preparation.

repomix --mcp

Configuring MCP Servers

To use Repomix as an MCP server with AI assistants like Claude, you need to configure the MCP settings:

For VS Code:

You can install the Repomix MCP server in VS Code using one of these methods:

  1. Using the Install Badge:

Install in VS Code Install in VS Code Insiders

  1. Using the Command Line:
  code --add-mcp '{"name":"repomix","command":"npx","args":["-y","repomix","--mcp"]}'
  

For VS Code Insiders:

  code-insiders --add-mcp '{"name":"repomix","command":"npx","args":["-y","repomix","--mcp"]}'
  

For Cline (VS Code extension):

Edit the cline_mcp_settings.json file:

{
  "mcpServers": {
    "repomix": {
      "command": "npx",
      "args": [
        "-y",
        "repomix",
        "--mcp"
      ]
    }
  }
}

For Cursor:

In Cursor, add a new MCP server from Cursor Settings > MCP > + Add new global MCP server with a configuration similar to Cline.

For Claude Desktop:

Edit the claude_desktop_config.json file with similar configuration to Cline's config.

For Claude Code:

To configure Repomix as an MCP server in Claude Code, use the following command:

claude mcp add repomix -- npx -y repomix --mcp

Alternatively, you can use the official Repomix plugins (see Claude Code Plugins section below).

Using Docker instead of npx:

You can use Docker as an alternative to npx for running Repomix as an MCP server:

{
  "mcpServers": {
    "repomix-docker": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/yamadashy/repomix",
        "--mcp"
      ]
    }
  }
}

Once configured, your AI assistant can directly use Repomix's capabilities to analyze codebases without manual file preparation, making code analysis workflows more efficient.

Available MCP Tools

When running as an MCP server, Repomix provides the following tools:

1. pack_codebase: Package a local code directory into a consolidated XML file for AI analysis - Parameters: - directory: Absolute path to the directory to pack - compress: (Optional, default: false) Enable Tree-sitter compression to extract essential code signatures and structure while removing implementation details. Reduces token usage by ~70% while preserving semantic meaning. Generally not needed since grep_repomix_output allows incremental content retrieval. Use only when you specifically need the entire codebase content for large repositories. - includePatterns: (Optional) Specify files to include using fast-glob patterns. Multiple patterns can be comma-separated (e.g., "**/.{js,ts}", "src/,docs/"). Only matching files will be processed. - ignorePatterns: (Optional) Specify additional files to exclude using fast-glob patterns. Multiple patterns can be comma-separated (e.g., "test/*,*.spec.js", "node_modules/,dist/"). These patterns supplement .gitignore, .ignore, and built-in exclusions. - topFilesLength: (Optional, default: 10) Number of largest files by size to display in the metrics summary for codebase analysis.

2. attach_packed_output: Attach an existing Repomix packed output file for AI analysis - Parameters: - path: Path to a directory containing repomix-output.xml or direct path to a packed repository XML file - topFilesLength: (Optional, default: 10) Number of largest files by size to display in the metrics summary - Features: - Accepts either a directory containing a repomix-output.xml file or a direct path to an XML file - Registers the file with the MCP server and returns the same structure as the pack_codebase tool - Provides secure access to existing packed outputs without requiring re-processing - Useful for working with previously generated packed repositories

3. pack_remote_repository: Fetch, clone, and package a GitHub repository into a consolidated XML file for AI analysis - Parameters: - remote: GitHub repository URL or user/repo format (e.g., "yamadashy/repomix", "https://github.com/user/repo", or "https://github.com/user/repo/tree/branch") - compress: (Optional, default: false) Enable Tree-sitter compression to extract essential code signatures and structure while removing implementation details. Reduces token usage by ~70% while preserving semantic meaning. Generally not needed since grep_repomix_output allows incremental content retrieval. Use only when you specifically need the entire codebase content for large repositories. - includePatterns: (Optional) Specify files to include using fast-glob patterns. Multiple patterns can be comma-separated (e.g., "**/.{js,ts}", "src/,docs/"). Only matching files will be processed. - ignorePatterns: (Optional) Specify additional files to exclude using fast-glob patterns. Multiple patterns can be comma-separated (e.g., "test/*,*.spec.js", "node_modules/,dist/"). These patterns supplement .gitignore, .ignore, and built-in exclusions. - topFilesLength: (Optional, default: 10) Number of largest files by size to display in the metrics summary for codebase analysis.

4. read_repomix_output: Read the contents of a Repomix-generated output file. Supports partial reading with line range specification for large files. - Parameters: - outputId: ID of the Repomix output file to read - startLine: (Optional) Starting line number (1-based, inclusive). If not specified, reads from beginning. - endLine: (Optional) Ending line number (1-based, inclusive). If not specified, reads to end. - Features: - Specifically designed for web-based environments or sandboxed applications - Retrieves the content of previously generated outputs using their ID - Provides secure access to packed codebase without requiring file system access - Supports partial reading for large files

5. grep_repomix_output: Search for patterns in a Repomix output file using grep-like functionality with JavaScript RegExp syntax - Parameters: - outputId: ID of the Repomix output file to search - pattern: Search pattern (JavaScript RegExp regular expression syntax) - contextLines: (Optional, default: 0) Number of context lines to show before and after each match. Overridden by beforeLines/afterLines if specified. - beforeLines: (Optional) Number of context lines to show before each match (like grep -B). Takes precedence over contextLines. - afterLines: (Optional) Number of context lines to show after each match (like grep -A). Takes precedence over contextLines. - ignoreCase: (Optional, default: false) Perform case-insensitive matching - Features: - Uses JavaScript RegExp syntax for powerful pattern matching - Supports context lines for better understanding of matches - Allows separate control of before/after context lines - Case-sensitive and case-insensitive search options

6. file_system_read_file: Read a file from the local file system using an absolute path. Includes built-in security validation to detect and prevent access to files containing sensitive information. - Parameters: - path: Absolute path to the file to read - Security features: - Implements security validation using Secretlint - Prevents access to files containing sensitive information (API keys, passwords, secrets) - Validates absolute paths to prevent directory traversal attacks

7. file_system_read_directory: List the contents of a directory using an absolute path. Returns a formatted list showing files and subdirectories with clear indicators. - Parameters: - path: Absolute path to the directory to list - Features: - Shows files and directories with clear indicators ([FILE] or [DIR]) - Provides safe directory traversal with proper error handling - Validates paths and ensures they are absolute - Useful for exploring project structure and understanding codebase organization

Claude Code Plugins

Repomix provides official plugins for Claude Code that integrate seamlessly with the AI-powered development environment.

Installation

1. Add the Repomix plugin marketplace:

/plugin marketplace add yamadashy/repomix

2. Install plugins:

```text

Alternatively using yarn

yarn global add repomix

Alternatively using bun

bun add -g repomix

Alternatively using Homebrew (macOS/Linux)

brew install repomix

Alternative Tools 🛠️

If you're using Python, you might want to check out Gitingest, which is better suited for Python ecosystem and data science workflows: https://github.com/cyclotruc/gitingest

🇨🇳 中文文档镜像 AI 翻译 2026-05-23
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介

Repomix 是一个用于优化代码仓库的工具,特别适合于 AI 的理解和处理。它可以格式化代码以便于 AI 处理,并提供 token 计数等功能。

⚡ 功能介绍

Repomix 的功能包括 AI 优化、token 计数、简单易用的界面、可定制的配置和 Git 感知等。

🛠 安装步骤(Docker/pip/源码)

可以使用 npm 安装 Repomix,或者使用 Docker 运行 Repomix。在 Docker 中,使用 `docker run` 命令即可启动 Repomix。还可以使用 MCP 服务器插件来安装 Repomix。

🚀 使用教程

使用 Repomix 的方法包括:使用 `repomix` 命令来打包整个代码仓库,使用 `repomix path/to/directory` 命令来打包特定目录,使用 `repomix --include` 和 `repomix --ignore` 命令来指定打包和忽略的文件或目录。

⚙️ 配置说明(含 MCP / env)

Repomix 的配置包括基本选项(如版本信息和调试日志),CLI 输入/输出选项(如详细调试日志和静默模式),以及使用 `--remote-branch` 选项来指定远程分支的方法。

🔌 API 说明

Repomix 可以使用 CLI 工具 `npx` 来直接在项目目录中使用,无需安装。还可以使用 Docker 来运行 Repomix。

🔄 工作流/模块

Repomix 可以与 GitHub 的浏览器扩展和 VSCode 扩展结合使用。还可以使用 MCP 服务器插件来安装 Repomix。

🎯 aiskill88 AI 点评 A 级 2026-05-17

高质量MCP工具,解决了AI工程中常见的项目上下文传递问题。设计简洁实用,社区活跃度高,是AI开发者的必备工具。

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
部署方案
  • Docker:repomix 提供官方镜像,docker compose up 一键启动
  • CLI:直接 npm install -g / pip install,命令行调用
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
repomix 中文教程repomix 安装报错怎么办repomix MCP 配置repomix Docker 部署repomix Agent 工作流repomix 与同类工具对比repomix 最佳实践repomix 适合谁用
⚡ 核心功能
👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
👥 适合人群
Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师
🎯 使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
⚖️ 优点与不足
✅ 优点
  • +GitHub 24.9k Star,社区高度认可
  • +MIT 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合
❓ 常见问题 FAQ
repomix 是一款TypeScript开发的AI辅助工具。开源MCP工具:📦 Repomix is a powerful tool that packs your entire repository into a single, A。⭐24.9k · TypeScript 主要应用场景包括:AI辅助编程时共享完整项目、快速生成项目摘要给LLM、代码库分析和理解。
💡 AI Skill Hub 点评

总体来看,Repomix仓库打包工具 是一款质量优秀的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ MIT 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 Repomix仓库打包工具
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 repomix
原始描述 开源MCP工具:📦 Repomix is a powerful tool that packs your entire repository into a single, A。⭐24.9k · TypeScript
Topics 代码仓库文件打包AI工程MCP协议上下文管理
GitHub https://github.com/yamadashy/repomix
License MIT
语言 TypeScript
🔗 原始来源
🐙 GitHub 仓库  https://github.com/yamadashy/repomix 🌐 官方网站  https://repomix.com

收录时间:2026-05-16 · 更新时间:2026-05-19 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。