Atlas / MCP servers / ajksunkang-aios / KGraph

KGraphBLOCK

mcp/ajksunkang-aios/kgraph

The Compiler-Aware Operating System Kernel CodeGraph Engine for Token-Efficient Structural Codebase Retrieval

Verdict
BLOCK
Grade
D
Trust score
69 /100
Exposed tools
13 13r · 0w · 0d
Transport
—
License
MIT
Stars
4
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

English | 中文

Compiler-Aware Kernel Graph Engine · MCP Tool Service

Config-aware · Macro-resolved · Function-pointer-callable · SQLite-native

Design Document →

KGraph indexes what the **compiler** sees — not what the parser guesses.

Why KGraph?

Kernel code is not regular code. It lives behind #ifdef CONFIG_*, inside SYSCALL_DEFINE* macros, behind file_operations function-pointer tables that tree-sitter can't follow. Existing tools (codegraph, semcode) parse syntax — KGraph parses compilation truth.

Result: LLM agents find root-cause paths in 3 tool-calls / ~1.5k tokens where grep-based workflows burn 10k+ tokens and scatter across irrelevant branches.

Workflow at a Glance

Once your kernel has a compile_commands.json, the whole setup is three commands:

# 1. Install kgraph (bundles Python 3.10 + scip-clang, Linux x86-64 only)
npm install -g @ajksunkang-aios/kgraph

# 2. Wire kgraph's MCP server into your AI agents (auto-detects what's installed)
kgraph install

# 3. Build the code graph for this kernel (run inside the kernel source dir)
cd /path/to/linux
kgraph init .

That's it. Restart your agent and ask it structural questions about the kernel — it calls KGraph's MCP tools instead of grepping.

> What functions call ext4_file_read_iter?
> What implements ->read_iter across the kernel?
> Show me the
Read from source at commit 738c5cd9d214OBSERVED · 2026-10-11
02

Connect

Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.

claude-code
claude mcp add kgraph-eval --env ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} --env ANTHROPIC_AUTH_TOKEN=${ANTHROPIC_AUTH_TOKEN} -- uvx kgraph-eval
claude-desktop
{
  "mcpServers": {
    "kgraph-eval": {
      "command": "uvx",
      "args": [
        "kgraph-eval"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}",
        "ANTHROPIC_AUTH_TOKEN": "${ANTHROPIC_AUTH_TOKEN}"
      }
    }
  }
}
03

Exposed tools (13)

13 read · 0 write · 0 destructive.

ToolRiskDescription
call_pathread
find_calleesread
find_callersread
find_ops_implsread
find_referencesread
find_type_definitionread
get_callchainread
get_function_bodyread
get_neighborhoodread
get_struct_layoutread
get_symbolread
index_statusread
search_symbolsread
04

Trust audit

BLOCKgrade D · trust 69/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.

LayerWhat it checksResult
L0Provenance & inventoryWARN
L1Static analysis of the codeFAIL
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
declared (3 observation(s))
Network
declared (13 observation(s))
Shell
declared (4 observation(s))
Dependencies
not all pinned
Secrets in source
none-found

Findings (13)

HIGHNetwork egress · net.tls_off · CWE-200, CWE-319
npm-shim.js:66
console.error('KGraph: secure download failed (cert verification), retrying with --insecure (-k)...');
Why it matters. certificate verification is disabled
Fix. leave verification on
MEDIUMInventory / provenance · inv.binary · CWE-1104
scripts/__pycache__/scip_pb2.cpython-310.pyc
scip_pb2.cpython-310.pyc
Why it matters. a compiled or binary member cannot be reviewed from source
Fix. ship source, or explain the binary in the README
MEDIUMNetwork egress · net.raw_ip · CWE-200, CWE-319
scripts/record-graph-demo.sh:53
if curl --fail --silent "http://127.0.0.1:$PORT/api/status" >/dev/null; then
MEDIUMNetwork egress · net.raw_ip · CWE-200, CWE-319
scripts/record-graph-demo.sh:58
if ! curl --fail --silent "http://127.0.0.1:$PORT/api/status" >/dev/null; then
MEDIUMNetwork egress · net.raw_ip · CWE-200, CWE-319
scripts/record-graph-demo.sh:63
URL="http://127.0.0.1:$PORT/graph.html?demo=video"
MEDIUMObfuscation / stealth · obf.homoglyph · CWE-506, CWE-94
eval/kgraph_eval/report.py:98
"> ΔF1 = B−A (positive = more accurate). "
MEDIUMObfuscation / stealth · obf.homoglyph · CWE-506, CWE-94
eval/kgraph_eval/report.py:99
"Δtokens/Δcalls = % saved by B (negative % = B cheaper). "
MEDIUMObfuscation / stealth · obf.homoglyph · CWE-506, CWE-94
eval/kgraph_eval/report.py:102
"| tier | n | ΔF1 | Δtokens | Δcalls |",
LOWCode injection · code.eval_exec · CWE-78, CWE-94, CWE-95
.github/workflows/eval-retrieval.yml:1
name: Eval (KBench retrieval)
Why it matters. evaluates text as code
Fix. remove; use a parser or a dispatch table
LOWCode injection · code.eval_exec · CWE-78, CWE-94, CWE-95
.github/workflows/eval-retrieval.yml:108
- name: Run eval (KBench retrieval A/B)
Why it matters. evaluates text as code
Fix. remove; use a parser or a dispatch table
LOWSupply chain · supply.unpinned · CWE-829, CWE-1357
requirements-dev.txt
pytest
Why it matters. 1 requirement(s) not pinned with ==
Fix. pin exact versions
LOWSupply chain · supply.unpinned · CWE-829, CWE-1357
requirements.txt
protobuf, mcp, trio
Why it matters. 3 requirement(s) not pinned with ==
Fix. pin exact versions
INFOInventory / provenance · inv.oversize · CWE-1104
thirdparty/scip-clang
thirdparty/scip-clang
Why it matters. 42762296 bytes not read

Gates applied: no_behavioural_pass.

Audited 2026-10-11 · audit v0.4.1 · source sha 738c5cd9d214full audit observations/trust-audit/mcp-server/ajksunkang-aios__kgraph.json · Report an issue / request a re-scan
05

Audit history

Every audit this server has had. A grade with a past is a grade somebody is still checking.

DateSourceVerdictGradeScoreChange
2026-10-11738c5cd9d214BLOCKD69first audit
06

Questions

What is the KGraph MCP server?

The Compiler-Aware Operating System Kernel CodeGraph Engine for Token-Efficient Structural Codebase Retrieval

What tools does KGraph expose?

13 in total: 13 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.

Is KGraph safe to connect to an agent?

No — not without reading the findings first. The audit graded it D (69/100) and found 1 critical or high issue in the source. Each one is listed on this page with the file and line it is on.

What credentials does KGraph need?

It reads ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.

How current is this page?

The grade is for one exact copy of the source (738c5cd9d214), read on 2026-10-11. The repository is watched and re-audited when it changes.

Advertisement