Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DeusData/codebase-memory-mcp/llms.txt

Use this file to discover all available pages before exploring further.

Every one of the 14 MCP tools is directly accessible from the terminal — no agent, no MCP client, no JSON-RPC handshake required. CLI mode is ideal for CI/CD pipelines, shell scripts, quick one-off queries, and debugging the knowledge graph without opening an IDE.

CLI Syntax

codebase-memory-mcp cli <tool_name> '<json_args>'
Pass the tool name followed by a single JSON string containing the tool’s arguments. Quotes and escaping follow your shell’s normal rules.

Common Examples

# Index a repository
codebase-memory-mcp cli index_repository '{"repo_path": "/path/to/repo"}'

# Search for functions matching a pattern
codebase-memory-mcp cli search_graph '{"name_pattern": ".*Handler.*", "label": "Function"}'

# Trace callers and callees of a function
codebase-memory-mcp cli trace_path '{"function_name": "Search", "direction": "both"}'

# Run a Cypher-like graph query
codebase-memory-mcp cli query_graph '{"query": "MATCH (f:Function) RETURN f.name LIMIT 5"}'

# List all indexed projects
codebase-memory-mcp cli list_projects

# Pipe raw JSON output to jq
codebase-memory-mcp cli --raw search_graph '{"label": "Function"}' | jq '.results[].name'

The --raw Flag

By default, CLI output is formatted for human readability. Add --raw before the tool name to get unformatted JSON on stdout, suitable for piping to jq or other tools:
codebase-memory-mcp cli --raw search_graph '{"label": "Function"}' | jq '.results[].name'

Management Commands

These top-level commands control the binary and agent configuration — they are separate from the cli subcommand and do not take JSON arguments.
# Auto-detect and configure all installed agents
codebase-memory-mcp install

# Remove all agent configs, hooks, and instruction files
codebase-memory-mcp uninstall

Auto-Index Configuration

Enable automatic indexing so that new projects are indexed the moment an MCP session starts:
codebase-memory-mcp config set auto_index true
Limit how many files are considered for auto-indexing (default is 50,000):
codebase-memory-mcp config set auto_index_limit 50000
When auto_index is enabled, previously-indexed projects are also registered with the background watcher for ongoing git-based change detection, so the graph stays fresh without any manual re-indexing.

Use Cases

CI/CD Integration

Run cli index_repository in your pipeline after checkout to pre-build the graph artifact. Combine with cli detect_changes to annotate pull requests with affected symbols.

Shell Scripting

Use --raw and jq to extract structured data — dead functions, import lists, route inventories — and pipe them into other tools or reports.

Debugging

Reproduce unexpected agent behaviour by replaying the exact tool call from your terminal. Compare JSON output before and after reindexing to confirm the graph is correct.

All 14 Tools via CLI

Any tool that works over MCP works identically from the command line. Here is a quick reference:
ToolExample JSON
index_repository{"repo_path": "/abs/path"}
list_projects{}
delete_project{"project": "my-repo"}
index_status{"project": "my-repo"}
search_graph{"name_pattern": ".*Auth.*", "label": "Class"}
trace_path{"function_name": "HandleRequest", "direction": "inbound"}
detect_changes{"project": "my-repo"}
query_graph{"query": "MATCH (f:Function) WHERE f.name =~ '.*Test.*' RETURN f.name"}
get_graph_schema{"project": "my-repo"}
get_code_snippet{"qualified_name": "my-repo.src.main.HandleRequest"}
get_architecture{"project": "my-repo"}
search_code{"pattern": "TODO", "project": "my-repo"}
manage_adr{"action": "list", "project": "my-repo"}
ingest_traces{"project": "my-repo", "traces": [...]}
All paths passed to CLI tools must be absolute paths. Relative paths are not resolved against the current working directory.

Build docs developers (and LLMs) love