knip-mcp-server
Version:
MCP server for knip.dev integration to help AI agents identify and clean up unused code
31 lines • 1.24 kB
TypeScript
export interface KnipResult {
files?: string[];
exports?: Record<string, string[]>;
imports?: Record<string, string[]>;
dependencies?: string[];
devDependencies?: string[];
}
export declare class KnipClient {
private projectRoot;
private knipConfigPath?;
constructor(projectRoot: string, knipConfigPath?: string);
private buildKnipCommand;
scan(options?: {
includePaths?: string[];
excludePaths?: string[];
workspace?: string;
dryRun?: boolean;
}): Promise<KnipResult>;
getUnusedFiles(workspace?: string): Promise<string[]>;
getUnusedExports(filePath?: string, workspace?: string): Promise<Record<string, string[]>>;
getUnusedImports(filePath?: string, workspace?: string): Promise<Record<string, string[]>>;
getUnusedDependencies(type?: 'dependencies' | 'devDependencies' | 'all', workspace?: string): Promise<string[]>;
getConfig(): Promise<any>;
validateConfig(configPath?: string): Promise<{
valid: boolean;
errors?: string[];
}>;
removeUnusedFiles(files: string[], options?: any): Promise<any>;
removeUnusedImports(filePath: string, options?: any): Promise<any>;
}
//# sourceMappingURL=knip-client.d.ts.map