Loading...
Loading...
High-performance code intelligence MCP server that indexes codebases into knowledge graphs for structural queries, call traces, and architecture analysis
npx skill4agent add aradotso/mcp-skills codebase-memory-mcp-intelligenceSkill by ara.so — MCP Skills collection.
# Standard version
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
# With graph visualization UI
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --uiInvoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1
.\install.ps1# Extract and run installer
tar xzf codebase-memory-mcp-*.tar.gz
./install.shcodebase-memory-mcp --versionUser: Index this projectindex_repositorycodebase-memory-mcp index /path/to/repocodebase-memory-mcp config set auto_index true
codebase-memory-mcp config set auto_index_limit 50000User: Show me the architecture of this codebaseget_architecture{
"languages": ["TypeScript", "Python", "Go"],
"packages": ["src/api", "src/services", "src/models"],
"entry_points": [
{"name": "main", "file": "src/index.ts", "type": "Function"}
],
"routes": [
{"path": "/api/users", "method": "GET", "handler": "getUsers", "file": "src/api/users.ts"}
],
"hotspots": [
{"name": "processRequest", "in_degree": 15, "out_degree": 8, "file": "src/services/request.ts"}
],
"boundaries": [
{"module": "Community_0", "members": ["src/api/*"], "internal_edges": 45, "external_edges": 12}
]
}User: Find all functions with "Handler" in the namesearch_graph{
"name_pattern": ".*Handler.*",
"labels": ["Function"]
}User: Show me the most called functions{
"labels": ["Function"],
"min_in_degree": 5,
"limit": 20
}User: Find all classes in the auth module{
"labels": ["Class"],
"file_pattern": ".*/auth/.*"
}User: What calls the authenticate function?get_callers{
"symbol_name": "authenticate",
"max_depth": 3
}User: Trace the execution path from main to database functionstrace_symbol{
"symbol_name": "main",
"direction": "outgoing",
"max_depth": 5,
"edge_types": ["CALLS"]
}User: Find authentication-related functionssemantic_query{
"query": "authentication jwt token validation",
"limit": 10
}User: Run a Cypher query to find all functions that call database operationscypher_queryMATCH (f:Function)-[:CALLS]->(db:Function)
WHERE db.name CONTAINS 'query' OR db.name CONTAINS 'exec'
RETURN f.name, f.file, COUNT(db) as db_calls
ORDER BY db_calls DESC
LIMIT 20MATCH (c:Class)-[:INHERITS*1..3]->(base:Class)
WHERE base.name = 'BaseModel'
RETURN c.name, c.fileMATCH (r:Route)-[:HANDLED_BY]->(h:Function)-[:CALLS]->(s:Function)
WHERE r.path CONTAINS '/api/users'
RETURN r.path, h.name, COLLECT(s.name) as servicesUser: Find unused functionsfind_dead_code{
"entry_points": ["main", "handler"],
"min_depth": 2
}CALLSUser: What's affected by my recent changes?detect_changes{
"include_tests": true
}{
"changed_symbols": [
{
"name": "authenticate",
"type": "Function",
"file": "src/auth.ts",
"confidence": 0.95,
"change_type": "modified"
}
],
"affected_symbols": [
{
"name": "loginHandler",
"type": "Function",
"file": "src/handlers/login.ts",
"distance": 1,
"risk": "HIGH"
}
]
}User: Document our decision to use Redis for session storagemanage_adr{
"action": "create",
"title": "Use Redis for Session Storage",
"status": "accepted",
"context": "Need fast, distributed session management",
"decision": "Adopt Redis with session TTL and clustering",
"consequences": "Requires Redis infrastructure; enables horizontal scaling"
}User: Show all architecture decisions{
"action": "list"
}{
"action": "update",
"id": "ADR-001",
"status": "superseded"
}User: Show all external API callssearch_graph{
"edge_types": ["HTTP_CALLS"],
"labels": ["Function"]
}MATCH (f:Function)-[:HTTP_CALLS]->(r:Route)
RETURN f.name, f.file, r.path, r.methodcodebase-memory-mcp config list# Auto-index on session start
codebase-memory-mcp config set auto_index true
# File limit for auto-indexing
codebase-memory-mcp config set auto_index_limit 50000
# Enable background file watcher
codebase-memory-mcp config set watch true
# Embedding model (default: nomic-embed-code)
codebase-memory-mcp config set embedding_model nomic-embed-code
# Graph visualization port
codebase-memory-mcp config set ui_port 9749.cbmignorenode_modules/
*.test.ts
dist/
build/
*.min.js
vendor/node_modules.gitdistbuildvendor.venv__pycache__codebase-memory-mcp --ui=true --port=9749http://localhost:9749# After indexing, compress the graph
codebase-memory-mcp export --output=.codebase-memory/graph.db.zst
# Commit to repo
git add .codebase-memory/graph.db.zst
git commit -m "Add codebase graph snapshot"codebase-memory-mcp import --input=.codebase-memory/graph.db.zst# Search
codebase-memory-mcp cli search_graph '{"name_pattern": ".*Service$", "labels": ["Class"]}'
# Cypher query
codebase-memory-mcp cli cypher_query 'MATCH (f:Function) WHERE f.name = "main" RETURN f'
# Get architecture
codebase-memory-mcp cli get_architecture '{}'
# Semantic search
codebase-memory-mcp cli semantic_query '{"query": "database connection pooling", "limit": 5}'go.modINHERITSpyproject.tomlsetup.pyUser: Show all Kubernetes resources{
"labels": ["Resource"],
"properties": {"kind": "Deployment"}
}MATCH (overlay:Module)-[:IMPORTS]->(base:Resource)
WHERE overlay.type = 'kustomize'
RETURN overlay.name, COLLECT(base.name) as resourcesUser: Find all services using Node 18{
"labels": ["Dockerfile"],
"code_pattern": "FROM node:18"
}# Increase memory limit (default: 8GB)
codebase-memory-mcp config set max_memory_gb 16
# Skip large files
codebase-memory-mcp config set max_file_size_mb 5.cbmignorecodebase-memory-mcp --languagescodebase-memory-mcp index --force /path/to/repo# Rebuild indexes
codebase-memory-mcp cli vacuum
# Check database size
ls -lh ~/.cache/codebase-memory-mcp/graph.dbwhich codebase-memory-mcpcodebase-memory-mcp config verify~/.cache/codebase-memory-mcp/logs/# Reinstall agent configs
codebase-memory-mcp install --force
# Verify MCP registration
codebase-memory-mcp config show-mcp-config--max-memory-gb# Rebuild embeddings index
codebase-memory-mcp cli rebuild_embeddings
# Reduce result limit
codebase-memory-mcp config set semantic_limit 10# Check watcher status
codebase-memory-mcp status
# Restart watcher
codebase-memory-mcp watch restart
# Increase file watch limit (Linux)
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p1. "Index this project"
2. "Show me the architecture"
3. "What are the entry points?"
4. "Find the main HTTP routes"
5. "Show me the most important functions" (hotspots)1. "Find all callers of [function]"
2. "What's affected by my changes?" (after editing)
3. "Show me the call chain from [entry] to [target]"
4. "Find dead code"1. "Trace execution from [function]"
2. "What calls this endpoint?" (for HTTP routes)
3. "Find similar functions to [name]"
4. "Show data flow through [function]"1. "Find all external API calls"
2. "Show services that depend on [service]"
3. "Map HTTP routes to implementations"
4. "Find pub-sub channels across repos"| Tool | Purpose |
|---|---|
| Index codebase into knowledge graph |
| Structural search by pattern, label, degree |
| Graph-augmented grep |
| Vector search with bundled embeddings |
| Full architectural summary |
| Find all callers of a symbol |
| Trace call chains (in/out) |
| Advanced graph queries |
| Detect unused functions |
| Git diff impact analysis |
| Architecture Decision Records |
| Context for specific symbols |
| All HTTP/gRPC/GraphQL routes |
| Cross-service dependency graph |
# Check for updates
codebase-memory-mcp update
# Auto-update check on startup (default: enabled)
codebase-memory-mcp config set check_updates true# Remove all agent configs and binary
codebase-memory-mcp uninstall
# Keep database (default)
# Or remove database too:
rm -rf ~/.cache/codebase-memory-mcp/