docs(website): Update MCP server documentation for pack_codebase and pack_remote_repository tools

This commit is contained in:
Kazuki Yamada
2025-05-25 13:49:47 +09:00
parent e67d0bf384
commit efdbe4ec83
11 changed files with 741 additions and 194 deletions

View File

@@ -707,43 +707,63 @@ Once configured, your AI assistant can directly use Repomix's capabilities to an
When running as an MCP server, Repomix provides the following tools:
1. **pack_codebase**: Package a local code directory into a consolidated file for AI analysis
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: true) Whether to perform intelligent code extraction
- `includePatterns`: (Optional) Comma-separated list of include patterns
- `ignorePatterns`: (Optional) Comma-separated list of ignore patterns
- `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 and built-in exclusions.
- `topFilesLength`: (Optional, default: 10) Number of largest files by size to display in the metrics summary for codebase analysis.
2. **pack_remote_repository**: Fetch, clone and package a GitHub repository
2. **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)
- `compress`: (Optional, default: true) Whether to perform intelligent code extraction
- `includePatterns`: (Optional) Comma-separated list of include patterns
- `ignorePatterns`: (Optional) Comma-separated list of ignore patterns
- `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 and built-in exclusions.
- `topFilesLength`: (Optional, default: 10) Number of largest files by size to display in the metrics summary for codebase analysis.
3. **read_repomix_output**: Read the contents of a Repomix output file in environments where direct file access is not possible
3. **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
4. **file_system_read_file**: Read a file using an absolute path with security validation
4. **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
5. **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](https://github.com/secretlint/secretlint)
- Prevents access to files containing sensitive information
- Prevents access to files containing sensitive information (API keys, passwords, secrets)
- Validates absolute paths to prevent directory traversal attacks
5. **file_system_read_directory**: List contents of a directory using an absolute path
6. **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
## ⚙️ Configuration

View File

@@ -53,73 +53,110 @@ Once configured, you'll have access to these Repomix tools:
### 1. pack_codebase
This tool packages a local code directory into a consolidated file for AI analysis.
This tool packages a local code directory into a consolidated XML file for AI analysis. It analyzes the codebase structure, extracts relevant code content, and generates a comprehensive report including metrics, file tree, and formatted code content.
**Parameters:**
- `directory`: (Required) Absolute path to the directory to pack
- `compress`: (Optional, default: true) Whether to perform intelligent code extraction to reduce token count
- `includePatterns`: (Optional) Comma-separated list of include patterns
- `ignorePatterns`: (Optional) Comma-separated list of ignore patterns
- `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 and built-in exclusions.
- `topFilesLength`: (Optional, default: 10) Number of largest files by size to display in the metrics summary for codebase analysis.
**Example:**
```json
{
"directory": "/path/to/your/project",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### 2. pack_remote_repository
This tool fetches, clones, and packages a GitHub repository into a consolidated file for AI analysis.
This tool fetches, clones, and packages a GitHub repository into a consolidated XML file for AI analysis. It automatically clones the remote repository, analyzes its structure, and generates a comprehensive report.
**Parameters:**
- `remote`: (Required) GitHub repository URL or user/repo format (e.g., yamadashy/repomix)
- `compress`: (Optional, default: true) Whether to perform intelligent code extraction to reduce token count
- `includePatterns`: (Optional) Comma-separated list of include patterns
- `ignorePatterns`: (Optional) Comma-separated list of ignore patterns
- `remote`: (Required) 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 and built-in exclusions.
- `topFilesLength`: (Optional, default: 10) Number of largest files by size to display in the metrics summary for codebase analysis.
**Example:**
```json
{
"remote": "yamadashy/repomix",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### 3. read_repomix_output
This tool reads the contents of a Repomix output file in environments where direct file access is not possible.
This tool reads the contents of a Repomix-generated output file. Supports partial reading with line range specification for large files. This tool is designed for environments where direct file system access is limited.
**Parameters:**
- `outputId`: (Required) 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
**Example:**
```json
{
"outputId": "8f7d3b1e2a9c6054"
"outputId": "8f7d3b1e2a9c6054",
"startLine": 100,
"endLine": 200
}
```
### 4. file_system_read_file
### 4. grep_repomix_output
This tool reads a file using an absolute path with security validation.
This tool searches for patterns in a Repomix output file using grep-like functionality with JavaScript RegExp syntax. Returns matching lines with optional context lines around matches.
**Parameters:**
- `outputId`: (Required) ID of the Repomix output file to search
- `pattern`: (Required) 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
**Example:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"pattern": "function\\s+\\w+\\(",
"contextLines": 3,
"ignoreCase": false
}
```
### 5. file_system_read_file
This tool reads 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`: (Required) Absolute path to the file to read
**Security features:**
- Implements security validation using [Secretlint](https://github.com/secretlint/secretlint)
- Prevents access to files containing sensitive information
- Prevents access to files containing sensitive information (API keys, passwords, secrets)
- Validates absolute paths to prevent directory traversal attacks
**Example:**
@@ -129,9 +166,9 @@ This tool reads a file using an absolute path with security validation.
}
```
### 5. file_system_read_directory
### 6. file_system_read_directory
This tool lists contents of a directory using an absolute path.
This tool lists the contents of a directory using an absolute path. Returns a formatted list showing files and subdirectories with clear indicators.
**Parameters:**
- `path`: (Required) Absolute path to the directory to list
@@ -140,6 +177,7 @@ This tool lists contents of a directory using an absolute path.
- 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
**Example:**
```json

View File

@@ -93,41 +93,97 @@ Wenn Repomix als MCP-Server ausgeführt wird, stellt es die folgenden Tools bere
### pack_codebase
Dieses Tool verpackt ein lokales Code-Verzeichnis in eine konsolidierte Datei für die KI-Analyse.
Dieses Tool verpackt ein lokales Code-Verzeichnis in eine XML-Datei für die KI-Analyse. Es analysiert die Codebase-Struktur, extrahiert relevanten Code-Inhalt und generiert einen umfassenden Bericht mit Metriken, Dateibaum und formatiertem Code-Inhalt.
**Parameter:**
- `directory`: (Erforderlich) Absoluter Pfad zum zu verpackenden Verzeichnis
- `compress`: (Optional, Standard: true) Ob eine intelligente Code-Extraktion durchgeführt werden soll, um die Token-Anzahl zu reduzieren
- `includePatterns`: (Optional) Kommagetrennte Liste von Einschlussmuster
- `ignorePatterns`: (Optional) Kommagetrennte Liste von Ausschlussmuster
- `compress`: (Optional, Standard: false) Aktiviert Tree-sitter-Komprimierung zur Extraktion wesentlicher Code-Signaturen und -Strukturen bei gleichzeitiger Entfernung von Implementierungsdetails. Reduziert die Token-Nutzung um ~70% bei Beibehaltung der semantischen Bedeutung. Normalerweise nicht erforderlich, da grep_repomix_output inkrementelle Inhaltsabrufung ermöglicht. Verwenden Sie dies nur, wenn Sie speziell den gesamten Codebase-Inhalt für große Repositories benötigen.
- `includePatterns`: (Optional) Spezifiziert Dateien zum Einschließen mit fast-glob-Mustern. Mehrere Muster können durch Kommas getrennt werden (z.B. "**/*.{js,ts}", "src/**,docs/**"). Nur übereinstimmende Dateien werden verarbeitet.
- `ignorePatterns`: (Optional) Spezifiziert zusätzliche Dateien zum Ausschließen mit fast-glob-Mustern. Mehrere Muster können durch Kommas getrennt werden (z.B. "test/**,*.spec.js", "node_modules/**,dist/**"). Diese Muster ergänzen .gitignore und eingebaute Ausschlüsse.
- `topFilesLength`: (Optional, Standard: 10) Anzahl der größten Dateien nach Größe, die in der Metrik-Zusammenfassung für die Codebase-Analyse angezeigt werden.
**Beispiel:**
```json
{
"directory": "/path/to/your/project",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### pack_remote_repository
Dieses Tool holt, klont und verpackt ein GitHub-Repository in eine konsolidierte Datei für die KI-Analyse.
Dieses Tool holt, klont und verpackt ein GitHub-Repository in eine XML-Datei für die KI-Analyse. Es klont automatisch das entfernte Repository, analysiert seine Struktur und generiert einen umfassenden Bericht.
**Parameter:**
- `remote`: (Erforderlich) GitHub-Repository-URL oder user/repo-Format (z.B. yamadashy/repomix)
- `compress`: (Optional, Standard: true) Ob eine intelligente Code-Extraktion durchgeführt werden soll, um die Token-Anzahl zu reduzieren
- `includePatterns`: (Optional) Kommagetrennte Liste von Einschlussmuster
- `ignorePatterns`: (Optional) Kommagetrennte Liste von Ausschlussmuster
- `remote`: (Erforderlich) GitHub-Repository-URL oder user/repo-Format (z.B. "yamadashy/repomix", "https://github.com/user/repo", oder "https://github.com/user/repo/tree/branch")
- `compress`: (Optional, Standard: false) Aktiviert Tree-sitter-Komprimierung zur Extraktion wesentlicher Code-Signaturen und -Strukturen bei gleichzeitiger Entfernung von Implementierungsdetails. Reduziert die Token-Nutzung um ~70% bei Beibehaltung der semantischen Bedeutung. Normalerweise nicht erforderlich, da grep_repomix_output inkrementelle Inhaltsabrufung ermöglicht. Verwenden Sie dies nur, wenn Sie speziell den gesamten Codebase-Inhalt für große Repositories benötigen.
- `includePatterns`: (Optional) Spezifiziert Dateien zum Einschließen mit fast-glob-Mustern. Mehrere Muster können durch Kommas getrennt werden (z.B. "**/*.{js,ts}", "src/**,docs/**"). Nur übereinstimmende Dateien werden verarbeitet.
- `ignorePatterns`: (Optional) Spezifiziert zusätzliche Dateien zum Ausschließen mit fast-glob-Mustern. Mehrere Muster können durch Kommas getrennt werden (z.B. "test/**,*.spec.js", "node_modules/**,dist/**"). Diese Muster ergänzen .gitignore und eingebaute Ausschlüsse.
- `topFilesLength`: (Optional, Standard: 10) Anzahl der größten Dateien nach Größe, die in der Metrik-Zusammenfassung für die Codebase-Analyse angezeigt werden.
**Beispiel:**
```json
{
"remote": "yamadashy/repomix",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### read_repomix_output
Dieses Tool liest den Inhalt einer von Repomix generierten Ausgabedatei. Es unterstützt partielles Lesen mit Zeilenbereichen für große Dateien. Dieses Tool ist für Umgebungen konzipiert, in denen der direkte Dateisystemzugriff eingeschränkt ist.
**Parameter:**
- `outputId`: (Erforderlich) ID der zu lesenden Repomix-Ausgabedatei
- `startLine`: (Optional) Startzeilennummer (1-basiert, inklusive). Wenn nicht angegeben, wird vom Anfang gelesen.
- `endLine`: (Optional) Endzeilennummer (1-basiert, inklusive). Wenn nicht angegeben, wird bis zum Ende gelesen.
**Funktionen:**
- Speziell für webbasierte Umgebungen oder Sandbox-Anwendungen entwickelt
- Ruft den Inhalt zuvor generierter Ausgaben über ihre ID ab
- Bietet sicheren Zugriff auf verpackte Codebase ohne Dateisystemzugriff
- Unterstützt partielles Lesen für große Dateien
**Beispiel:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"startLine": 100,
"endLine": 200
}
```
### grep_repomix_output
Dieses Tool durchsucht Muster in einer Repomix-Ausgabedatei mit grep-ähnlicher Funktionalität unter Verwendung der JavaScript RegExp-Syntax. Es gibt übereinstimmende Zeilen mit optionalen Kontextzeilen um die Übereinstimmungen zurück.
**Parameter:**
- `outputId`: (Erforderlich) ID der zu durchsuchenden Repomix-Ausgabedatei
- `pattern`: (Erforderlich) Suchmuster (JavaScript RegExp-Syntax für reguläre Ausdrücke)
- `contextLines`: (Optional, Standard: 0) Anzahl der Kontextzeilen, die vor und nach jeder Übereinstimmung angezeigt werden. Wird von beforeLines/afterLines überschrieben, wenn angegeben.
- `beforeLines`: (Optional) Anzahl der Kontextzeilen, die vor jeder Übereinstimmung angezeigt werden (wie grep -B). Hat Vorrang vor contextLines.
- `afterLines`: (Optional) Anzahl der Kontextzeilen, die nach jeder Übereinstimmung angezeigt werden (wie grep -A). Hat Vorrang vor contextLines.
- `ignoreCase`: (Optional, Standard: false) Führt groß-/kleinschreibungsunabhängige Übereinstimmung durch
**Funktionen:**
- Verwendet JavaScript RegExp-Syntax für leistungsstarke Musterübereinstimmung
- Unterstützt Kontextzeilen für besseres Verständnis der Übereinstimmungen
- Ermöglicht separate Kontrolle von Vor-/Nach-Kontextzeilen
- Groß-/kleinschreibungsabhängige und -unabhängige Suchoptionen
**Beispiel:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"pattern": "function\\s+\\w+\\(",
"contextLines": 3,
"ignoreCase": false
}
```
@@ -136,16 +192,20 @@ Dieses Tool holt, klont und verpackt ein GitHub-Repository in eine konsolidierte
Der Repomix MCP-Server bietet zwei Dateisystemwerkzeuge, die es KI-Assistenten ermöglichen, sicher mit dem lokalen Dateisystem zu interagieren:
1. `file_system_read_file`
- Liest Dateiinhalte unter Verwendung absoluter Pfade
- Liest Dateiinhalte aus dem lokalen Dateisystem unter Verwendung absoluter Pfade
- Beinhaltet eingebaute Sicherheitsvalidierung zur Erkennung und Verhinderung des Zugriffs auf Dateien mit sensiblen Informationen
- Implementiert Sicherheitsvalidierung mit [Secretlint](https://github.com/secretlint/secretlint)
- Verhindert den Zugriff auf Dateien mit sensiblen Informationen
- Verhindert den Zugriff auf Dateien mit sensiblen Informationen (API-Schlüssel, Passwörter, Geheimnisse)
- Validiert absolute Pfade zur Verhinderung von Directory Traversal-Angriffen
- Liefert klare Fehlermeldungen für ungültige Pfade und Sicherheitsprobleme
2. `file_system_read_directory`
- Listet Verzeichnisinhalte unter Verwendung absoluter Pfade
- Listet den Inhalt eines Verzeichnisses unter Verwendung eines absoluten Pfads
- Gibt eine formatierte Liste zurück, die Dateien und Unterverzeichnisse mit klaren Indikatoren zeigt
- Zeigt Dateien und Verzeichnisse mit klaren Indikatoren (`[FILE]` oder `[DIR]`)
- Bietet sichere Verzeichnisnavigation mit angemessener Fehlerbehandlung
- Validiert Pfade und stellt sicher, dass sie absolut sind
- Nützlich für die Erkundung der Projektstruktur und das Verständnis der Codebase-Organisation
Beide Werkzeuge beinhalten robuste Sicherheitsmaßnahmen:
- Validierung absoluter Pfade zur Verhinderung von Directory Traversal-Angriffen
@@ -167,7 +227,7 @@ const dirContent = await tools.file_system_read_directory({
```
Diese Werkzeuge sind besonders nützlich, wenn KI-Assistenten:
- Bestimmte Dateien im Codebase analysieren müssen
- Bestimmte Dateien in der Codebase analysieren müssen
- Verzeichnisstrukturen navigieren müssen
- Existenz und Zugänglichkeit von Dateien überprüfen müssen
- Sichere Dateisystemoperationen gewährleisten müssen

View File

@@ -93,60 +93,97 @@ When running as an MCP server, Repomix provides the following tools:
### pack_codebase
This tool packages a local code directory into a consolidated file for AI analysis.
This tool packages a local code directory into a consolidated XML file for AI analysis. It analyzes the codebase structure, extracts relevant code content, and generates a comprehensive report including metrics, file tree, and formatted code content.
**Parameters:**
- `directory`: (Required) Absolute path to the directory to pack
- `compress`: (Optional, default: true) Whether to perform intelligent code extraction to reduce token count
- `includePatterns`: (Optional) Comma-separated list of include patterns
- `ignorePatterns`: (Optional) Comma-separated list of ignore patterns
- `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 and built-in exclusions.
- `topFilesLength`: (Optional, default: 10) Number of largest files by size to display in the metrics summary for codebase analysis.
**Example:**
```json
{
"directory": "/path/to/your/project",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### pack_remote_repository
This tool fetches, clones, and packages a GitHub repository into a consolidated file for AI analysis.
This tool fetches, clones, and packages a GitHub repository into a consolidated XML file for AI analysis. It automatically clones the remote repository, analyzes its structure, and generates a comprehensive report.
**Parameters:**
- `remote`: (Required) GitHub repository URL or user/repo format (e.g., yamadashy/repomix)
- `compress`: (Optional, default: true) Whether to perform intelligent code extraction to reduce token count
- `includePatterns`: (Optional) Comma-separated list of include patterns
- `ignorePatterns`: (Optional) Comma-separated list of ignore patterns
- `remote`: (Required) 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 and built-in exclusions.
- `topFilesLength`: (Optional, default: 10) Number of largest files by size to display in the metrics summary for codebase analysis.
**Example:**
```json
{
"remote": "yamadashy/repomix",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### read_repomix_output
This tool reads the contents of a Repomix output file in environments where direct file access is not possible.
This tool reads the contents of a Repomix-generated output file. Supports partial reading with line range specification for large files. This tool is designed for environments where direct file system access is limited.
**Parameters:**
- `outputId`: (Required) 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
**Example:**
```json
{
"outputId": "8f7d3b1e2a9c6054"
"outputId": "8f7d3b1e2a9c6054",
"startLine": 100,
"endLine": 200
}
```
### grep_repomix_output
This tool searches for patterns in a Repomix output file using grep-like functionality with JavaScript RegExp syntax. Returns matching lines with optional context lines around matches.
**Parameters:**
- `outputId`: (Required) ID of the Repomix output file to search
- `pattern`: (Required) 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
**Example:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"pattern": "function\\s+\\w+\\(",
"contextLines": 3,
"ignoreCase": false
}
```
@@ -155,16 +192,20 @@ This tool reads the contents of a Repomix output file in environments where dire
Repomix's MCP server provides two file system tools that allow AI assistants to safely interact with the local file system:
1. `file_system_read_file`
- Reads file contents using absolute paths
- Reads file contents from the local file system using absolute paths
- Includes built-in security validation to detect and prevent access to files containing sensitive information
- Implements security validation using [Secretlint](https://github.com/secretlint/secretlint)
- Prevents access to files containing sensitive information
- Prevents access to files containing sensitive information (API keys, passwords, secrets)
- Validates absolute paths to prevent directory traversal attacks
- Returns formatted content with clear error messages for invalid paths or security issues
2. `file_system_read_directory`
- Lists directory contents using absolute paths
- Lists the contents of a directory using an absolute path
- Returns a formatted list showing files and subdirectories with clear indicators
- Shows both 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
Both tools incorporate robust security measures:
- Absolute path validation to prevent directory traversal attacks

View File

@@ -93,60 +93,97 @@ Cuando se ejecuta como servidor MCP, Repomix proporciona las siguientes herramie
### pack_codebase
Esta herramienta empaqueta un directorio de código local en un archivo consolidado para análisis de IA.
Esta herramienta empaqueta un directorio de código local en un archivo XML para análisis de IA. Analiza la estructura del código base, extrae contenido de código relevante y genera un informe completo que incluye métricas, árbol de archivos y contenido de código formateado.
**Parámetros:**
- `directory`: (Requerido) Ruta absoluta al directorio a empaquetar
- `compress`: (Opcional, predeterminado: true) Si se debe realizar extracción inteligente de código para reducir el recuento de tokens
- `includePatterns`: (Opcional) Lista separada por comas de patrones de inclusión
- `ignorePatterns`: (Opcional) Lista separada por comas de patrones de exclusión
- `compress`: (Opcional, predeterminado: false) Habilita la compresión Tree-sitter para extraer firmas de código esenciales y estructura mientras elimina detalles de implementación. Reduce el uso de tokens en ~70% manteniendo el significado semántico. Generalmente no es necesario ya que grep_repomix_output permite recuperación incremental de contenido. Úsalo solo cuando específicamente necesites el contenido completo del código base para repositorios grandes.
- `includePatterns`: (Opcional) Especifica archivos a incluir usando patrones fast-glob. Múltiples patrones pueden separarse por comas (ej: "**/*.{js,ts}", "src/**,docs/**"). Solo se procesarán archivos coincidentes.
- `ignorePatterns`: (Opcional) Especifica archivos adicionales a excluir usando patrones fast-glob. Múltiples patrones pueden separarse por comas (ej: "test/**,*.spec.js", "node_modules/**,dist/**"). Estos patrones complementan .gitignore y exclusiones integradas.
- `topFilesLength`: (Opcional, predeterminado: 10) Número de archivos más grandes por tamaño para mostrar en el resumen de métricas para análisis del código base.
**Ejemplo:**
```json
{
"directory": "/path/to/your/project",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### pack_remote_repository
Esta herramienta obtiene, clona y empaqueta un repositorio de GitHub en un archivo consolidado para análisis de IA.
Esta herramienta obtiene, clona y empaqueta un repositorio de GitHub en un archivo XML para análisis de IA. Clona automáticamente el repositorio remoto, analiza su estructura y genera un informe completo.
**Parámetros:**
- `remote`: (Requerido) URL del repositorio de GitHub o formato usuario/repo (ej. yamadashy/repomix)
- `compress`: (Opcional, predeterminado: true) Si se debe realizar extracción inteligente de código para reducir el recuento de tokens
- `includePatterns`: (Opcional) Lista separada por comas de patrones de inclusión
- `ignorePatterns`: (Opcional) Lista separada por comas de patrones de exclusión
- `remote`: (Requerido) URL del repositorio de GitHub o formato usuario/repo (ej: "yamadashy/repomix", "https://github.com/user/repo", o "https://github.com/user/repo/tree/branch")
- `compress`: (Opcional, predeterminado: false) Habilita la compresión Tree-sitter para extraer firmas de código esenciales y estructura mientras elimina detalles de implementación. Reduce el uso de tokens en ~70% manteniendo el significado semántico. Generalmente no es necesario ya que grep_repomix_output permite recuperación incremental de contenido. Úsalo solo cuando específicamente necesites el contenido completo del código base para repositorios grandes.
- `includePatterns`: (Opcional) Especifica archivos a incluir usando patrones fast-glob. Múltiples patrones pueden separarse por comas (ej: "**/*.{js,ts}", "src/**,docs/**"). Solo se procesarán archivos coincidentes.
- `ignorePatterns`: (Opcional) Especifica archivos adicionales a excluir usando patrones fast-glob. Múltiples patrones pueden separarse por comas (ej: "test/**,*.spec.js", "node_modules/**,dist/**"). Estos patrones complementan .gitignore y exclusiones integradas.
- `topFilesLength`: (Opcional, predeterminado: 10) Número de archivos más grandes por tamaño para mostrar en el resumen de métricas para análisis del código base.
**Ejemplo:**
```json
{
"remote": "yamadashy/repomix",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### read_repomix_output
Esta herramienta lee el contenido de un archivo de salida de Repomix en entornos donde no es posible el acceso directo a archivos.
Esta herramienta lee el contenido de un archivo de salida generado por Repomix. Soporta lectura parcial con especificación de rango de líneas para archivos grandes. Esta herramienta está diseñada para entornos donde el acceso directo al sistema de archivos está limitado.
**Parámetros:**
- `outputId`: (Requerido) ID del archivo de salida de Repomix para leer
- `startLine`: (Opcional) Número de línea de inicio (basado en 1, inclusivo). Si no se especifica, lee desde el principio.
- `endLine`: (Opcional) Número de línea final (basado en 1, inclusivo). Si no se especifica, lee hasta el final.
**Características:**
- Diseñado específicamente para entornos basados en web o aplicaciones en sandbox
- Recupera el contenido de salidas generadas previamente usando su ID
- Proporciona acceso seguro al código empaquetado sin requerir acceso al sistema de archivos
- Soporta lectura parcial para archivos grandes
**Ejemplo:**
```json
{
"outputId": "8f7d3b1e2a9c6054"
"outputId": "8f7d3b1e2a9c6054",
"startLine": 100,
"endLine": 200
}
```
### grep_repomix_output
Esta herramienta busca patrones en un archivo de salida de Repomix usando funcionalidad similar a grep con sintaxis JavaScript RegExp. Devuelve líneas coincidentes con líneas de contexto opcionales alrededor de las coincidencias.
**Parámetros:**
- `outputId`: (Requerido) ID del archivo de salida de Repomix para buscar
- `pattern`: (Requerido) Patrón de búsqueda (sintaxis de expresión regular JavaScript RegExp)
- `contextLines`: (Opcional, predeterminado: 0) Número de líneas de contexto para mostrar antes y después de cada coincidencia. Sobrescrito por beforeLines/afterLines si se especifica.
- `beforeLines`: (Opcional) Número de líneas de contexto para mostrar antes de cada coincidencia (como grep -B). Tiene precedencia sobre contextLines.
- `afterLines`: (Opcional) Número de líneas de contexto para mostrar después de cada coincidencia (como grep -A). Tiene precedencia sobre contextLines.
- `ignoreCase`: (Opcional, predeterminado: false) Realiza coincidencia insensible a mayúsculas y minúsculas
**Características:**
- Usa sintaxis JavaScript RegExp para coincidencia de patrones potente
- Soporta líneas de contexto para mejor comprensión de las coincidencias
- Permite control separado de líneas de contexto antes/después
- Opciones de búsqueda sensible e insensible a mayúsculas y minúsculas
**Ejemplo:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"pattern": "function\\s+\\w+\\(",
"contextLines": 3,
"ignoreCase": false
}
```
@@ -155,16 +192,20 @@ Esta herramienta lee el contenido de un archivo de salida de Repomix en entornos
El servidor MCP de Repomix proporciona dos herramientas de sistema de archivos que permiten a los asistentes de IA interactuar de manera segura con el sistema de archivos local:
1. `file_system_read_file`
- Lee contenido de archivos usando rutas absolutas
- Lee contenido de archivos del sistema de archivos local usando rutas absolutas
- Incluye validación de seguridad integrada para detectar y prevenir acceso a archivos que contienen información sensible
- Implementa validación de seguridad usando [Secretlint](https://github.com/secretlint/secretlint)
- Previene el acceso a archivos que contienen información sensible
- Previene el acceso a archivos que contienen información sensible (claves API, contraseñas, secretos)
- Valida rutas absolutas para prevenir ataques de traversal de directorios
- Devuelve mensajes de error claros para rutas inválidas y problemas de seguridad
2. `file_system_read_directory`
- Lista contenidos de directorios usando rutas absolutas
- Lista contenidos de un directorio usando una ruta absoluta
- Devuelve una lista formateada mostrando archivos y subdirectorios con indicadores claros
- Muestra archivos y directorios con indicadores claros (`[FILE]` o `[DIR]`)
- Proporciona navegación segura de directorios con manejo apropiado de errores
- Valida rutas y asegura que sean absolutas
- Útil para explorar estructura de proyectos y entender organización del código base
Ambas herramientas incorporan medidas de seguridad robustas:
- Validación de rutas absolutas para prevenir ataques de traversal de directorios

View File

@@ -91,41 +91,97 @@ En mode serveur MCP, Repomix fournit les outils suivants:
### pack_codebase
Cet outil package un répertoire de code local dans un fichier consolidé pour l'analyse par IA.
Cet outil package un répertoire de code local dans un fichier XML pour l'analyse par IA. Il analyse la structure de la base de code, extrait le contenu de code pertinent et génère un rapport complet incluant les métriques, l'arbre des fichiers et le contenu de code formaté.
**Paramètres:**
- `directory`: (Requis) Chemin absolu vers le répertoire à packager
- `compress`: (Optionnel, par défaut: true) Effectuer ou non l'extraction intelligente de code pour réduire le nombre de tokens
- `includePatterns`: (Optionnel) Liste de motifs d'inclusion séparés par des virgules
- `ignorePatterns`: (Optionnel) Liste de motifs d'exclusion séparés par des virgules
- `compress`: (Optionnel, par défaut: false) Active la compression Tree-sitter pour extraire les signatures de code essentielles et la structure tout en supprimant les détails d'implémentation. Réduit l'utilisation de tokens d'environ 70% tout en préservant la signification sémantique. Généralement non nécessaire car grep_repomix_output permet la récupération incrémentale de contenu. Utilisez uniquement lorsque vous avez spécifiquement besoin du contenu complet de la base de code pour de gros dépôts.
- `includePatterns`: (Optionnel) Spécifie les fichiers à inclure en utilisant des motifs fast-glob. Plusieurs motifs peuvent être séparés par des virgules (ex: "**/*.{js,ts}", "src/**,docs/**"). Seuls les fichiers correspondants seront traités.
- `ignorePatterns`: (Optionnel) Spécifie les fichiers supplémentaires à exclure en utilisant des motifs fast-glob. Plusieurs motifs peuvent être séparés par des virgules (ex: "test/**,*.spec.js", "node_modules/**,dist/**"). Ces motifs complètent .gitignore et les exclusions intégrées.
- `topFilesLength`: (Optionnel, par défaut: 10) Nombre de plus gros fichiers par taille à afficher dans le résumé des métriques pour l'analyse de la base de code.
**Exemple:**
```json
{
"directory": "/path/to/your/project",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### pack_remote_repository
Cet outil récupère, clone et package un dépôt GitHub dans un fichier consolidé pour l'analyse par IA.
Cet outil récupère, clone et package un dépôt GitHub dans un fichier XML pour l'analyse par IA. Il clone automatiquement le dépôt distant, analyse sa structure et génère un rapport complet.
**Paramètres:**
- `remote`: (Requis) URL du dépôt GitHub ou format utilisateur/dépôt (par exemple, yamadashy/repomix)
- `compress`: (Optionnel, par défaut: true) Effectuer ou non l'extraction intelligente de code pour réduire le nombre de tokens
- `includePatterns`: (Optionnel) Liste de motifs d'inclusion séparés par des virgules
- `ignorePatterns`: (Optionnel) Liste de motifs d'exclusion séparés par des virgules
- `remote`: (Requis) URL du dépôt GitHub ou format utilisateur/dépôt (ex: "yamadashy/repomix", "https://github.com/user/repo", ou "https://github.com/user/repo/tree/branch")
- `compress`: (Optionnel, par défaut: false) Active la compression Tree-sitter pour extraire les signatures de code essentielles et la structure tout en supprimant les détails d'implémentation. Réduit l'utilisation de tokens d'environ 70% tout en préservant la signification sémantique. Généralement non nécessaire car grep_repomix_output permet la récupération incrémentale de contenu. Utilisez uniquement lorsque vous avez spécifiquement besoin du contenu complet de la base de code pour de gros dépôts.
- `includePatterns`: (Optionnel) Spécifie les fichiers à inclure en utilisant des motifs fast-glob. Plusieurs motifs peuvent être séparés par des virgules (ex: "**/*.{js,ts}", "src/**,docs/**"). Seuls les fichiers correspondants seront traités.
- `ignorePatterns`: (Optionnel) Spécifie les fichiers supplémentaires à exclure en utilisant des motifs fast-glob. Plusieurs motifs peuvent être séparés par des virgules (ex: "test/**,*.spec.js", "node_modules/**,dist/**"). Ces motifs complètent .gitignore et les exclusions intégrées.
- `topFilesLength`: (Optionnel, par défaut: 10) Nombre de plus gros fichiers par taille à afficher dans le résumé des métriques pour l'analyse de la base de code.
**Exemple:**
```json
{
"remote": "yamadashy/repomix",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### read_repomix_output
Cet outil lit le contenu d'un fichier de sortie généré par Repomix. Il prend en charge la lecture partielle avec spécification de plage de lignes pour les gros fichiers. Cet outil est conçu pour les environnements où l'accès direct au système de fichiers est limité.
**Paramètres:**
- `outputId`: (Requis) ID du fichier de sortie Repomix à lire
- `startLine`: (Optionnel) Numéro de ligne de début (basé sur 1, inclusif). Si non spécifié, lit depuis le début.
- `endLine`: (Optionnel) Numéro de ligne de fin (basé sur 1, inclusif). Si non spécifié, lit jusqu'à la fin.
**Fonctionnalités:**
- Conçu spécifiquement pour les environnements basés sur le web ou les applications en bac à sable
- Récupère le contenu des sorties générées précédemment en utilisant leur ID
- Fournit un accès sécurisé à la base de code packagée sans nécessiter d'accès au système de fichiers
- Prend en charge la lecture partielle pour les gros fichiers
**Exemple:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"startLine": 100,
"endLine": 200
}
```
### grep_repomix_output
Cet outil recherche des motifs dans un fichier de sortie Repomix en utilisant une fonctionnalité similaire à grep avec la syntaxe JavaScript RegExp. Il retourne les lignes correspondantes avec des lignes de contexte optionnelles autour des correspondances.
**Paramètres:**
- `outputId`: (Requis) ID du fichier de sortie Repomix à rechercher
- `pattern`: (Requis) Motif de recherche (syntaxe d'expression régulière JavaScript RegExp)
- `contextLines`: (Optionnel, par défaut: 0) Nombre de lignes de contexte à afficher avant et après chaque correspondance. Remplacé par beforeLines/afterLines si spécifié.
- `beforeLines`: (Optionnel) Nombre de lignes de contexte à afficher avant chaque correspondance (comme grep -B). Priorité sur contextLines.
- `afterLines`: (Optionnel) Nombre de lignes de contexte à afficher après chaque correspondance (comme grep -A). Priorité sur contextLines.
- `ignoreCase`: (Optionnel, par défaut: false) Effectue une correspondance insensible à la casse
**Fonctionnalités:**
- Utilise la syntaxe JavaScript RegExp pour une correspondance de motifs puissante
- Prend en charge les lignes de contexte pour une meilleure compréhension des correspondances
- Permet un contrôle séparé des lignes de contexte avant/après
- Options de recherche sensible et insensible à la casse
**Exemple:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"pattern": "function\\s+\\w+\\(",
"contextLines": 3,
"ignoreCase": false
}
```
@@ -134,16 +190,20 @@ Cet outil récupère, clone et package un dépôt GitHub dans un fichier consoli
Le serveur MCP de Repomix fournit deux outils système de fichiers qui permettent aux assistants IA d'interagir en toute sécurité avec le système de fichiers local:
1. `file_system_read_file`
- Lit le contenu des fichiers en utilisant des chemins absolus
- Lit le contenu des fichiers du système de fichiers local en utilisant des chemins absolus
- Inclut une validation de sécurité intégrée pour détecter et prévenir l'accès aux fichiers contenant des informations sensibles
- Implémente la validation de sécurité avec [Secretlint](https://github.com/secretlint/secretlint)
- Empêche l'accès aux fichiers contenant des informations sensibles
- Renvoie du contenu formaté avec des messages d'erreur clairs pour les chemins invalides ou les problèmes de sécurité
- Empêche l'accès aux fichiers contenant des informations sensibles (clés API, mots de passe, secrets)
- Valide les chemins absolus pour prévenir les attaques par traversée de répertoire
- Renvoie des messages d'erreur clairs pour les chemins invalides et les problèmes de sécurité
2. `file_system_read_directory`
- Liste le contenu des répertoires en utilisant des chemins absolus
- Liste le contenu d'un répertoire en utilisant un chemin absolu
- Renvoie une liste formatée montrant les fichiers et sous-répertoires avec des indicateurs clairs
- Affiche les fichiers et répertoires avec des indicateurs clairs (`[FILE]` ou `[DIR]`)
- Fournit une traversée sécurisée des répertoires avec une gestion appropriée des erreurs
- Valide les chemins et s'assure qu'ils sont absolus
- Utile pour explorer la structure du projet et comprendre l'organisation de la base de code
Les deux outils intègrent des mesures de sécurité robustes:
- Validation des chemins absolus pour prévenir les attaques par traversée de répertoire
@@ -157,6 +217,7 @@ Les deux outils intègrent des mesures de sécurité robustes:
const fileContent = await tools.file_system_read_file({
path: '/absolute/path/to/file.txt'
});
// Liste du contenu d'un répertoire
const dirContent = await tools.file_system_read_directory({
path: '/absolute/path/to/directory'

View File

@@ -93,60 +93,97 @@ MCPサーバーとして実行すると、Repomixは以下のツールを提供
### pack_codebase
このツールはローカルのコードディレクトリをAI分析用に単一ファイルにパッケージ化します。
このツールはローカルのコードディレクトリをAI分析用のXMLファイルにパッケージ化します。コードベース構造を分析し、関連するコード内容を抽出し、メトリクス、ファイルツリー、フォーマットされたコード内容を含む包括的なレポートを生成します。
**パラメータ:**
- `directory`: (必須) パッケージ化するディレクトリの絶対パス
- `compress`: (オプション、デフォルト: true) トークン数を削減するためのインテリジェントなコード抽出を実行するかどうか
- `includePatterns`: (オプション) カンマ区切りの包含パターンリスト
- `ignorePatterns`: (オプション) カンマ区切りの除外パターンリスト
- `compress`: (オプション、デフォルト: false) 実装の詳細を削除しながら、重要なコードシグネチャと構造を抽出するTree-sitter圧縮を有効にします。セマンティックな意味を保持しながらトークン使用量を約70%削減します。grep_repomix_outputが段階的なコンテンツ取得を可能にするため、通常は不要です。大きなリポジトリのコードベース全体の内容が特に必要な場合のみ使用してください。
- `includePatterns`: (オプション) fast-globパターンを使用して含めるファイルを指定します。複数のパターンはカンマ区切りで指定できます"**/*.{js,ts}", "src/**,docs/**")。マッチするファイルのみが処理されます。
- `ignorePatterns`: (オプション) fast-globパターンを使用して除外する追加ファイルを指定します。複数のパターンはカンマ区切りで指定できます"test/**,*.spec.js", "node_modules/**,dist/**")。これらのパターンは.gitignoreと組み込み除外を補完します。
- `topFilesLength`: (オプション、デフォルト: 10) コードベース分析のメトリクス要約に表示する最大ファイル数(サイズ順)。
**例:**
```json
{
"directory": "/path/to/your/project",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### pack_remote_repository
このツールはGitHubリポジトリを取得、クローン、パッケージ化してAI分析用の単一ファイルを作成します。
このツールはGitHubリポジトリを取得、クローン、パッケージ化してAI分析用のXMLファイルを作成します。リモートリポジトリを自動的にクローンし、その構造を分析し、包括的なレポートを生成します。
**パラメータ:**
- `remote`: (必須) GitHubリポジトリURLまたはuser/repo形式yamadashy/repomix
- `compress`: (オプション、デフォルト: true) トークン数を削減するためのインテリジェントなコード抽出を実行するかどうか
- `includePatterns`: (オプション) カンマ区切りの包含パターンリスト
- `ignorePatterns`: (オプション) カンマ区切りの除外パターンリスト
- `remote`: (必須) GitHubリポジトリURLまたはuser/repo形式"yamadashy/repomix", "https://github.com/user/repo", または "https://github.com/user/repo/tree/branch"
- `compress`: (オプション、デフォルト: false) 実装の詳細を削除しながら、重要なコードシグネチャと構造を抽出するTree-sitter圧縮を有効にします。セマンティックな意味を保持しながらトークン使用量を約70%削減します。grep_repomix_outputが段階的なコンテンツ取得を可能にするため、通常は不要です。大きなリポジトリのコードベース全体の内容が特に必要な場合のみ使用してください。
- `includePatterns`: (オプション) fast-globパターンを使用して含めるファイルを指定します。複数のパターンはカンマ区切りで指定できます"**/*.{js,ts}", "src/**,docs/**")。マッチするファイルのみが処理されます。
- `ignorePatterns`: (オプション) fast-globパターンを使用して除外する追加ファイルを指定します。複数のパターンはカンマ区切りで指定できます"test/**,*.spec.js", "node_modules/**,dist/**")。これらのパターンは.gitignoreと組み込み除外を補完します。
- `topFilesLength`: (オプション、デフォルト: 10) コードベース分析のメトリクス要約に表示する最大ファイル数(サイズ順)。
**例:**
```json
{
"remote": "yamadashy/repomix",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### read_repomix_output
このツールは直接ファイルアクセスできない環境でRepomix出力ファイルの内容を読み込みます。
このツールはRepomixで生成された出力ファイルの内容を読み込みます。大きなファイルに対する行範囲指定による部分読み込みをサポートします。このツールは直接ファイルシステムアクセスが制限された環境向けに設計されています。
**パラメータ:**
- `outputId`: (必須) 読み込むRepomix出力ファイルのID
- `startLine`: (オプション) 開始行番号1ベース、包含。指定しない場合は最初から読み込みます。
- `endLine`: (オプション) 終了行番号1ベース、包含。指定しない場合は最後まで読み込みます。
**機能:**
- ウェブベース環境やサンドボックスアプリケーション向けに特別に設計
- IDを使用して以前に生成された出力の内容を取得
- ファイルシステムアクセスを必要とせずにパッケージ化されたコードベースへの安全なアクセスを提供
- 大きなファイルの部分読み込みをサポート
**例:**
```json
{
"outputId": "8f7d3b1e2a9c6054"
"outputId": "8f7d3b1e2a9c6054",
"startLine": 100,
"endLine": 200
}
```
### grep_repomix_output
このツールはJavaScript RegExp構文を使用したgrep風の機能でRepomix出力ファイル内のパターンを検索します。マッチした行の前後にオプションのコンテキスト行を含めて返します。
**パラメータ:**
- `outputId`: (必須) 検索するRepomix出力ファイルのID
- `pattern`: (必須) 検索パターンJavaScript RegExp正規表現構文
- `contextLines`: (オプション、デフォルト: 0) 各マッチの前後に表示するコンテキスト行数。beforeLines/afterLinesが指定された場合はそちらが優先されます。
- `beforeLines`: (オプション) 各マッチの前に表示するコンテキスト行数grep -Bのように。contextLinesより優先されます。
- `afterLines`: (オプション) 各マッチの後に表示するコンテキスト行数grep -Aのように。contextLinesより優先されます。
- `ignoreCase`: (オプション、デフォルト: false) 大文字小文字を区別しないマッチングを実行
**機能:**
- 強力なパターンマッチングのためのJavaScript RegExp構文を使用
- マッチの理解を深めるためのコンテキスト行をサポート
- before/afterコンテキスト行の個別制御が可能
- 大文字小文字を区別する/しない検索オプション
**例:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"pattern": "function\\s+\\w+\\(",
"contextLines": 3,
"ignoreCase": false
}
```
@@ -155,16 +192,20 @@ MCPサーバーとして実行すると、Repomixは以下のツールを提供
RepomixのMCPサーバーは、AIアシスタントがローカルファイルシステムと安全にやり取りするための2つのファイルシステムツールを提供しています
1. `file_system_read_file`
- 絶対パスを使用してファイルの内容を読み取り
- 絶対パスを使用してローカルファイルシステムからファイルの内容を読み取り
- 機密情報を含むファイルへのアクセスを検出・防止する組み込みセキュリティ検証を含む
- [Secretlint](https://github.com/secretlint/secretlint)を使用したセキュリティ検証を実装
- 機密情報を含むファイルへのアクセスを防止
- 機密情報を含むファイルAPIキー、パスワード、シークレットへのアクセスを防止
- ディレクトリトラバーサル攻撃を防ぐための絶対パス検証
- 無効なパスやセキュリティの問題に対する明確なエラーメッセージを返す
2. `file_system_read_directory`
- 絶対パスを使用してディレクトリの内容を一覧表示
- ファイルとサブディレクトリを明確な指標で示すフォーマット済みリストを返す
- ファイルとディレクトリを明確な指標(`[FILE]`または`[DIR]`)で表示
- 適切なエラー処理による安全なディレクトリ走査を提供
- パスの検証と絶対パスの確認を実施
- プロジェクト構造の探索とコードベース組織の理解に有用
両ツールは堅牢なセキュリティ対策を組み込んでいます:
- ディレクトリトラバーサル攻撃を防ぐための絶対パス検証

View File

@@ -93,60 +93,97 @@ MCP 서버로 실행할 때 Repomix는 다음 도구를 제공합니다:
### pack_codebase
이 도구는 로컬 코드 디렉토리를 AI 분석용 통합 파일로 패키징합니다.
이 도구는 로컬 코드 디렉토리를 AI 분석용 XML 파일로 패키징합니다. 코드베이스 구조를 분석하고 관련 코드 내용을 추출하여 메트릭, 파일 트리, 포맷된 코드 내용을 포함한 포괄적인 보고서를 생성합니다.
**매개변수:**
- `directory`: (필수) 패키징할 디렉토리의 절대 경로
- `compress`: (선택, 기본값: true) 토큰 수를 줄이기 위해 지능형 코드 추출을 수행할지 여부
- `includePatterns`: (선택) 쉼표로 구분된 포함 패턴 목록
- `ignorePatterns`: (선택) 쉼표로 구분된 제외 패턴 목록
- `compress`: (선택, 기본값: false) 구현 세부사항을 제거하면서 필수 코드 시그니처와 구조를 추출하는 Tree-sitter 압축을 활성화합니다. 의미론적 의미를 유지하면서 토큰 사용량을 ~70% 줄입니다. grep_repomix_output이 점진적 콘텐츠 검색을 가능하게 하므로 일반적으로 필요하지 않습니다. 대형 저장소의 전체 코드베이스 내용이 특별히 필요한 경우에만 사용하세요.
- `includePatterns`: (선택) fast-glob 패턴을 사용하여 포함할 파일을 지정합니다. 여러 패턴은 쉼표로 구분할 수 있습니다(예: "**/*.{js,ts}", "src/**,docs/**"). 일치하는 파일만 처리됩니다.
- `ignorePatterns`: (선택) fast-glob 패턴을 사용하여 제외할 추가 파일을 지정합니다. 여러 패턴은 쉼표로 구분할 수 있습니다(예: "test/**,*.spec.js", "node_modules/**,dist/**"). 이러한 패턴은 .gitignore와 내장 제외를 보완합니다.
- `topFilesLength`: (선택, 기본값: 10) 코드베이스 분석을 위한 메트릭 요약에 표시할 크기별 최대 파일 수입니다.
**예시:**
```json
{
"directory": "/path/to/your/project",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### pack_remote_repository
이 도구는 GitHub 저장소를 가져와 클론하고 AI 분석용 통합 파일로 패키징합니다.
이 도구는 GitHub 저장소를 가져와 클론하고 AI 분석용 XML 파일로 패키징합니다. 원격 저장소를 자동으로 클론하고 구조를 분석하여 포괄적인 보고서를 생성합니다.
**매개변수:**
- `remote`: (필수) GitHub 저장소 URL 또는 사용자/저장소 형식(예: yamadashy/repomix)
- `compress`: (선택, 기본값: true) 토큰 수를 줄이기 위해 지능형 코드 추출을 수행할지 여부
- `includePatterns`: (선택) 쉼표로 구분된 포함 패턴 목록
- `ignorePatterns`: (선택) 쉼표로 구분된 제외 패턴 목록
- `remote`: (필수) GitHub 저장소 URL 또는 사용자/저장소 형식(예: "yamadashy/repomix", "https://github.com/user/repo", 또는 "https://github.com/user/repo/tree/branch")
- `compress`: (선택, 기본값: false) 구현 세부사항을 제거하면서 필수 코드 시그니처와 구조를 추출하는 Tree-sitter 압축을 활성화합니다. 의미론적 의미를 유지하면서 토큰 사용량을 ~70% 줄입니다. grep_repomix_output이 점진적 콘텐츠 검색을 가능하게 하므로 일반적으로 필요하지 않습니다. 대형 저장소의 전체 코드베이스 내용이 특별히 필요한 경우에만 사용하세요.
- `includePatterns`: (선택) fast-glob 패턴을 사용하여 포함할 파일을 지정합니다. 여러 패턴은 쉼표로 구분할 수 있습니다(예: "**/*.{js,ts}", "src/**,docs/**"). 일치하는 파일만 처리됩니다.
- `ignorePatterns`: (선택) fast-glob 패턴을 사용하여 제외할 추가 파일을 지정합니다. 여러 패턴은 쉼표로 구분할 수 있습니다(예: "test/**,*.spec.js", "node_modules/**,dist/**"). 이러한 패턴은 .gitignore와 내장 제외를 보완합니다.
- `topFilesLength`: (선택, 기본값: 10) 코드베이스 분석을 위한 메트릭 요약에 표시할 크기별 최대 파일 수입니다.
**예시:**
```json
{
"remote": "yamadashy/repomix",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### read_repomix_output
이 도구는 직접 파일 접근이 불가능한 환경에서 Repomix 출력 파일의 내용을 읽습니다.
이 도구는 Repomix에서 생성된 출력 파일의 내용을 읽습니다. 대용량 파일에 대한 라인 범위 지정을 통한 부분 읽기를 지원합니다. 이 도구는 직접 파일 시스템 접근이 제한된 환경을 위해 설계되었습니다.
**매개변수:**
- `outputId`: (필수) 읽을 Repomix 출력 파일의 ID
- `startLine`: (선택) 시작 라인 번호(1부터 시작, 포함). 지정하지 않으면 처음부터 읽습니다.
- `endLine`: (선택) 끝 라인 번호(1부터 시작, 포함). 지정하지 않으면 끝까지 읽습니다.
**기능:**
- 웹 기반 환경이나 샌드박스 애플리케이션을 위해 특별히 설계됨
- ID를 사용하여 이전에 생성된 출력의 내용을 검색
- 파일 시스템 접근 없이 패키징된 코드베이스에 안전하게 접근 제공
- 대용량 파일의 부분 읽기 지원
**예시:**
```json
{
"outputId": "8f7d3b1e2a9c6054"
"outputId": "8f7d3b1e2a9c6054",
"startLine": 100,
"endLine": 200
}
```
### grep_repomix_output
이 도구는 JavaScript RegExp 구문을 사용한 grep 유사 기능으로 Repomix 출력 파일에서 패턴을 검색합니다. 일치하는 라인과 일치 항목 주변의 선택적 컨텍스트 라인을 반환합니다.
**매개변수:**
- `outputId`: (필수) 검색할 Repomix 출력 파일의 ID
- `pattern`: (필수) 검색 패턴(JavaScript RegExp 정규 표현식 구문)
- `contextLines`: (선택, 기본값: 0) 각 일치 항목 전후에 표시할 컨텍스트 라인 수. beforeLines/afterLines가 지정되면 재정의됩니다.
- `beforeLines`: (선택) 각 일치 항목 전에 표시할 컨텍스트 라인 수(grep -B와 같음). contextLines보다 우선합니다.
- `afterLines`: (선택) 각 일치 항목 후에 표시할 컨텍스트 라인 수(grep -A와 같음). contextLines보다 우선합니다.
- `ignoreCase`: (선택, 기본값: false) 대소문자를 구분하지 않는 매칭 수행
**기능:**
- 강력한 패턴 매칭을 위한 JavaScript RegExp 구문 사용
- 일치 항목의 더 나은 이해를 위한 컨텍스트 라인 지원
- 전/후 컨텍스트 라인의 별도 제어 허용
- 대소문자 구분/비구분 검색 옵션
**예시:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"pattern": "function\\s+\\w+\\(",
"contextLines": 3,
"ignoreCase": false
}
```
@@ -155,16 +192,20 @@ MCP 서버로 실행할 때 Repomix는 다음 도구를 제공합니다:
Repomix의 MCP 서버는 AI 어시스턴트가 로컬 파일 시스템과 안전하게 상호 작용할 수 있는 두 가지 파일 시스템 도구를 제공합니다:
1. `file_system_read_file`
- 절대 경로를 사용하여 파일 내용 읽기
- 절대 경로를 사용하여 로컬 파일 시스템에서 파일 내용 읽기
- 민감한 정보가 포함된 파일에 대한 접근을 감지하고 방지하는 내장 보안 검증 포함
- [Secretlint](https://github.com/secretlint/secretlint)를 사용한 보안 검증 구현
- 민감한 정보가 포함된 파일에 대한 접근 방지
- 민감한 정보가 포함된 파일(API 키, 비밀번호, 시크릿)에 대한 접근 방지
- 디렉토리 순회 공격을 방지하기 위한 절대 경로 검증
- 잘못된 경로나 보안 문제에 대한 명확한 오류 메시지 반환
2. `file_system_read_directory`
- 절대 경로를 사용하여 디렉토리 내용 나열
- 절대 경로를 사용하여 디렉토리 내용 나열
- 파일과 하위 디렉토리를 명확한 지표로 표시하는 포맷된 목록 반환
- 파일과 디렉토리를 명확한 지표(`[FILE]` 또는 `[DIR]`)로 표시
- 안전한 디렉토리 탐색과 적절한 오류 처리 제공
- 경로 검증 및 절대 경로 확인
- 프로젝트 구조 탐색과 코드베이스 조직 이해에 유용
두 도구 모두 강력한 보안 조치를 포함하고 있습니다:
- 디렉토리 순회 공격을 방지하기 위한 절대 경로 검증

View File

@@ -93,60 +93,97 @@ Quando executado como um servidor MCP, o Repomix fornece as seguintes ferramenta
### pack_codebase
Esta ferramenta empacota um diretório de código local em um arquivo consolidado para análise de IA.
Esta ferramenta empacota um diretório de código local em um arquivo XML para análise de IA. Ela analisa a estrutura da base de código, extrai conteúdo de código relevante e gera um relatório abrangente incluindo métricas, árvore de arquivos e conteúdo de código formatado.
**Parâmetros:**
- `directory`: (Obrigatório) Caminho absoluto para o diretório a ser empacotado
- `compress`: (Opcional, padrão: true) Se deve realizar extração inteligente de código para reduzir a contagem de tokens
- `includePatterns`: (Opcional) Lista separada por vírgulas de padrões de inclusão
- `ignorePatterns`: (Opcional) Lista separada por vírgulas de padrões de exclusão
- `compress`: (Opcional, padrão: false) Habilita compressão Tree-sitter para extrair assinaturas de código essenciais e estrutura enquanto remove detalhes de implementação. Reduz o uso de tokens em ~70% mantendo o significado semântico. Geralmente não é necessário já que grep_repomix_output permite recuperação incremental de conteúdo. Use apenas quando você especificamente precisar do conteúdo completo da base de código para repositórios grandes.
- `includePatterns`: (Opcional) Especifica arquivos para incluir usando padrões fast-glob. Múltiplos padrões podem ser separados por vírgula (ex: "**/*.{js,ts}", "src/**,docs/**"). Apenas arquivos correspondentes serão processados.
- `ignorePatterns`: (Opcional) Especifica arquivos adicionais para excluir usando padrões fast-glob. Múltiplos padrões podem ser separados por vírgula (ex: "test/**,*.spec.js", "node_modules/**,dist/**"). Estes padrões complementam .gitignore e exclusões integradas.
- `topFilesLength`: (Opcional, padrão: 10) Número de maiores arquivos por tamanho para exibir no resumo de métricas para análise da base de código.
**Exemplo:**
```json
{
"directory": "/path/to/your/project",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### pack_remote_repository
Esta ferramenta busca, clona e empacota um repositório GitHub em um arquivo consolidado para análise de IA.
Esta ferramenta busca, clona e empacota um repositório GitHub em um arquivo XML para análise de IA. Ela automaticamente clona o repositório remoto, analisa sua estrutura e gera um relatório abrangente.
**Parâmetros:**
- `remote`: (Obrigatório) URL do repositório GitHub ou formato usuário/repo (ex: yamadashy/repomix)
- `compress`: (Opcional, padrão: true) Se deve realizar extração inteligente de código para reduzir a contagem de tokens
- `includePatterns`: (Opcional) Lista separada por vírgulas de padrões de inclusão
- `ignorePatterns`: (Opcional) Lista separada por vírgulas de padrões de exclusão
- `remote`: (Obrigatório) URL do repositório GitHub ou formato usuário/repo (ex: "yamadashy/repomix", "https://github.com/user/repo", ou "https://github.com/user/repo/tree/branch")
- `compress`: (Opcional, padrão: false) Habilita compressão Tree-sitter para extrair assinaturas de código essenciais e estrutura enquanto remove detalhes de implementação. Reduz o uso de tokens em ~70% mantendo o significado semântico. Geralmente não é necessário já que grep_repomix_output permite recuperação incremental de conteúdo. Use apenas quando você especificamente precisar do conteúdo completo da base de código para repositórios grandes.
- `includePatterns`: (Opcional) Especifica arquivos para incluir usando padrões fast-glob. Múltiplos padrões podem ser separados por vírgula (ex: "**/*.{js,ts}", "src/**,docs/**"). Apenas arquivos correspondentes serão processados.
- `ignorePatterns`: (Opcional) Especifica arquivos adicionais para excluir usando padrões fast-glob. Múltiplos padrões podem ser separados por vírgula (ex: "test/**,*.spec.js", "node_modules/**,dist/**"). Estes padrões complementam .gitignore e exclusões integradas.
- `topFilesLength`: (Opcional, padrão: 10) Número de maiores arquivos por tamanho para exibir no resumo de métricas para análise da base de código.
**Exemplo:**
```json
{
"remote": "yamadashy/repomix",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### read_repomix_output
Esta ferramenta lê o conteúdo de um arquivo de saída do Repomix em ambientes onde o acesso direto a arquivos não é possível.
Esta ferramenta lê o conteúdo de um arquivo de saída gerado pelo Repomix. Suporta leitura parcial com especificação de intervalo de linhas para arquivos grandes. Esta ferramenta é projetada para ambientes onde o acesso direto ao sistema de arquivos é limitado.
**Parâmetros:**
- `outputId`: (Obrigatório) ID do arquivo de saída do Repomix a ser lido
- `startLine`: (Opcional) Número da linha inicial (baseado em 1, inclusivo). Se não especificado, lê desde o início.
- `endLine`: (Opcional) Número da linha final (baseado em 1, inclusivo). Se não especificado, lê até o final.
**Funcionalidades:**
- Projetado especificamente para ambientes baseados na web ou aplicações em sandbox
- Recupera o conteúdo de saídas geradas anteriormente usando seu ID
- Fornece acesso seguro à base de código empacotada sem requerer acesso ao sistema de arquivos
- Suporta leitura parcial para arquivos grandes
**Exemplo:**
```json
{
"outputId": "8f7d3b1e2a9c6054"
"outputId": "8f7d3b1e2a9c6054",
"startLine": 100,
"endLine": 200
}
```
### grep_repomix_output
Esta ferramenta busca padrões em um arquivo de saída do Repomix usando funcionalidade similar ao grep com sintaxe JavaScript RegExp. Retorna linhas correspondentes com linhas de contexto opcionais ao redor das correspondências.
**Parâmetros:**
- `outputId`: (Obrigatório) ID do arquivo de saída do Repomix para buscar
- `pattern`: (Obrigatório) Padrão de busca (sintaxe de expressão regular JavaScript RegExp)
- `contextLines`: (Opcional, padrão: 0) Número de linhas de contexto para mostrar antes e depois de cada correspondência. Sobrescrito por beforeLines/afterLines se especificado.
- `beforeLines`: (Opcional) Número de linhas de contexto para mostrar antes de cada correspondência (como grep -B). Tem precedência sobre contextLines.
- `afterLines`: (Opcional) Número de linhas de contexto para mostrar depois de cada correspondência (como grep -A). Tem precedência sobre contextLines.
- `ignoreCase`: (Opcional, padrão: false) Realizar correspondência insensível a maiúsculas e minúsculas
**Funcionalidades:**
- Usa sintaxe JavaScript RegExp para correspondência de padrões poderosa
- Suporta linhas de contexto para melhor compreensão das correspondências
- Permite controle separado de linhas de contexto antes/depois
- Opções de busca sensível e insensível a maiúsculas e minúsculas
**Exemplo:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"pattern": "function\\s+\\w+\\(",
"contextLines": 3,
"ignoreCase": false
}
```
@@ -155,16 +192,20 @@ Esta ferramenta lê o conteúdo de um arquivo de saída do Repomix em ambientes
O servidor MCP do Repomix fornece duas ferramentas de sistema de arquivos que permitem que os assistentes de IA interajam com segurança com o sistema de arquivos local:
1. `file_system_read_file`
- Lê conteúdo de arquivos usando caminhos absolutos
- Lê conteúdo de arquivos do sistema de arquivos local usando caminhos absolutos
- Inclui validação de segurança integrada para detectar e prevenir acesso a arquivos contendo informações sensíveis
- Implementa validação de segurança usando [Secretlint](https://github.com/secretlint/secretlint)
- Previne acesso a arquivos contendo informações sensíveis
- Previne acesso a arquivos contendo informações sensíveis (chaves de API, senhas, segredos)
- Valida caminhos absolutos para prevenir ataques de travessia de diretórios
- Retorna mensagens de erro claras para caminhos inválidos e problemas de segurança
2. `file_system_read_directory`
- Lista conteúdos de diretórios usando caminhos absolutos
- Lista conteúdos de um diretório usando um caminho absoluto
- Retorna uma lista formatada mostrando arquivos e subdiretórios com indicadores claros
- Mostra arquivos e diretórios com indicadores claros (`[FILE]` ou `[DIR]`)
- Fornece navegação segura de diretórios com tratamento apropriado de erros
- Valida caminhos e garante que sejam absolutos
- Útil para explorar estrutura de projetos e compreender organização da base de código
Ambas as ferramentas incorporam medidas de segurança robustas:
- Validação de caminhos absolutos para prevenir ataques de travessia de diretórios
@@ -186,7 +227,7 @@ const dirContent = await tools.file_system_read_directory({
```
Essas ferramentas são particularmente úteis quando os assistentes de IA precisam:
- Analisar arquivos específicos no código-base
- Analisar arquivos específicos na base de código
- Navegar estruturas de diretórios
- Verificar existência e acessibilidade de arquivos
- Garantir operações seguras do sistema de arquivos

View File

@@ -93,83 +93,124 @@ repomix --mcp
### pack_codebase
此工具将本地代码目录打包成一个用于 AI 分析的整合文件
此工具将本地代码目录打包成一个用于 AI 分析的 XML 文件。它分析代码库结构,提取相关代码内容,并生成包含指标、文件树和格式化代码内容的综合报告
**参数:**
- `directory`:(必需)要打包的目录的绝对路径
- `compress`:(可选,默认值:true是否执行智能代码提取以减少令牌计数
- `includePatterns`:(可选)以逗号分隔的包含模式列表
- `ignorePatterns`:(可选)以逗号分隔的忽略模式列表
- `compress`:(可选,默认值:false启用 Tree-sitter 压缩以提取基本代码签名和结构,同时删除实现细节。在保持语义含义的同时减少约 70% 的令牌使用量。由于 grep_repomix_output 允许增量内容检索,通常不需要。仅在您特别需要大型仓库的整个代码库内容时使用。
- `includePatterns`:(可选)使用 fast-glob 模式指定要包含的文件。多个模式可以用逗号分隔(例如,"**/*.{js,ts}", "src/**,docs/**")。只有匹配的文件会被处理。
- `ignorePatterns`:(可选)使用 fast-glob 模式指定要排除的其他文件。多个模式可以用逗号分隔(例如,"test/**,*.spec.js", "node_modules/**,dist/**")。这些模式补充 .gitignore 和内置排除。
- `topFilesLength`可选默认值10在代码库分析的指标摘要中显示的最大文件数按大小排序
**示例:**
```json
{
"directory": "/path/to/your/project",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### pack_remote_repository
此工具获取、克隆并将 GitHub 仓库打包成一个用于 AI 分析的整合文件
此工具获取、克隆并将 GitHub 仓库打包成一个用于 AI 分析的 XML 文件。它自动克隆远程仓库,分析其结构,并生成综合报告
**参数:**
- `remote`必需GitHub 仓库 URL 或用户/仓库格式例如yamadashy/repomix
- `compress`:(可选,默认值:true是否执行智能代码提取以减少令牌计数
- `includePatterns`:(可选)以逗号分隔的包含模式列表
- `ignorePatterns`:(可选)以逗号分隔的忽略模式列表
- `remote`必需GitHub 仓库 URL 或用户/仓库格式(例如,"yamadashy/repomix", "https://github.com/user/repo", 或 "https://github.com/user/repo/tree/branch"
- `compress`:(可选,默认值:false启用 Tree-sitter 压缩以提取基本代码签名和结构,同时删除实现细节。在保持语义含义的同时减少约 70% 的令牌使用量。由于 grep_repomix_output 允许增量内容检索,通常不需要。仅在您特别需要大型仓库的整个代码库内容时使用。
- `includePatterns`:(可选)使用 fast-glob 模式指定要包含的文件。多个模式可以用逗号分隔(例如,"**/*.{js,ts}", "src/**,docs/**")。只有匹配的文件会被处理。
- `ignorePatterns`:(可选)使用 fast-glob 模式指定要排除的其他文件。多个模式可以用逗号分隔(例如,"test/**,*.spec.js", "node_modules/**,dist/**")。这些模式补充 .gitignore 和内置排除。
- `topFilesLength`可选默认值10在代码库分析的指标摘要中显示的最大文件数按大小排序
**示例:**
```json
{
"remote": "yamadashy/repomix",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### read_repomix_output
此工具在无法直接访问文件的环境中读取Repomix输出文件的内容。
此工具读取 Repomix 生成的输出文件的内容。支持对大文件进行行范围指定的部分读取。此工具专为直接文件系统访问受限的环境而设计。
**参数:**
- `outputId`必需要读取的Repomix输出文件的ID
- `outputId`:(必需)要读取的 Repomix 输出文件的 ID
- `startLine`:(可选)起始行号(从 1 开始,包含)。如果未指定,则从开头读取。
- `endLine`:(可选)结束行号(从 1 开始,包含)。如果未指定,则读取到末尾。
**功能:**
- 专为基于Web的环境或沙箱应用程序设计
- 使用其ID检索先前生成的输出内容
- 专为基于 Web 的环境或沙箱应用程序设计
- 使用其 ID 检索先前生成的输出内容
- 无需文件系统访问权限即可安全访问打包的代码库
- 支持大文件的部分读取
**示例:**
```json
{
"outputId": "8f7d3b1e2a9c6054"
"outputId": "8f7d3b1e2a9c6054",
"startLine": 100,
"endLine": 200
}
```
### grep_repomix_output
此工具使用 JavaScript RegExp 语法的类似 grep 的功能在 Repomix 输出文件中搜索模式。返回匹配行及其周围的可选上下文行。
**参数:**
- `outputId`:(必需)要搜索的 Repomix 输出文件的 ID
- `pattern`必需搜索模式JavaScript RegExp 正则表达式语法)
- `contextLines`可选默认值0在每个匹配项前后显示的上下文行数。如果指定了 beforeLines/afterLines则被覆盖。
- `beforeLines`:(可选)在每个匹配项前显示的上下文行数(类似 grep -B。优先于 contextLines。
- `afterLines`:(可选)在每个匹配项后显示的上下文行数(类似 grep -A。优先于 contextLines。
- `ignoreCase`可选默认值false执行不区分大小写的匹配
**功能:**
- 使用 JavaScript RegExp 语法进行强大的模式匹配
- 支持上下文行以更好地理解匹配
- 允许单独控制前/后上下文行
- 区分大小写和不区分大小写的搜索选项
**示例:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"pattern": "function\\s+\\w+\\(",
"contextLines": 3,
"ignoreCase": false
}
```
### file_system_read_file 和 file_system_read_directory
RepomixMCP服务器提供了两个文件系统工具允许AI助手安全地与本地文件系统交互
RepomixMCP 服务器提供了两个文件系统工具,允许 AI 助手安全地与本地文件系统交互:
1. `file_system_read_file`
- 使用绝对路径读取文件内容
- 使用[Secretlint](https://github.com/secretlint/secretlint)实现安全验证
- 防止访问包含敏感信息的文件
- 使用绝对路径从本地文件系统读取文件内容
- 包含内置安全验证以检测和防止访问包含敏感信息的文件
- 使用 [Secretlint](https://github.com/secretlint/secretlint) 实现安全验证
- 防止访问包含敏感信息的文件API 密钥、密码、机密)
- 验证绝对路径以防止目录遍历攻击
- 对无效路径和安全问题返回清晰的错误消息
2. `file_system_read_directory`
- 使用绝对路径列出目录内容
- 使用清晰的指示符(`[FILE]`或`[DIR]`显示文件和目录
- 使用绝对路径列出目录内容
- 返回显示文件和目录的格式化列表,带有清晰的指示符
- 使用清晰的指示符(`[FILE]` 或 `[DIR]`)显示文件和目录
- 提供安全的目录遍历和适当的错误处理
- 验证路径并确保使用绝对路径
- 对探索项目结构和理解代码库组织很有用
这两个工具都包含了强大的安全措施:
- 绝对路径验证以防止目录遍历攻击
- 权限检查以确保适当的访问权限
- 与Secretlint集成以检测敏感信息
- 与 Secretlint 集成以检测敏感信息
- 清晰的错误消息以便于调试和安全意识
**示例:**
@@ -185,7 +226,7 @@ const dirContent = await tools.file_system_read_directory({
});
```
这些工具在AI助手需要执行以下操作时特别有用
这些工具在 AI 助手需要执行以下操作时特别有用:
- 分析代码库中的特定文件
- 导航目录结构
- 验证文件存在性和可访问性

View File

@@ -93,30 +93,152 @@ repomix --mcp
### pack_codebase
此工具將本地程式碼目錄打包成一個用於 AI 分析的整合文件
此工具將本地程式碼目錄打包成一個用於 AI 分析的 XML 文件。它分析程式碼庫結構,提取相關程式碼內容,並生成包含指標、文件樹和格式化程式碼內容的綜合報告
**參數:**
- `directory`:(必需)要打包的目錄的絕對路徑
- `compress`:(可選,預設值:true是否執行智能程式碼提取以減少令牌計數
- `includePatterns`:(可選)以逗號分隔的包含模式列表
- `ignorePatterns`:(可選)以逗號分隔的忽略模式列表
- `compress`:(可選,預設值:false啟用 Tree-sitter 壓縮以提取基本程式碼簽名和結構,同時刪除實現細節。在保持語義含義的同時減少約 70% 的令牌使用量。由於 grep_repomix_output 允許增量內容檢索,通常不需要。僅在您特別需要大型倉庫的整個程式碼庫內容時使用。
- `includePatterns`:(可選)使用 fast-glob 模式指定要包含的文件。多個模式可以用逗號分隔(例如,"**/*.{js,ts}", "src/**,docs/**")。只有匹配的文件會被處理。
- `ignorePatterns`:(可選)使用 fast-glob 模式指定要排除的其他文件。多個模式可以用逗號分隔(例如,"test/**,*.spec.js", "node_modules/**,dist/**")。這些模式補充 .gitignore 和內建排除。
- `topFilesLength`可選預設值10在程式碼庫分析的指標摘要中顯示的最大文件數按大小排序
**示例:**
```json
{
"directory": "/path/to/your/project",
"compress": true,
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/"
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### pack_remote_repository
此工具獲取、克隆並將 GitHub 倉庫打包成一個用於 AI 分析的整合文件
此工具獲取、克隆並將 GitHub 倉庫打包成一個用於 AI 分析的 XML 文件。它自動克隆遠端倉庫,分析其結構,並生成綜合報告
**參數:**
- `remote`必需GitHub 倉庫 URL 或用戶/倉庫格式例如yamadashy/repomix
- `compress`:(可選,預設值:true是否執行智能程式碼提取以減少令牌計數
- `includePatterns`:(可選)以逗號分隔的包含模式列表
- `ignorePatterns`:(可選)以逗號分隔的忽略模式列表
- `remote`必需GitHub 倉庫 URL 或用戶/倉庫格式(例如,"yamadashy/repomix", "https://github.com/user/repo", 或 "https://github.com/user/repo/tree/branch"
- `compress`:(可選,預設值:false啟用 Tree-sitter 壓縮以提取基本程式碼簽名和結構,同時刪除實現細節。在保持語義含義的同時減少約 70% 的令牌使用量。由於 grep_repomix_output 允許增量內容檢索,通常不需要。僅在您特別需要大型倉庫的整個程式碼庫內容時使用。
- `includePatterns`:(可選)使用 fast-glob 模式指定要包含的文件。多個模式可以用逗號分隔(例如,"**/*.{js,ts}", "src/**,docs/**")。只有匹配的文件會被處理。
- `ignorePatterns`:(可選)使用 fast-glob 模式指定要排除的其他文件。多個模式可以用逗號分隔(例如,"test/**,*.spec.js", "node_modules/**,dist/**")。這些模式補充 .gitignore 和內建排除。
- `topFilesLength`可選預設值10在程式碼庫分析的指標摘要中顯示的最大文件數按大小排序
**示例:**
```json
{
"remote": "yamadashy/repomix",
"compress": false,
"includePatterns": "src/**/*.ts,**/*.md",
"ignorePatterns": "**/*.log,tmp/",
"topFilesLength": 10
}
```
### read_repomix_output
此工具讀取 Repomix 生成的輸出文件的內容。支援對大文件進行行範圍指定的部分讀取。此工具專為直接文件系統存取受限的環境而設計。
**參數:**
- `outputId`:(必需)要讀取的 Repomix 輸出文件的 ID
- `startLine`:(可選)起始行號(從 1 開始,包含)。如果未指定,則從開頭讀取。
- `endLine`:(可選)結束行號(從 1 開始,包含)。如果未指定,則讀取到末尾。
**功能:**
- 專為基於 Web 的環境或沙箱應用程式設計
- 使用其 ID 檢索先前生成的輸出內容
- 無需文件系統存取權限即可安全存取打包的程式碼庫
- 支援大文件的部分讀取
**示例:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"startLine": 100,
"endLine": 200
}
```
### grep_repomix_output
此工具使用 JavaScript RegExp 語法的類似 grep 的功能在 Repomix 輸出文件中搜尋模式。返回匹配行及其周圍的可選上下文行。
**參數:**
- `outputId`:(必需)要搜尋的 Repomix 輸出文件的 ID
- `pattern`必需搜尋模式JavaScript RegExp 正規表達式語法)
- `contextLines`可選預設值0在每個匹配項前後顯示的上下文行數。如果指定了 beforeLines/afterLines則被覆蓋。
- `beforeLines`:(可選)在每個匹配項前顯示的上下文行數(類似 grep -B。優先於 contextLines。
- `afterLines`:(可選)在每個匹配項後顯示的上下文行數(類似 grep -A。優先於 contextLines。
- `ignoreCase`可選預設值false執行不區分大小寫的匹配
**功能:**
- 使用 JavaScript RegExp 語法進行強大的模式匹配
- 支援上下文行以更好地理解匹配
- 允許單獨控制前/後上下文行
- 區分大小寫和不區分大小寫的搜尋選項
**示例:**
```json
{
"outputId": "8f7d3b1e2a9c6054",
"pattern": "function\\s+\\w+\\(",
"contextLines": 3,
"ignoreCase": false
}
```
### file_system_read_file 和 file_system_read_directory
Repomix 的 MCP 伺服器提供了兩個文件系統工具,允許 AI 助手安全地與本地文件系統交互:
1. `file_system_read_file`
- 使用絕對路徑從本地文件系統讀取文件內容
- 包含內建安全驗證以檢測和防止存取包含敏感資訊的文件
- 使用 [Secretlint](https://github.com/secretlint/secretlint) 實現安全驗證
- 防止存取包含敏感資訊的文件API 金鑰、密碼、機密)
- 驗證絕對路徑以防止目錄遍歷攻擊
- 對無效路徑和安全問題返回清晰的錯誤訊息
2. `file_system_read_directory`
- 使用絕對路徑列出目錄的內容
- 返回顯示文件和子目錄的格式化列表,帶有清晰的指示符
- 使用清晰的指示符(`[FILE]` 或 `[DIR]`)顯示文件和目錄
- 提供安全的目錄遍歷和適當的錯誤處理
- 驗證路徑並確保使用絕對路徑
- 對探索專案結構和理解程式碼庫組織很有用
這兩個工具都包含了強大的安全措施:
- 絕對路徑驗證以防止目錄遍歷攻擊
- 權限檢查以確保適當的存取權限
- 與 Secretlint 整合以檢測敏感資訊
- 清晰的錯誤訊息以便於除錯和安全意識
**示例:**
```typescript
// 讀取文件
const fileContent = await tools.file_system_read_file({
path: '/absolute/path/to/file.txt'
});
// 列出目錄內容
const dirContent = await tools.file_system_read_directory({
path: '/absolute/path/to/directory'
});
```
這些工具在 AI 助手需要執行以下操作時特別有用:
- 分析程式碼庫中的特定文件
- 導航目錄結構
- 驗證文件存在性和可存取性
- 確保安全的文件系統操作
## 將 Repomix 作為 MCP 伺服器使用的好處
將 Repomix 作為 MCP 伺服器使用提供了幾個優勢:
1. **直接整合**AI 助手可以直接分析您的程式碼庫,無需手動文件準備。
2. **高效工作流程**:通過消除手動生成和上傳文件的需求,簡化了程式碼分析過程。
3. **一致輸出**:確保 AI 助手以一致、最佳化的格式接收程式碼庫。
4. **進階功能**:利用 Repomix 的所有功能,如程式碼壓縮、令牌計數和安全檢查。
配置完成後,您的 AI 助手可以直接使用 Repomix 的功能來分析程式碼庫,使程式碼分析工作流程更加高效。