Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
3ca2f51
feat: index files inside git submodules
andreinknv Apr 26, 2026
31b827c
docs: README setup snippets for non-Claude MCP clients
andreinknv Apr 26, 2026
7ec4fc5
docs: cookbook for adding a new language
andreinknv Apr 26, 2026
05eb7a5
fix: correctness bugs found in audit
andreinknv Apr 26, 2026
4f66d23
fix: defense-in-depth hardening
andreinknv Apr 26, 2026
115d955
fix(sync): detect HEAD-moving git operations to prevent stale index
andreinknv Apr 26, 2026
41b67fa
fix: extraction/resolution accuracy (BOM, comment-strip retry, framew…
andreinknv Apr 26, 2026
064866c
fix: also strip comments before C# minimal-API route regex
andreinknv Apr 26, 2026
8e538bd
fix(db): enforce UNIQUE on edges so INSERT OR IGNORE actually dedupes
andreinknv Apr 26, 2026
98d6c31
fix(scan): honor .codegraphignore on the git fast path
andreinknv Apr 26, 2026
6813d08
feat(search): subword tokens + Porter stemmer + stopword filter for FTS
andreinknv Apr 26, 2026
d28f307
feat(cochange): file-level co-change graph mined from git history
andreinknv Apr 26, 2026
fc03e3b
feat(graph): convention-based tests-as-edges (test file → subject file)
andreinknv Apr 26, 2026
5a45ef2
feat(search): per-file diversification so top-K isn't one class's met…
andreinknv Apr 26, 2026
7b8c279
perf(db): batch node lookups, fix insertNode cache, auto-ANALYZE afte…
andreinknv Apr 26, 2026
1535649
test(watcher): fix fs.watch flake by adding settle delay before file …
andreinknv Apr 26, 2026
c7ea248
feat(mcp): codegraph_review_context — structured PR-review context fr…
andreinknv Apr 26, 2026
6764a7f
feat: LLM symbol summaries with auto-detect + background execution
andreinknv Apr 26, 2026
099a629
feat: semantic search, hybrid retrieval, Q&A, cross-language matching
andreinknv Apr 26, 2026
7a17d31
feat: tier 1-3 LLM features + agent-as-LLM bridge
andreinknv Apr 26, 2026
7a1f400
fix: directory summary column-order swap (summary <-> content_hash)
andreinknv Apr 26, 2026
0a3b32a
refactor: per-language registry — eliminate cross-PR conflict surface
andreinknv Apr 27, 2026
e43a618
fix(language-registry): TreeSitterExtractor reads from def.grammar.ex…
andreinknv Apr 27, 2026
7a9b997
refactor: per-tool MCP registry — eliminate tools[] + case-switch con…
andreinknv Apr 27, 2026
4b93224
refactor: file-based migrations — eliminate version-collision bug class
andreinknv Apr 27, 2026
20c4a3e
refactor: index-hook framework — eliminate per-pass CodeGraph mutations
andreinknv Apr 27, 2026
6d37c02
Merge branch 'refactor/mcp-tool-registry' into battle-test/all-shipped
andreinknv Apr 27, 2026
53a6358
Merge branch 'refactor/migration-files' into battle-test/all-shipped
andreinknv Apr 27, 2026
d807e23
Merge branch 'refactor/index-hooks' into battle-test/all-shipped
andreinknv Apr 27, 2026
38887ee
feat: PR #112 (centrality + churn + hotspots) on top of refactors
andreinknv Apr 27, 2026
e85ebd0
feat: PR #113 (issue-history) on top of refactors
andreinknv Apr 27, 2026
f8fc536
feat: PR #114 (config-refs) on top of refactors
andreinknv Apr 27, 2026
7c3af0e
feat: PR #115 (sql-refs) on top of refactors
andreinknv Apr 27, 2026
d3120f5
Merge branch 'fix/watcher-test-flake' into battle-test/all-shipped
andreinknv Apr 27, 2026
c3c445d
Merge branch 'fix/edges-unique-constraint' into battle-test/all-shipped
andreinknv Apr 27, 2026
3aef004
Merge branch 'fix/codegraphignore-git-fast-path' into battle-test/all…
andreinknv Apr 27, 2026
e956c33
Merge branch 'fix/sync-detect-head-movement' into battle-test/all-shi…
andreinknv Apr 27, 2026
8d6b9ce
Merge branch 'fix/extraction-resolution-accuracy' into battle-test/al…
andreinknv Apr 27, 2026
125e763
Merge branch 'fix/audit-correctness' into battle-test/all-shipped
andreinknv Apr 27, 2026
a0892e8
Merge branch 'fix/audit-hardening' into battle-test/all-shipped
andreinknv Apr 27, 2026
b65667a
Merge branch 'feat/db-perf-and-cache-fix' into battle-test/all-shipped
andreinknv Apr 27, 2026
2db150d
Merge branch 'feat/fts-search-quality' into battle-test/all-shipped
andreinknv Apr 27, 2026
052f5b0
Merge branch 'feat/search-diversify' into battle-test/all-shipped
andreinknv Apr 27, 2026
b0f09ac
feat: PR #92 (HCL/Terraform) ported onto language registry
andreinknv Apr 27, 2026
b78b99a
feat: PR #94 (R language) ported onto language registry
andreinknv Apr 27, 2026
d91575d
feat: PR #95 (SQL language) ported onto language registry
andreinknv Apr 27, 2026
ea3f628
Merge branch 'feat/index-submodules' into battle-test/all-shipped
andreinknv Apr 27, 2026
8255db1
Merge branch 'feat/cochange-graph' into battle-test/all-shipped
andreinknv Apr 27, 2026
52d85be
Merge branch 'feat/tests-edges' into battle-test/all-shipped
andreinknv Apr 27, 2026
82586b4
Merge branch 'feat/review-context' into battle-test/all-shipped
andreinknv Apr 27, 2026
30a5951
Merge branches 'docs/adding-a-language' and 'docs/mcp-other-clients' …
andreinknv Apr 27, 2026
2599a9c
feat: PR #91 (Scala language) ported onto language registry
andreinknv Apr 27, 2026
aa029cd
feat: PR #58 (ReScript language) ported onto language registry
andreinknv Apr 27, 2026
f517e60
fix(sql-refs): English-word false positives + add stress-test harness
andreinknv Apr 28, 2026
c103d10
spikes: validate dead-export, weighted-PR, coverage-merge improvements
andreinknv Apr 28, 2026
e9fb2b8
spikes: validate risk-delta + simulate-change before build
andreinknv Apr 28, 2026
c9c3bb2
audit: drop dead-exports finding in favor of per-language tool pointers
andreinknv Apr 28, 2026
d1b79f6
feat: PR #111 (LLM symbol summaries + RAG + dead-code judge) rebased
andreinknv Apr 28, 2026
d1951b3
spikes: validate DB-layer optimizations before building
andreinknv Apr 28, 2026
195ab97
perf(db): drop redundant co_changes index, split embeddings, add in-m…
andreinknv Apr 28, 2026
e1b0595
integrate(db): port #122 edge-index drops to file-based migration 017
andreinknv Apr 28, 2026
077f787
feat(coverage): per-symbol code coverage from lcov reports
andreinknv Apr 28, 2026
45c660a
fix(coverage): add missing src/coverage/{index,lcov}.ts module
andreinknv Apr 28, 2026
4d15388
fix(coverage): narrow getCoverageStats source list to the source filter
andreinknv Apr 28, 2026
3f3ccd5
feat(biomarkers): static-analysis Code Health for AI agents
andreinknv Apr 28, 2026
4481a6f
fix(biomarkers): parse each file once instead of once per symbol
andreinknv Apr 28, 2026
e89fb0c
feat(biomarkers): four new rules — unused_export, long_parameter_list…
andreinknv Apr 28, 2026
d376e42
fix(biomarkers): address reviewer findings — re-export edges, sync pe…
andreinknv Apr 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dist/
Thumbs.db

# Test coverage
coverage/
/coverage/
.nyc_output/

# Environment
Expand Down
4 changes: 3 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ SQLite database with:

### Supported Languages

TypeScript, JavaScript, TSX, JSX, Svelte, Python, Go, Rust, Java, C, C++, C#, PHP, Ruby, Swift, Kotlin, Dart, Liquid, Pascal
TypeScript, JavaScript, TSX, JSX, Svelte, Python, Go, Rust, Java, C, C++, C#, PHP, Ruby, Swift, Kotlin, Dart, Liquid, Pascal, R

To add a new language, follow the cookbook at [`docs/ADDING-A-LANGUAGE.md`](docs/ADDING-A-LANGUAGE.md).

### Node and Edge Types

Expand Down
108 changes: 107 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ fi

## MCP Tools

When running as an MCP server, CodeGraph exposes these tools to Claude Code:
When running as an MCP server, CodeGraph exposes these tools to any MCP-compatible AI assistant:

| Tool | Purpose |
|------|---------|
Expand All @@ -331,6 +331,110 @@ When running as an MCP server, CodeGraph exposes these tools to Claude Code:

---

## Using with Other MCP Clients

The MCP server runs over **stdio** and works with any MCP-compatible client — not just Claude Code. The interactive installer is Claude Code-specific (it writes `~/.claude.json`), so for other clients you'll want the manual setup.

**Common steps for every client:**

```bash
npm install -g @colbymchenry/codegraph # so `codegraph` is on PATH
cd your-project
codegraph init -i # initialize + index this project
```

Then point your MCP client at `codegraph serve --mcp` using whatever config shape it expects:

### opencode

In `opencode.json` (project) or `~/.config/opencode/opencode.json` (global):

```json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"codegraph": {
"type": "local",
"command": ["codegraph", "serve", "--mcp"],
"enabled": true
}
}
}
```

### Cursor

In `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project):

```json
{
"mcpServers": {
"codegraph": {
"command": "codegraph",
"args": ["serve", "--mcp"]
}
}
}
```

### LangChain (`MultiServerMCPClient`)

The CodeGraph server speaks stdio, not SSE — pass `transport: "stdio"`:

```python
from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient({
"codegraph": {
"command": "codegraph",
"args": ["serve", "--mcp"],
"transport": "stdio",
}
})
tools = await client.get_tools()
```

### Claude Agent SDK

Pass the server in `mcpServers` (TypeScript) or `mcp_servers` (Python) when calling `query()`:

```python
from claude_agent_sdk import query, ClaudeAgentOptions

options = ClaudeAgentOptions(
mcp_servers={
"codegraph": {
"command": "codegraph",
"args": ["serve", "--mcp"],
}
},
allowed_tools=["mcp__codegraph__*"],
)

async for message in query(prompt="Where is auth handled?", options=options):
...
```

### Anything else (generic stdio MCP)

Most MCP clients (Continue, Zed, custom integrations, etc.) accept some variation of `command` + `args`. The values are always:

| Field | Value |
|-------|-------|
| Command | `codegraph` |
| Args | `["serve", "--mcp"]` |
| Transport | `stdio` |

The server reads the project root from the MCP `initialize` request's `rootUri` (set by the client when it connects). If your client doesn't send a `rootUri`, pass the project path explicitly:

```bash
codegraph serve --mcp --path /absolute/path/to/project
```

> **Note:** CodeGraph's MCP server does **not** speak SSE/HTTP. If your client only supports `url` + `transport: "sse"`, you'll need to wrap stdio with a bridge like [supergateway](https://github.com/supercorp-ai/supergateway).

---

## Library Usage

```typescript
Expand Down Expand Up @@ -402,6 +506,8 @@ The `.codegraph/config.json` file controls indexing:
| Liquid | `.liquid` | Full support |
| Pascal / Delphi | `.pas`, `.dpr`, `.dpk`, `.lpr` | Full support (classes, records, interfaces, enums, DFM/FMX form files) |

Want to add another language? See [`docs/ADDING-A-LANGUAGE.md`](docs/ADDING-A-LANGUAGE.md) — it walks through sourcing a tree-sitter grammar, probing the AST, choosing between the OO and self-contained extractor patterns, and the worked examples in the existing extractors.

## Troubleshooting

**"CodeGraph not initialized"** — Run `codegraph init` in your project directory first.
Expand Down
Loading