CodeGB
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
CodeGB
⚠️ This repository has moved
CodeGB is no longer maintained.
The project has been renamed and continued as Tally.
➡️ New repository: https://github.com/Killian-Filippov/Tally
This repository is archived and kept only for historical reference.
CodeGB is a code knowledge graph tool for local developer environments. It provides an MCP Server that runs on your machine and can be called by MCP Clients (such as Claude/Cursor).
Feature Overview
Java code parsing and graph construction (classes, methods, fields, calls, inheritance, imports)
Tree-sitter-first Java extraction, with regex kept only as a compatibility fallback
MCP tools:
querycontextimpactcypherlist_repos
Local-first storage and querying
Switchable graph storage backend (WASM / Native)
Related MCP server: CKB
Requirements
Node.js 18+
pnpm
Install Dependencies
pnpm installBuild
pnpm buildLocal Usage (CLI)
# 1) Initialize the repository index directory
pnpm exec tsx packages/cli/src/index.ts init /path/to/your/repo --storage .javakg
# 2) Build index
pnpm exec tsx packages/cli/src/index.ts index /path/to/your/repo --storage .javakg
# 2.1) Incremental indexing (only process changed Java files in git diff)
pnpm exec tsx packages/cli/src/index.ts index /path/to/your/repo --storage .javakg --changed-files
# 3) Query
pnpm exec tsx packages/cli/src/index.ts query "payment" --storage .javakg --limit 10Start MCP Server (stdio)
JAVA_KG_DB_PATH=.javakg pnpm exec tsx packages/mcp-server/src/cli.tsNotes:
This process communicates with the MCP Client via stdio.
In your MCP Client, configure this command as the MCP Server startup command.
MCP Client Config Template (Minimal Working Setup)
Use the following template consistently:
command:pnpmargs:["exec", "tsx", "packages/mcp-server/src/cli.ts"]env.JAVA_KG_DB_PATH: your index directory (must match--storage)env.CODEGB_AUTO_INDEX_INTERVAL_MS: polling interval (ms) for MCP background incremental indexing (default3000, set to0to disable)env.CODEGB_MCP_CACHE_TTL_MS: cache TTL (ms) for MCPquery/context(default60000, set to0to disable)env.CODEGB_MCP_CACHE_L1_MAX_ENTRIES: in-process L1 cache size (default256, set to0to disable)env.CODEGB_MCP_CACHE_L2_MAX_ENTRIES: persistent L2 cache size (default4096, set to0to disable)
Replace "/ABS/PATH/TO/CodeGB" and "/ABS/PATH/TO/.javakg" with absolute paths.
Claude Desktop
The config file (macOS) is usually at ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"codegb": {
"command": "pnpm",
"args": ["exec", "tsx", "packages/mcp-server/src/cli.ts"],
"cwd": "/ABS/PATH/TO/CodeGB",
"env": {
"JAVA_KG_DB_PATH": "/ABS/PATH/TO/.javakg"
}
}
}
}Cursor
Workspace file .cursor/mcp.json:
{
"mcpServers": {
"codegb": {
"command": "pnpm",
"args": ["exec", "tsx", "packages/mcp-server/src/cli.ts"],
"cwd": "/ABS/PATH/TO/CodeGB",
"env": {
"JAVA_KG_DB_PATH": "/ABS/PATH/TO/.javakg"
}
}
}
}VS Code
Workspace file .vscode/mcp.json:
{
"servers": {
"codegb": {
"type": "stdio",
"command": "pnpm",
"args": ["exec", "tsx", "packages/mcp-server/src/cli.ts"],
"cwd": "/ABS/PATH/TO/CodeGB",
"env": {
"JAVA_KG_DB_PATH": "/ABS/PATH/TO/.javakg"
}
}
}
}First-Time Indexing (Required Before MCP)
MCP only provides queries. For first-time usage, run init + index first:
pnpm exec tsx packages/cli/src/index.ts init /ABS/PATH/TO/REPO --storage /ABS/PATH/TO/.javakg
pnpm exec tsx packages/cli/src/index.ts index /ABS/PATH/TO/REPO --storage /ABS/PATH/TO/.javakgJava Parser Runtime
The indexing pipeline uses
tree-sitteras the primary Java parser and extraction path.JAVA_QUERIESis the authoritative query template used by the tree-sitter extractor for symbol and relation capture.The legacy regex extractor is still present only as a compatibility fallback when the tree-sitter runtime is unavailable or a single-file tree-sitter parse fails during indexing.
Operationally, you should treat CodeGB as a tree-sitter-based Java indexer, not as a dual-parser system.
FAQ
Q: MCP connects successfully, but returns empty results? A: Usually initial indexing was not completed, or
JAVA_KG_DB_PATHdoes not match index--storage.Q: Startup fails with JSON error codes? A:
E_NODE_VERSION(Node < 18),E_STORAGE_PERM(directory not writable),E_WORKER_UNAVAILABLE(worker unavailable),E_BACKEND_INIT(backend initialization failed).Q:
pnpmnot found? A: Ensurepnpmis available in the client runtimePATH, or use an absolute path topnpm.Q:
list_reposshows old repositories? A: Re-runinit + indexfor the new repository and updateJAVA_KG_DB_PATH.
Fallback Behavior
Backend fallback: when
CODEGB_DB_BACKEND=auto,wasmis preferred, and if it fails it automatically falls back tonative, with a one-time diagnostic log.Cypher fallback: the
cyphertool prefers backend execution; when backend is unavailable or returns incompatible results, it automatically falls back to the in-memory graph compatible execution path.Data fallback: if the index directory is empty or graph loading fails, the service starts with an empty graph and tools return empty results instead of crashing the process.
Graph Database Backend Selection
The current implementation supports two paths:
kuzu-wasm: better cross-platform compatibility and installation experience, suitable for default distribution.kuzu(native): may be faster on some machines, but has higher installation/compatibility cost.
Unified switch:
CODEGB_DB_BACKEND=wasm|native|autoDefault:
wasm(compatibility first)auto: trywasmfirst, automatically fall back tonativeon failure, and print a one-time diagnostic log.
Note: backend switching has been implemented in the core layer. The concrete runtime strategy can be managed uniformly through startup configuration.
Tests
# Core tests
pnpm exec tsx --test packages/core/test/*.test.ts
# E2E tests
pnpm test:e2eRelease Gate
Before publishing a developer-trial version, run:
pnpm run release:gateGate conditions:
Core e2e passes (
pnpm test:e2e:phase1)benchmark.mdexistsdocs/release-notes.mdcontains the current version heading (## v<version>)
Project Structure
packages/core: parsing, graph models, storage adapters, search, MCP tool logicpackages/mcp-server: MCP Server startup and protocol integrationpackages/cli: local init/index/query commandstests/e2e: end-to-end tests
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Repository knowledge graph MCP server for codebase understanding and debugging.
Shared context for your codebase: a hosted code knowledge graph over MCP. Free plan, OAuth sign-up.
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Query your own knowledge graph from any MCP client. The graph lives in a database you own.
Related MCP Servers
- AlicenseAqualityDmaintenanceCross-repository code knowledge graph MCP server for Java, Kotlin, JavaScript, and TypeScript. Indexes source code into embedded KuzuDB via tree-sitter and exposes 30+ tools for call-flow tracing, multi-hop taint analysis (OWASP/CWE/PCI/STIG), entry-point reachability filtering, performance hotspot detection, and license compliance — without reading source files. 95% fewer tokens vs source-read332MIT
- FlicenseNot gradedqualityBmaintenanceTransforms a codebase into a queryable knowledge base for code understanding, impact analysis, ownership lookup, and more via CLI, HTTP API, or MCP.112-
- AlicenseNot gradedqualityDmaintenanceProvides a code graph querying and visualization MCP server, enabling users to search, trace, and describe code components, overlay diffs, and explore architecture through natural language.MIT
- FlicenseDqualityDmaintenanceProvides a local SQLite-backed code context knowledge base with MCP tools for storing and querying code facts, call graphs, semantic info, evidence, and business mappings, plus versioned snapshot publishing and incremental sync.776-