Features: - Implemented SourceCodeIndexer class for indexing TypeScript/JavaScript source files - Chunks large files into 200-line segments with 20-line overlap - Extracts imports, exports, and metadata - Generates semantic embeddings using Xenova/all-MiniLM-L6-v2 - Creates GitHub URLs with line numbers for easy navigation - Enhanced LanceDBSearch with source code search capabilities - Added searchSourceCode() method for semantic source code search - Added getSourceFile() method for retrieving specific files or line ranges - Supports package filtering and configurable table names - Fixed score calculation to ensure values between 0-100% - Added two new MCP tools - search_babylon_source: Search Babylon.js source code with semantic search - get_babylon_source: Retrieve full source files or specific line ranges - Both tools include comprehensive error handling and JSON responses - Created indexing and testing scripts - scripts/index-source.ts: Production script for indexing all packages - scripts/test-source-indexing.ts: Test script for core package only - scripts/test-source-search.ts: Test script for search functionality - Updated package.json with comprehensive indexing commands - npm run index:docs - Index documentation only - npm run index:api - Index API documentation only - npm run index:source - Index source code only - npm run index:all - Master script to index everything - Created comprehensive README.md - Complete setup and installation instructions - Claude Desktop integration guide with configuration examples - Documentation of all 5 MCP tools with parameters and examples - Project structure, development commands, and troubleshooting guide - Architecture overview and disk space requirements Testing: - All 118 tests passing - TypeScript compilation successful - Source code search verified with real queries - Successfully indexed 1,561 files into 5,650 searchable chunks 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
51 lines
1.4 KiB
JSON
51 lines
1.4 KiB
JSON
{
|
|
"name": "babylon-mcp",
|
|
"version": "1.0.0",
|
|
"type": "module",
|
|
"main": "dist/index.js",
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"start": "node dist/mcp/index.js",
|
|
"dev": "tsx watch src/mcp/index.ts",
|
|
"clean": "rm -rf dist",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest",
|
|
"test:ui": "vitest --ui",
|
|
"test:run": "vitest run",
|
|
"test:coverage": "vitest run --coverage",
|
|
"index:docs": "tsx scripts/index-docs.ts",
|
|
"index:api": "tsx scripts/index-api.ts",
|
|
"index:source": "tsx scripts/index-source.ts",
|
|
"index:all": "npm run index:docs && npm run index:api && npm run index:source",
|
|
"index-docs": "npm run index:docs",
|
|
"index-api": "npm run index:api",
|
|
"index-source": "npm run index:source"
|
|
},
|
|
"keywords": [],
|
|
"author": "",
|
|
"license": "ISC",
|
|
"description": "",
|
|
"dependencies": {
|
|
"@lancedb/lancedb": "^0.22.3",
|
|
"@modelcontextprotocol/sdk": "^1.22.0",
|
|
"@xenova/transformers": "^2.17.2",
|
|
"express": "^5.1.0",
|
|
"gray-matter": "^4.0.3",
|
|
"simple-git": "^3.30.0",
|
|
"zod": "^3.25.76"
|
|
},
|
|
"devDependencies": {
|
|
"@types/express": "^5.0.5",
|
|
"@types/node": "^24.10.1",
|
|
"@types/supertest": "^6.0.3",
|
|
"@vitest/coverage-v8": "^4.0.13",
|
|
"nodemon": "^3.1.11",
|
|
"supertest": "^7.1.4",
|
|
"ts-node": "^10.9.2",
|
|
"tsx": "^4.20.6",
|
|
"typedoc": "^0.28.14",
|
|
"typescript": "^5.9.3",
|
|
"vitest": "^4.0.13"
|
|
}
|
|
}
|