UNPKG

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.

34 lines 1.17 kB
export class PathsResource { indexer; constructor(indexer) { this.indexer = indexer; } async read() { const paths = this.indexer.getAllPaths(); const stats = this.indexer.getProjectStats(); const pathsByMethod = paths.reduce((acc, path) => { if (!acc[path.method]) acc[path.method] = []; acc[path.method].push(path); return acc; }, {}); return { contents: [ { uri: 'project://paths', mimeType: 'application/json', text: JSON.stringify({ summary: { totalPaths: paths.length, pathsByMethod: Object.fromEntries(Object.entries(pathsByMethod).map(([method, items]) => [method, items.length])), lastIndexed: stats.lastIndexed, }, pathsByMethod, allPaths: paths, }, null, 2), }, ], }; } } //# sourceMappingURL=paths-resource.js.map