Add an MCP server contrib exposing the graph as native agent tools

Aperta
#12 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
api, tooling

Direzione di ricerca

Inizia leggendo src/query/graph_query.ts e src/agent/agent_tools.ts, quindi confronta la struttura di contribs/web_visualisation. Il lavoro è completo quando contribs/mcp_server contiene il suo package, il suo adattatore MCP stdio, sei strumenti corrispondenti ed esempi di configurazione in README, senza modifiche a core GraphQuery o al codice di estrazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Goal

Ship an MCP server under ./contribs/mcp_server that exposes the knowledge graph as native, callable agent tools — the "MCP server" row of the integration table in #10. This is step 2 of that issue's proposed plan (after the Skill), giving tool-native, cross-agent access (Claude Code, Cursor, etc.) with no Bash shell-out.

Tracks #10.

Why we are well positioned

The query layer is already "JSON in, JSON out" and the tool surface is effectively designed:

  • GraphQuery (src/query/graph_query.ts) exposes instance methods that map one-to-one onto tools: whoCalls, references, blastRadius, deadExports, neighborhood.
  • src/agent/agent_tools.ts already declares these as OpenAI-format function tools (find_symbol, who_calls, references, blast_radius, dead_exports, neighborhood). The MCP server is a thin re-expression of the same schema over the MCP protocol.

The hard part (a clean, machine-readable query surface) is done; this is plumbing.

Proposed tools

MCP tool Backing call Purpose
find_symbol name → candidate ids Resolve a symbol name to node ids. Entry point — never invent ids.
who_calls GraphQuery.whoCalls(id) Direct callers of a function/method.
references GraphQuery.references(id) Everything referencing a symbol/type (calls, type usage, heritage, reads).
blast_radius GraphQuery.blastRadius(id, depth) Transitive impact of changing a node.
dead_exports GraphQuery.deadExports() Exports with no references.
neighborhood GraphQuery.neighborhood(id) Incoming/outgoing edges around a node.

Scope

  • New self-contained contrib package in ./contribs/mcp_server (its own package.json, following the web_visualisation contrib layout).
  • Stdio MCP server (@modelcontextprotocol/sdk) that opens the graph database and adapts GraphQuery to MCP tool calls.
  • Reuse the existing tool names/descriptions from agent_tools.ts so behavior matches the in-process agent.
  • README with install snippet and the mcpServers config block for Claude Code / Cursor.

Out of scope

  • The Skill (step 1 of #10) and the PreToolUse always-on hook (deferred in #10).
  • Any change to core GraphQuery / extraction code — the adapter should be additive.

References

Lingua principale
TypeScript
Stelle
7
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jeromeetienne/codespine

Tutte le issue di jeromeetienne/codespine

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.