ts-project-indexer-mcp
Version:
A powerful MCP (Model Context Protocol) server that indexes and analyzes TypeScript/JavaScript projects, providing intelligent code exploration, dependency tracking, method discovery, and project structure analysis for AI assistants and development tools.
36 lines • 1.45 kB
JavaScript
export async function debugDependenciesTool(indexer, args) {
const { limit = 20, filterBy } = args;
const allDependencies = indexer.getAllDependencies();
let filteredDeps = allDependencies;
if (filterBy) {
filteredDeps = allDependencies.filter(dep => dep.to.includes(filterBy) ||
dep.from.includes(filterBy) ||
(dep.resolvedTo && dep.resolvedTo.includes(filterBy)));
}
const limitedDeps = filteredDeps.slice(0, limit);
return {
content: [
{
type: 'text',
text: JSON.stringify({
success: true,
result: {
totalDependencies: allDependencies.length,
filteredCount: filteredDeps.length,
showing: limitedDeps.length,
dependencies: limitedDeps.map(dep => ({
from: dep.from,
to: dep.to,
resolvedTo: dep.resolvedTo,
type: dep.type,
line: dep.line,
file: dep.file
}))
},
message: `Showing ${limitedDeps.length} dependencies ${filterBy ? `filtered by "${filterBy}"` : ''}`
}, null, 2),
},
],
};
}
//# sourceMappingURL=debug-dependencies.js.map