Open Source Project of the Day (Part 44): GitNexus - Zero-Server Code Intelligence Engine for Building Codebase Knowledge Graphs for AI Agents

A deep dive into GitNexus, a zero-server code intelligence engine that runs entirely in your browser, creating knowledge graphs and providing deep codebase awareness to AI agents like Cursor, Claude Code, and Windsurf through the MCP protocol

·10 min read·AI Tools

Introduction

"Building nervous system for agent context. Indexes any codebase into a knowledge graph — every dependency, call chain, cluster, and execution flow — then exposes it through smart tools so AI agents never miss code."

This is Part 44 of the "Open Source Project of the Day" series. Today we explore GitNexus (GitHub).

Traditional AI code assistants like Cursor, Claude Code, and Windsurf are powerful — but they don't truly know your codebase structure. When AI edits UserService.validate(), it doesn't know that 47 functions depend on its return type, resulting in breaking changes being shipped. GitNexus is a zero-server code intelligence engine that indexes any codebase into a knowledge graph — every dependency, call chain, cluster, and execution flow — then exposes it through smart tools so AI agents never miss code. It supports CLI + MCP mode (local indexing, connecting AI agents via MCP) and Web UI mode (graph explorer and AI chat in browser), running entirely client-side with no server — your code never leaves your machine or browser.

Why is it worth exploring?

  • 🧠 Knowledge Graph Indexing: Converts codebases into complete knowledge graphs tracking every dependency, call chain, cluster, and execution flow
  • 🔧 MCP Integration: Provides deep codebase awareness to Cursor, Claude Code, Windsurf, and OpenCode via MCP protocol
  • 🚀 Precomputed Intelligence: Precomputes structure at index time (clustering, tracing, scoring) — tools return complete context in one call
  • 🔒 Fully Local: CLI mode runs entirely locally, Web UI runs entirely in browser — code never leaves your machine
  • 🌐 Multi-Language Support: Supports TypeScript, JavaScript, Python, Java, Kotlin, C, C++, C#, Go, Rust, PHP, Swift
  • 📊 Smart Tools: Provides 7 MCP tools (impact, query, context, detect_changes, rename, cypher, etc.)

What You'll Learn

  • GitNexus's core positioning: How to build codebase knowledge graphs for AI agents
  • CLI + MCP mode: Local repository indexing, connecting AI agents via MCP
  • Web UI mode: Graph explorer and AI chat in browser
  • Smart tools: Impact analysis, process-grouped search, 360-degree context, etc.
  • Technical architecture: Implementation principles of KuzuDB, Tree-sitter, Graph RAG
  • Difference from traditional Graph RAG: Precomputed intelligence vs. traditional methods

Prerequisites

  • Understanding of AI code assistants basics (Cursor, Claude Code, Windsurf)
  • Understanding of MCP (Model Context Protocol) basics
  • Understanding of knowledge graphs basics (nodes, edges, relationships)
  • Understanding of code analysis basics (AST, dependency resolution, call chains)

Project Background

Project Overview

GitNexus is a zero-server code intelligence engine designed to solve the problem that AI code assistants don't understand codebase structure. Traditional AI code assistants are powerful but lack deep understanding of codebases:

Problem Scenario:

  1. AI edits UserService.validate()
  2. Doesn't know 47 functions depend on its return type
  3. Breaking changes ship

GitNexus Solution:

  • Knowledge Graph Indexing: Converts codebases into complete knowledge graphs tracking every dependency, call chain, cluster, and execution flow
  • Precomputed Intelligence: Precomputes structure at index time (clustering, tracing, scoring) — tools return complete context in one call
  • MCP Integration: Provides deep codebase awareness to AI agents via MCP protocol

Core Value:

  1. Reliability — LLM can't miss context, it's already in the tool response
  2. Token Efficiency — No 10-query chains to understand one function
  3. Model Democratization — Smaller LLMs work because tools do the heavy lifting

Author/Team Introduction

GitNexus is developed by abhigyanpatwari and is an active open source project.

  • Author: abhigyanpatwari
  • Background: Innovator in code intelligence and AI agent fields
  • Project Creation Time: 2024

Project Statistics

  • GitHub Stars: 10,800
  • 🍴 Forks: 1,300
  • 📦 Version: v1.3.10 (continuously updated)
  • 📄 License: PolyForm Noncommercial
  • 🌐 Official Website: gitnexus.vercel.app

Project Characteristics:

  • Zero Server: Runs entirely client-side, no server needed
  • Open Source and Free: Code is open source, free to use and modify
  • Active Maintenance: Continuously updated with active community

Main Features

Core Functionality

GitNexus's core function is to build codebase knowledge graphs for AI agents, providing deep codebase awareness through smart tools:

  1. Knowledge Graph Indexing: Converts codebases into complete knowledge graphs
  2. MCP Integration: Provides tools and resources to AI agents via MCP protocol
  3. Smart Tools: Provides 7 MCP tools that return complete context in one call
  4. Precomputed Intelligence: Precomputes structure at index time to avoid multiple queries
  5. Multi-Repo Support: Supports indexing multiple repositories with global registry management

