Home / Type/ ZipOptions Type — mcp Architecture

ZipOptions Type — mcp Architecture

Architecture documentation for the ZipOptions type/interface in zip-repository.ts from the mcp codebase.

Entity Profile

Dependency Diagram

graph TD
  edd355c9_0b41_8de8_063a_3f09fe890315["ZipOptions"]
  b00e0b6e_8e66_44d2_f709_c8c6bbb476c9["zip-repository.ts"]
  edd355c9_0b41_8de8_063a_3f09fe890315 -->|defined in| b00e0b6e_8e66_44d2_f709_c8c6bbb476c9
  style edd355c9_0b41_8de8_063a_3f09fe890315 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/utils/zip-repository.ts lines 101–154

export interface ZipOptions {
  /** Maximum ZIP size in bytes (default: 500MB) */
  maxSizeBytes?: number;

  /** Custom patterns to exclude (in addition to standard exclusions) */
  additionalExclusions?: string[];

  /**
   * Whether to include .gitignore files in the ZIP archive (default: true)
   *
   * Set to false to exclude all .gitignore files from the archive.
   * This can be useful for:
   * - Reducing archive size when .gitignore files are not needed for analysis
   * - Security: preventing exposure of ignore patterns that might reveal project structure
   *
   * Note: This only controls whether .gitignore files themselves are included.
   * The patterns defined in .gitignore files are always respected regardless of this setting.
   *
   * Default: true (maintains backward compatibility)
   */
  includeGitignore?: boolean;

  /**
   * Optional callback to track progress during ZIP creation.
   * Called approximately every 100 files (configurable via progressInterval).
   *
   * @param stats - Progress statistics
   * @param stats.filesProcessed - Number of files added to archive so far
   * @param stats.currentFile - Path of the current file being processed (relative to repository root)
   * @param stats.bytesProcessed - Total bytes processed across all files
   *
   * @example
   * ```typescript
   * await zipRepository('/path/to/repo', {
   *   onProgress: (stats) => {
   *     console.log(`Processed ${stats.filesProcessed} files (${formatBytes(stats.bytesProcessed)})`);
   *     console.log(`Current file: ${stats.currentFile}`);
   *   }
   * });
   * ```
   */
  onProgress?: (stats: {
    filesProcessed: number;
    currentFile: string;
    bytesProcessed: number;
  }) => void;

  /**
   * Number of files to process between progress callbacks (default: 100).
   * Lower values provide more frequent updates but with slight overhead.
   * Only used when onProgress is provided.
   */
  progressInterval?: number;
}

Frequently Asked Questions

What is the ZipOptions type?
ZipOptions is a type/interface in the mcp codebase, defined in src/utils/zip-repository.ts.
Where is ZipOptions defined?
ZipOptions is defined in src/utils/zip-repository.ts at line 101.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free