gitingest-mcp
Version:
MCP server for transforming Git repositories into LLM-friendly text digests
69 lines (68 loc) • 2.21 kB
TypeScript
import { z } from 'zod';
export declare const ingestSchema: z.ZodObject<{
repository: z.ZodString;
source: z.ZodOptional<z.ZodEnum<{
github: "github";
gitlab: "gitlab";
bitbucket: "bitbucket";
local: "local";
git: "git";
}>>;
branch: z.ZodOptional<z.ZodString>;
commit: z.ZodOptional<z.ZodString>;
tag: z.ZodOptional<z.ZodString>;
subpath: z.ZodOptional<z.ZodString>;
cloneDepth: z.ZodDefault<z.ZodNumber>;
sparseCheckout: z.ZodDefault<z.ZodBoolean>;
includeSubmodules: z.ZodDefault<z.ZodBoolean>;
includeGitignored: z.ZodDefault<z.ZodBoolean>;
useGitignore: z.ZodDefault<z.ZodBoolean>;
useGitingestignore: z.ZodDefault<z.ZodBoolean>;
excludePatterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
includePatterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
maxFileSize: z.ZodOptional<z.ZodNumber>;
maxFiles: z.ZodDefault<z.ZodNumber>;
maxTotalSize: z.ZodDefault<z.ZodNumber>;
maxTokens: z.ZodOptional<z.ZodNumber>;
token: z.ZodOptional<z.ZodString>;
maxRetries: z.ZodDefault<z.ZodNumber>;
retryDelay: z.ZodDefault<z.ZodNumber>;
timeout: z.ZodDefault<z.ZodNumber>;
signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
}, z.core.$strip>;
export type IngestInput = z.infer<typeof ingestSchema>;
export interface RepositoryFile {
path: string;
content: string;
size: number;
type: 'file' | 'directory' | 'symlink';
}
export interface TreeNode {
name: string;
type: 'file' | 'directory';
size?: number;
children?: TreeNode[];
}
export interface RepositorySummary {
url: string;
source: string;
branch: string;
commit: string;
fileCount: number;
directoryCount: number;
totalSize: number;
tokenCount: number;
createdAt: string;
}
/**
* Main function to ingest a Git repository and transform it into an LLM-friendly text digest
* @param input - Ingest input parameters
* @returns Object containing summary, tree structure, and file contents
*/
export declare function ingestTool(input: IngestInput): Promise<{
content: Array<{
type: 'text';
text: string;
}>;
isError?: boolean;
}>;