Use Cases

  1. Daily Development

    • Integrates with Cursor, Claude Code, Windsurf to provide deep codebase awareness
    • Avoids breaking changes and improves code quality
  2. Code Exploration

    • Quickly explore unfamiliar codebases
    • Understand codebase architecture and dependencies
  3. Impact Analysis

    • Analyze impact scope before modifying code
    • Identify functions and modules that may be affected
  4. Refactoring Planning

    • Plan safe refactoring using dependency mapping
    • Identify refactoring impact scope
  5. Debugging and Tracing

    • Trace bugs through call chains
    • Understand code execution flows

Quick Start

CLI + MCP Mode (Recommended)

# Index your repo (run from repo root)
npx gitnexus analyze

That's it. This indexes the codebase, installs agent skills, registers Claude Code hooks, and creates AGENTS.md / CLAUDE.md context files — all in one command.

Configure MCP

# Auto-detect editors and configure MCP (run once)
npx gitnexus setup

Web UI Mode

Visit gitnexus.vercel.app, drag & drop a ZIP and start exploring.

Or run locally:

git clone https://github.com/abhigyanpatwari/gitnexus.git
cd gitnexus/gitnexus-web
npm install
npm run dev

Core Features

  1. Two Usage Modes

    • CLI + MCP: Local indexing, connecting AI agents via MCP (recommended for daily development)
    • Web UI: Graph explorer and AI chat in browser (suitable for quick exploration)
  2. Editor Integration

    • Claude Code: Full support (MCP + skills + hooks)
    • Cursor: MCP + skills support
    • Windsurf: MCP support
    • OpenCode: MCP + skills support
  3. 7 MCP Tools

    • list_repos: Discover all indexed repositories
    • query: Hybrid search (BM25 + semantic + RRF)
    • context: 360-degree symbol view
    • impact: Blast radius analysis
    • detect_changes: Git-diff impact analysis
    • rename: Multi-file coordinated rename
    • cypher: Raw Cypher graph queries
  4. Resource System

    • gitnexus://repos: List all indexed repositories
    • gitnexus://repo/{name}/context: Codebase stats and tools
    • gitnexus://repo/{name}/clusters: All functional clusters
    • gitnexus://repo/{name}/processes: All execution flows
    • gitnexus://repo/{name}/schema: Graph schema
  5. 4 Agent Skills

    • Exploring: Navigate unfamiliar code using knowledge graph
    • Debugging: Trace bugs through call chains
    • Impact Analysis: Analyze blast radius before changes
    • Refactoring: Plan safe refactors using dependency mapping
  6. Multi-Language Support

    • Supports TypeScript, JavaScript, Python, Java, Kotlin, C, C++, C#, Go, Rust, PHP, Swift
  7. Wiki Generation

    • Generate LLM-powered documentation from knowledge graph
    • Supports custom models and providers
  8. Multi-Repo Support

    • Global registry manages multiple indexed repositories
    • One MCP server can serve multiple repositories

Project Advantages

Comparison ItemGitNexusTraditional Graph RAGOther Code Analysis Tools
Precomputed Intelligence✅ Precomputes structure at index time❌ Runtime queries⚠️ Partial precomputation
MCP Integration✅ Full MCP support❌ No MCP support⚠️ Partial support
Editor Integration✅ Multi-editor support❌ No integration⚠️ Single editor
Localization✅ Fully local⚠️ Requires server⚠️ Requires server
Multi-Language✅ 11 languages⚠️ Limited support⚠️ Limited support
Token Efficiency✅ One call returns complete context⚠️ Requires multiple queries⚠️ Requires multiple queries

Why Choose GitNexus?

  • Precomputed Intelligence: Precomputes structure at index time, tools return complete context in one call
  • MCP Integration: Provides deep codebase awareness to AI agents via MCP protocol
  • Fully Local: CLI mode runs entirely locally, Web UI runs entirely in browser
  • Multi-Editor Support: Supports Cursor, Claude Code, Windsurf, OpenCode
  • Smart Tools: Provides 7 MCP tools to avoid multiple queries
  • Open Source and Free: Code is open source, free to use and modify

Detailed Project Analysis

Architecture Design

GitNexus builds a complete knowledge graph of your codebase through a multi-phase indexing pipeline:

  1. Structure — Walks the file tree and maps folder/file relationships
  2. Parsing — Extracts functions, classes, methods, and interfaces using Tree-sitter ASTs
  3. Resolution — Resolves imports and function calls across files with language-aware logic
  4. Clustering — Groups related symbols into functional communities
  5. Processes — Traces execution flows from entry points through call chains
  6. Search — Builds hybrid search indexes for fast retrieval

Core Components:

  • Tree-sitter: AST parsing
  • KuzuDB: Embedded graph database (with vector support)
  • Graphology: Graph data structures
  • transformers.js: Browser ML (Web UI)
  • Sigma.js: WebGL graph rendering (Web UI)

CLI + MCP Mode

