Cette page est affichée en anglais. Une traduction française est en cours.
MCP ConfigsMay 12, 2026·2 min de lecture

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.

MCP Hub
MCP Hub · Community
Prêt pour agents

Staging sûr pour cet actif

Cet actif est d'abord staged. Le prompt copié demande à l'agent d'inspecter les fichiers staged avant d'activer scripts, config MCP ou config globale.

Stage only · 17/100Policy : staging
Surface agent
Tout agent MCP/CLI
Type
Mcp Config
Installation
Stage only
Confiance
Confiance : Established
Point d'entrée
Asset
Commande de staging sûr
npx -y tokrepo@latest install c1dbc5db-1dde-463c-b63b-5c0393595eb6 --target codex

Stage les fichiers d'abord; l'activation exige la revue du README et du plan staged.

Introduction

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.

🙏

Source et remerciements

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

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires