knip-mcp-server
Version:
MCP server for knip.dev integration to help AI agents identify and clean up unused code
32 lines • 1.04 kB
JavaScript
export function createKnipGetUnusedFilesTool(knipClient, config) {
return {
name: 'knip_get_unused_files',
description: 'Get a list of unused files in the project',
inputSchema: {
type: 'object',
properties: {
workspace: {
type: 'string',
description: 'Specific workspace to analyze (for monorepo setups)',
},
},
},
execute: async (args) => {
try {
const unusedFiles = await knipClient.getUnusedFiles(args.workspace);
return {
success: true,
unusedFiles,
count: unusedFiles.length,
};
}
catch (error) {
return {
success: false,
error: error instanceof Error ? error.message : String(error),
};
}
},
};
}
//# sourceMappingURL=knip-get-unused-files.js.map