JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 121
  • Score
    100M100P100Q76693F
  • License MIT

A code indexing system accessible via MCP (Model Context Protocol)

Package Exports

  • code-graph-mcp
  • code-graph-mcp/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (code-graph-mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Code Graph MCP Server

A code indexing system that creates searchable code graphs accessible via MCP (Model Context Protocol) for LLM consumption.

Features

  • 🔍 Semantic Code Search - Search across multiple repositories with context
  • 📊 Code Graph Analysis - Understand relationships between functions, classes, and modules
  • 🚀 Fast Indexing - Targeted repository indexing for relevant codebases only
  • 🔌 MCP Integration - Direct LLM access via Model Context Protocol
  • 🛠️ Multi-Language Support - TypeScript, JavaScript, Python, Go, Rust, Java via Tree-sitter
  • 📱 Cross-Platform - Works on Windows, macOS, and Linux

Quick Start

Installation

npx code-graph-mcp

Setup

  1. Configure Repositories: Edit config/repos.json to specify which repositories to index:
{
  "repositories": [
    {
      "url": "https://github.com/your-org/your-repo",
      "name": "your-repo",
      "priority": "high"
    }
  ]
}
  1. Index Repositories (automatically syncs and indexes):
npx code-graph-mcp index
  1. Start MCP Server:
npx code-graph-mcp start

Architecture

Core Components

  • Repository Manager - Clone and manage repositories from config list
  • Code Parser - Extract symbols, AST, relationships using tree-sitter
  • Graph Database - Store code relationships in SQLite
  • Search Engine - Semantic and structural code search
  • MCP Server - Protocol interface for LLM access
  • CLI Interface - Management and configuration tools

MCP Tools Available

  • search_code - Semantic code search across repositories
  • find_references - Find symbol usage and references
  • get_call_graph - Trace function calls and dependencies
  • analyze_dependencies - File/module dependency analysis
  • get_symbol_info - Symbol definitions and documentation
  • explore_codebase - High-level structure analysis

Configuration

Repository Configuration

The config/repos.json file defines which repositories to index:

{
  "repositories": [
    {
      "url": "https://github.com/microsoft/vscode",
      "name": "vscode",
      "priority": "high",
      "branch": "main",
      "include": ["src/**/*.ts"],
      "exclude": ["node_modules/**", "**/*.test.*"]
    }
  ],
  "settings": {
    "maxFileSize": "1MB",
    "indexBinaryFiles": false,
    "languages": ["typescript", "javascript", "python"],
    "updateInterval": "1h"
  }
}

Development

Build

npm run build

Development Mode

npm run dev

Testing

npm test

Maintenance

Maintained by Kynlo Akari.

License

MIT