code-rag-golang
Provides Git-aware analysis for Go projects, supporting incremental updates to the call graph and integration with Git hooks to keep the analysis synchronized with code changes.
Enables the export of call graph analysis, impact assessments, and function relationship data into Markdown format for use as context in RAG (Retrieval-Augmented Generation) workflows.
crag - Call Graph for AI-Assisted Go Development
AI modifies a function but misses 5 callers that also need updating. crag fixes this — it builds precise call graphs via static analysis, so AI knows exactly what's affected before making changes.
How It Works
crag analyze . # Build call graph using SSA + VTA static analysis
# → Stored in SQLite, fast to query
AI: "Modify ProcessRequest"
→ crag automatically finds all 5 callers
→ AI updates them together, nothing missedRelated MCP server: sourcebook
Install
git clone https://github.com/zheng/crag.git
cd crag
go install ./cmd/cragQuick Start
# 1. Analyze your Go project
crag analyze . -o .crag.db
# 2. Configure MCP for your AI editor (Cursor / Claude Code)
# Add to .cursor/mcp.json or claude_desktop_config.json:{
"mcpServers": {
"crag": {
"command": "crag",
"args": ["mcp", "-d", "/absolute/path/.crag.db"]
}
}
}# 3. Keep it updated (pick one)
crag watch . -d .crag.db # Auto-update on file changes
# or: add `crag analyze . -i` to .git/hooks/post-commitThat's it. Your AI editor can now query call graphs directly.
What AI Can Do With crag
After MCP setup, just ask naturally:
"Where is HandleRequest called?" → upstream callers
"If I change BuildSSA, what's affected?" → impact analysis
"Find all functions containing Auth" → search
CLI Usage
crag impact "HandleRequest" -d .crag.db # Impact analysis (callers + callees)
crag upstream "db.Query" -d .crag.db # Who calls this? (recursive)
crag downstream "Process" -d .crag.db # What does this call?
crag search "Handler" -d .crag.db # Search functions by name
crag risk -d .crag.db # Show high-risk functions
crag implements -d .crag.db # Interface implementations
crag view -d .crag.db # Web UI visualization
crag export -d .crag.db -o crag.md # Export as Markdown (RAG context)Why crag?
Text search (grep) | IDE (gopls) | crag | |
Interface calls | miss | partial | VTA precise resolution |
Persisted & queryable | no | no | SQLite |
AI integration | manual copy | no | MCP native |
Incremental update | n/a | n/a | Git-aware |
Zero CGO | n/a | n/a | Pure Go SQLite |
Tech
Analysis: Go SSA + VTA (Variable Type Analysis) via
golang.org/x/toolsStorage:
modernc.org/sqlite(pure Go, single binary)CLI:
cobra· Web UI: embeddedvis.js
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceThe 'Blast Radius' detector for AI Agents. Prevent regressions using Git history and organizational memory.Last updated357MIT
- Alicense-qualityCmaintenanceLive codebase intelligence for AI agents. Import graph PageRank for file importance, git forensics for co-change coupling and fragile code, convention detection across 16 domains, and blast radius analysis.Last updated963Business Source 1.1
- Alicense-qualityDmaintenanceValidates AI-generated code against actual codebases to catch hallucinations, dead code, and API mismatches before runtime.Last updated171MIT
- Alicense-qualityCmaintenanceProvides AI coding agents with pre-edit situational awareness by combining structural call graphs and co-change history to prevent incomplete edits. It surfaces files that historically change together, reducing missed coupled modules.Last updated3MIT
Related MCP Connectors
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Shared debugging memory for AI coding agents
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nullptr-z/code-rag-golang'
If you have feedback or need assistance with the MCP directory API, please join our Discord server