Esta página se muestra en inglés. Una traducción al español está en curso.
MCP ConfigsMay 12, 2026·2 min de lectura

CodeGraphContext — Graph Index for Code + MCP

CodeGraphContext indexes a repo into a code graph so developers and agents can query call chains, dependencies, and architecture via CLI or MCP mode.

Listo para agents

Este activo puede ser leído e instalado directamente por agents

TokRepo expone un comando CLI universal, contrato de instalación, metadata JSON, plan según adaptador y contenido raw para que los agents evalúen compatibilidad, riesgo y próximos pasos.

Native · 94/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Mcp
Instalación
Single
Confianza
Confianza: Established
Entrada
README.md
Comando CLI universal
npx tokrepo install c1dbc5db-1dde-463c-b63b-5c0393595eb6
Introducción

CodeGraphContext indexes a repo into a code graph so developers and agents can query call chains, dependencies, and architecture via CLI or MCP mode.

  • Best for: large codebases where agents need reliable call graphs and dependency queries
  • Works with: Python 3.10+; CLI plus MCP mode for IDE/agent integration
  • Setup time: 20–45 minutes

Practical Notes

  • Index once, then query call chains/dependencies instead of re-reading files repeatedly.
  • Start with a small subfolder first to validate performance before indexing monorepos.

Two modes: CLI for humans, MCP for agents

You can use CodeGraphContext as:

  • a CLI to ask structural questions (callers/callees, dependencies),
  • an MCP server so your assistant can query structure via tools.

Practical workflow for better agent context

1) Index your repo

codegraphcontext index

2) Ask “structure” questions first

Good first questions:

  • “What calls this function?”
  • “Where does this module get instantiated?”
  • “Show the call chain from HTTP handler to DB write.”

3) Feed the query results to your agent

Instead of dumping full files, give the agent:

  • the top 10 nodes in the call chain,
  • the 3–5 files it must open,
  • constraints (touch only X modules, avoid breaking API).

Operational advice

  • Use file watching mode during refactors only when needed (it updates the graph continuously).
  • Treat the graph DB as a cache: rebuild when your repo changes dramatically.

FAQ

Q: Do I need MCP to get value? A: No. The CLI alone helps answer structural questions quickly.

Q: When should I re-index? A: After large refactors or when results look stale; treat the graph as a cache.

Q: How does this help agents? A: It gives reliable call/dependency context so agents stop guessing where logic lives.

🙏

Fuente y agradecimientos

Source: https://github.com/CodeGraphContext/CodeGraphContext > License: MIT > GitHub stars: 3,218 · forks: 573

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados