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

Staging seguro para este activo

Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.

Stage only · 17/100Política: staging
Superficie agent
Cualquier agent MCP/CLI
Tipo
Mcp Config
Instalación
Stage only
Confianza
Confianza: Established
Entrada
Asset
Comando de staging seguro
npx -y tokrepo@latest install c1dbc5db-1dde-463c-b63b-5c0393595eb6 --target codex

Primero deja archivos en staging; la activación requiere revisar el README y el plan staged.

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