Workflow:

  1. Index Repository: npx gitnexus analyze indexes the codebase
  2. Register Repository: Index stored in .gitnexus/ directory, registered in global registry ~/.gitnexus/registry.json
  3. Start MCP Server: npx gitnexus mcp starts MCP server
  4. AI Agent Connection: AI agents connect to server via MCP protocol
  5. Tool Invocation: AI agents invoke tools to get codebase information

Multi-Repo Architecture:

  • Global Registry: ~/.gitnexus/registry.json stores all indexed repositories
  • Local Index: Each repository's index stored in .gitnexus/ directory
  • Connection Pool: MCP server uses connection pool to manage KuzuDB connections
  • Lazy Loading: Connections opened on first query, released after 5 minutes of inactivity

Web UI Mode

Technology Stack:

  • Frontend: React 18, TypeScript, Vite, Tailwind v4
  • Visualization: Sigma.js + Graphology (WebGL)
  • Parsing: Tree-sitter WASM
  • Database: KuzuDB WASM (in-memory)
  • Embeddings: transformers.js (WebGPU/WASM)
  • Search: BM25 + semantic + RRF

Features:

  • Fully Client-Side: Runs entirely in browser, no server needed
  • Privacy Protection: Code never leaves your browser
  • Memory Limits: Limited by browser memory (~5k files), or unlimited via backend mode

Bridge Mode:

Run gitnexus serve to start local HTTP server, Web UI auto-detects server and shows all indexed repositories without re-uploading or re-indexing.

Smart Tools Explained

1. Impact Analysis

impact({
  target: "UserService",
  direction: "upstream",
  minConfidence: 0.8
})
 
// Returns:
// TARGET: Class UserService (src/services/user.ts)
// UPSTREAM (what depends on this):
//   Depth 1 (WILL BREAK):
//     handleLogin [CALLS 90%] -> src/api/auth.ts:45
//     handleRegister [CALLS 90%] -> src/api/auth.ts:78

2. Process-Grouped Search

query({query: "authentication middleware"})
 
// Returns:
// processes:
//   - summary: "LoginFlow"
//     priority: 0.042
//     symbol_count: 4
//     process_type: cross_community
//     step_count: 7

3. Context (360-Degree Symbol View)

context({name: "validateUser"})
 
// Returns:
// symbol: Function:validateUser
// incoming:
//   calls: [handleLogin, handleRegister, UserController]
// outgoing:
//   calls: [checkPassword, createSession]
// processes:
//   - name: LoginFlow (step 2/7)

4. Detect Changes

detect_changes({scope: "all"})
 
// Returns:
// summary:
//   changed_count: 12
//   affected_count: 3
//   risk_level: medium

5. Rename (Multi-File)

rename({
  symbol_name: "validateUser",
  new_name: "verifyUser",
  dry_run: true
})
 
// Returns:
// status: success
// files_affected: 5
// total_edits: 8
// graph_edits: 6 (high confidence)
// text_search_edits: 2 (review carefully)

Difference from Traditional Graph RAG

Traditional Graph RAG:

  • LLM receives raw graph edges
  • Requires multiple queries (Query 1: Find callers → Query 2: What files? → Query 3: Filter tests? → Query 4: High-risk?)
  • Answer returned after 4+ queries

GitNexus Smart Tools:

  • Precomputes structure (clustering, tracing, scoring)
  • Returns complete context in one call
  • Answer returned in one query

Core Innovation: Precomputed Relational Intelligence

  • Reliability — LLM can't miss context, it's already in the tool response
  • Token Efficiency — No 10-query chains to understand one function
  • Model Democratization — Smaller LLMs work because tools do the heavy lifting

Technology Stack

LayerCLIWeb
RuntimeNode.js (native)Browser (WASM)
ParsingTree-sitter native bindingsTree-sitter WASM
DatabaseKuzuDB nativeKuzuDB WASM
EmbeddingsHuggingFace transformers.js (GPU/CPU)transformers.js (WebGPU/WASM)
SearchBM25 + semantic + RRFBM25 + semantic + RRF
Agent InterfaceMCP (stdio)LangChain ReAct agent
VisualizationSigma.js + Graphology (WebGL)
FrontendReact 18, TypeScript, Vite, Tailwind v4
ClusteringGraphologyGraphology

Project Address and Resources

Official Resources

Common Commands

# Setup MCP (one-time)
gitnexus setup
 
# Index repository
gitnexus analyze [path]
 
# Force full re-index
gitnexus analyze --force
 
# Skip embedding generation (faster)
gitnexus analyze --skip-embeddings
 
# Start MCP server
gitnexus mcp
 
# Start local HTTP server
gitnexus serve
 
# List all indexed repositories
gitnexus list
 
# Show index status for current repo
gitnexus status
 
# Delete index for current repo
gitnexus clean
 
# Generate repository wiki
gitnexus wiki

Target Audience

  • Daily Developers: Developers using Cursor, Claude Code, Windsurf
  • Codebase Maintainers: Maintainers needing to understand large codebase architecture
  • Refactoring Planners: Developers planning safe refactoring
  • Code Explorers: Developers needing to quickly explore unfamiliar codebases
  • AI Agent Developers: Developers needing to provide codebase awareness for AI agents

Visit my personal homepage to find more useful knowledge and interesting products