← 7TICS Book a call →
Open source work / gitnexus
GITNEXUS

MCP server that gives Claude a graph view of any codebase — symbols, callers, callees, execution flows, impact analysis. Used by Claude Code on this very project.

Cold-loading a 100,000-line codebase into an LLM context window is lossy and slow. The model reads the same files repeatedly, can't see who calls what, and loses track of execution flows. Embeddings help search but don't capture call graphs. What's needed is a queryable structural index — a graph — that an LLM can interrogate with cheap targeted queries instead of dumping raw text.

       ┌──────────────────────────────────┐
       │      Tree-sitter parsers         │
       │  (Python, JS, MQL5, Go, …)       │
       └──────────────┬───────────────────┘
                      │ AST + symbols + relationships
                      ▼
       ┌──────────────────────────────────┐
       │     SQLite graph index           │
       │  symbols · relations · processes │
       └──────────────┬───────────────────┘
                      │
                      ▼
       ┌──────────────────────────────────┐
       │      MCP tools (exposed to AI)   │
       │  impact · context · query        │
       │  rename · detect_changes         │
       └──────────────┬───────────────────┘
                      │
                      ▼
       ┌──────────────────────────────────┐
       │   Claude Code · Cursor · agents  │
       └──────────────────────────────────┘

Impact analysis — blast-radius query

// gitnexus_impact({target: "symbolName", direction: "upstream"})
// returns direct callers + affected processes + risk score
function impact(target, direction = 'upstream') {
  const symbol = db.symbols.find(name = target);
  if (!symbol) return { error: 'not found' };
  const edges = db.relationships.where({
    [direction === 'upstream' ? 'to' : 'from']: symbol.id,
    type: 'calls',
  });
  const processes = db.processes.touchedBy(symbol.id);
  return {
    target: symbol.name,
    direct: edges.map(e => db.symbols.byId(e.from)),
    processes: processes,
    risk: classifyRisk(edges.length, processes.length),
  };
}

MCP tool registration

// MCP server boilerplate — Claude / Cursor connect to this
server.tool('gitnexus_impact', {
  description: 'Run impact analysis on a symbol before editing it',
  inputSchema: {
    target:    z.string(),
    direction: z.enum(['upstream', 'downstream']).default('upstream'),
  },
}, async ({ target, direction }) => {
  const result = impact(target, direction);
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
});

Process discovery — named execution flows

// 'processes' are walks across the call graph that share a name
// e.g. "trade entry flow" = run_entry_signal → check_filters → submit_order → write_journal
// SQL: graph walk from entry symbol, breadth-first, capped at depth 6
WITH RECURSIVE flow(symbol_id, depth) AS (
  SELECT id, 0 FROM symbols WHERE name = ?
  UNION ALL
  SELECT r.to_symbol_id, flow.depth + 1
  FROM flow JOIN relationships r ON r.from_symbol_id = flow.symbol_id
  WHERE flow.depth < 6 AND r.type IN ('calls', 'invokes')
)
SELECT DISTINCT symbols.* FROM flow JOIN symbols ON symbols.id = flow.symbol_id;
Real codebases indexed 2,325 symbols (7tics) 3,051 relationships 46 execution flows Open source MCP

→ Source: github.com/svennm/gitnexus

← mt5 bridge gitnexus all work →