### Basic CLI Usage Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/pkg/npm/README.md Demonstrates common commands for managing the codebase-memory-mcp installation and checking its status. Use 'install' to configure agents, '--version' to check the version, '--help' for assistance, 'update' to get the latest release, and 'uninstall' to remove configurations. ```bash codebase-memory-mcp install # configure all detected coding agents codebase-memory-mcp --version codebase-memory-mcp --help codebase-memory-mcp update # update to latest release codebase-memory-mcp uninstall # remove agent configs ``` -------------------------------- ### Automated Setup Script for Windows (PowerShell) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Use this PowerShell command to automatically download and install the tool on Windows systems. ```powershell irm https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/setup-windows.ps1 | iex ``` -------------------------------- ### One-line Install (macOS/Linux) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Installs the codebase-memory-mcp tool using a curl command. This is the quickest way to get started on macOS and Linux systems. ```bash curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash ``` -------------------------------- ### Manual Install (macOS/Linux) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Manual installation steps for macOS and Linux. This involves downloading the archive, extracting it, and running the install script. ```bash tar xzf codebase-memory-mcp-*.tar.gz ./install.sh ``` -------------------------------- ### Automated Setup Script for macOS/Linux Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Use this curl command to automatically download and install the tool on macOS and Linux systems. ```bash curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/setup.sh | bash ``` -------------------------------- ### Start Graph Visualization UI Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Starts the codebase-memory-mcp graph visualization UI on a specified port. This command is used when the UI variant of the tool is installed. ```bash codebase-memory-mcp --ui=true --port=9749 ``` -------------------------------- ### One-line Install with UI (macOS/Linux) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Installs the codebase-memory-mcp tool along with its graph visualization UI. This command appends the --ui flag to the standard installation script. ```bash curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --ui ``` -------------------------------- ### Manual Install (Windows) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Manual installation steps for Windows. This involves extracting the zip archive and running the PowerShell install script. ```powershell Expand-Archive codebase-memory-mcp-windows-amd64.zip -DestinationPath . .\install.ps1 ``` -------------------------------- ### Install and configure coding agents with codebase-memory-mcp Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/pkg/pypi/README.md Use the 'install' command to configure your coding agents with the codebase-memory-mcp. This command prepares the environment for the agent. ```bash codebase-memory-mcp install ``` -------------------------------- ### Install codebase-memory-mcp Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/pkg/npm/README.md Installs the codebase-memory-mcp package globally using npm. The binary for your platform is downloaded automatically during installation. ```bash npm install -g codebase-memory-mcp ``` -------------------------------- ### Install via AUR (Arch Linux) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Install the codebase-memory-mcp-bin package using yay or paru on Arch Linux. ```bash yay -S codebase-memory-mcp-bin ``` ```bash paru -S codebase-memory-mcp-bin ``` -------------------------------- ### Clone and Build C Project Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/CONTRIBUTING.md Clone the repository, navigate to the directory, configure Git hooks, and build the C project. Ensure you have the necessary C compiler, make, and zlib installed. ```bash git clone https://github.com/DeusData/codebase-memory-mcp.git cd codebase-memory-mcp git config core.hooksPath scripts/hooks # activates pre-commit security checks scripts/build.sh ``` -------------------------------- ### Example Agent Query for Tracing Function Calls Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md This example demonstrates how an agent interacts with codebase-memory-mcp to trace function calls. The agent translates a natural language query into a structured graph query, which codebase-memory-mcp then executes. ```text You: "what calls ProcessOrder?" Agent calls: trace_path(function_name="ProcessOrder", direction="inbound") codebase-memory-mcp: executes graph query, returns structured results Agent: presents the call chain in plain English ``` -------------------------------- ### Install Codebase-Memory MCP (macOS/Linux) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/index.html Installs the codebase-memory-mcp using a single curl command. Add the --ui flag to enable the 3D graph visualization. ```bash # 1. One-line install (macOS / Linux). Add --ui for the 3D graph UI. curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash ``` -------------------------------- ### Install codebase-memory-mcp using pipx Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/pkg/pypi/README.md Install the package using pipx, which provides isolated Python installations. This is useful for command-line applications. ```bash pipx install codebase-memory-mcp ``` -------------------------------- ### Install codebase-memory-mcp using pip Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/pkg/pypi/README.md Install the package using pip. This is the standard method for adding Python packages to your project. ```bash pip install codebase-memory-mcp ``` -------------------------------- ### Conventional Commit Examples Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/CONTRIBUTING.md Examples of conventional commit messages for different types of changes. ```git fix(store): set busy_timeout before WAL ``` ```git feat(cli): add --progress flag ``` -------------------------------- ### Start ETW Tracing with WPR Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/vendored/mimalloc/src/prim/windows/readme.md Use this command in an administrator prompt to start Windows Performance Recorder (WPR) with the mimalloc profile. This profile captures mimalloc events for later analysis. ```bash > wpr -start src\prim\windows\etw-mimalloc.wprp -filemode ``` -------------------------------- ### Cypher-like Query Example Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Demonstrates a Cypher-like query to find functions that call the 'main' function and return the names of the functions they call. This is useful for understanding call hierarchies. ```cypher MATCH (f:Function)-[:CALLS]->(g) WHERE f.name = 'main' RETURN g.name ``` -------------------------------- ### Windows Install Script Download Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Downloads the PowerShell installation script for codebase-memory-mcp on Windows. It's recommended to inspect the script before running it. ```powershell # 1. Download the installer Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1 # 2. (Optional but recommended) Inspect the script notepad install.ps1 # 3. Run it .\install.ps1 ``` -------------------------------- ### CLI Search Graph Example Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Shows how to use the CLI to perform a structural search on the graph, filtering for nodes with names matching a specific pattern. This is useful for finding specific types of code elements. ```bash codebase-memory-mcp cli search_graph '{"name_pattern": ".*Handler.*"}' ``` -------------------------------- ### Configure Coding Agents Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/pkg/npm/README.md After global installation, run this command to configure your detected coding agents to use codebase-memory-mcp. Restart your agent afterward and prompt it to index the project. ```bash codebase-memory-mcp install ``` -------------------------------- ### Install Git Hooks for DCO Check Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/CONTRIBUTING.md Install local Git hooks to automatically reject commits that do not include the 'Signed-off-by' trailer, ensuring DCO compliance. ```bash scripts/install-git-hooks.sh ``` -------------------------------- ### Enable Auto Indexing Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Configures codebase-memory-mcp to automatically index new projects on session start. This command also shows how to set a file limit for auto-indexing. ```bash codebase-memory-mcp config set auto_index true ``` ```bash codebase-memory-mcp config set auto_index_limit 50000 ``` -------------------------------- ### CLI Mode: Get Architecture Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/pkg/npm/README.md Retrieves the architectural overview of the indexed project using the 'get_architecture' MCP tool. An empty JSON object is passed as there are no required parameters. ```bash codebase-memory-mcp cli get_architecture '{}' ``` -------------------------------- ### Add Codebase Memory MCP Binary to PATH Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md If the binary is not found after installation, add its directory to your system's PATH environment variable. This allows running the binary from any location. ```bash export PATH="$HOME/.local/bin:$PATH" ``` -------------------------------- ### Update Codebase Memory MCP Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Checks for and installs the latest version of the codebase-memory-mcp tool. The server also checks for updates on startup. ```bash codebase-memory-mcp update ``` -------------------------------- ### CLI Mode: Search Graph Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/pkg/npm/README.md Searches the code graph for entities matching a given name pattern and label using the 'search_graph' MCP tool. This example searches for functions named '.*Handler.*'. ```bash codebase-memory-mcp cli search_graph '{"name_pattern": ".*Handler.*", "label": "Function"}' ``` -------------------------------- ### CLI Mode: Trace Call Path Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/pkg/npm/README.md Traces the call path of a specific function in both directions using the 'trace_call_path' MCP tool. This example traces calls for the 'main' function. ```bash codebase-memory-mcp cli trace_call_path '{"function_name": "main", "direction": "both"}' ``` -------------------------------- ### Build from Source Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Clone the repository and use the build script to compile the tool. The standard binary is built by default, or use the --with-ui flag for the graph visualization version. The binary will be located in build/c/. ```bash git clone https://github.com/DeusData/codebase-memory-mcp.git cd codebase-memory-mcp scripts/build.sh # standard binary scripts/build.sh --with-ui # with graph visualization # Binary at: build/c/codebase-memory-mcp ``` -------------------------------- ### List, Set, and Reset Configuration Settings Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Use these commands to view all settings, modify specific configurations like auto-indexing, or revert to default values. ```bash codebase-memory-mcp config list codebase-memory-mcp config set auto_index true codebase-memory-mcp config set auto_index_limit 50000 codebase-memory-mcp config reset auto_index ``` -------------------------------- ### Display help for codebase-memory-mcp Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/pkg/pypi/README.md Access the help information for the codebase-memory-mcp command-line tool to understand available options and commands. ```bash codebase-memory-mcp --help ``` -------------------------------- ### Run Project Tests Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/CONTRIBUTING.md Execute the test suite for the C project. This command builds the project with AddressSanitizer (ASan) and UndefinedBehaviorSanitizer (UBSan) enabled and runs all test cases. ```bash scripts/test.sh ``` -------------------------------- ### Get Code Snippet (TSX) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Retrieves a specific code snippet from a file. Used for Q5 in the shadcn-tsx benchmark. ```tsx get_code_snippet(cn) ``` -------------------------------- ### Configure Custom File Extensions (Per-Project) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Map additional file extensions to supported languages for a specific project. Place this JSON file in your repository's root. ```json // .codebase-memory.json {"extra_extensions": {'.blade.php': 'php', '.mjs': 'javascript'}} ``` -------------------------------- ### Get Django Code Snippet Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Retrieves a specific code snippet from the Django project, identified by its file path and line range. ```python get_code_snippet ``` -------------------------------- ### Get Django Graph Schema Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Retrieves the schema statistics for a Django project, including node and edge counts, labels, and relationship types. ```python get_graph_schema ``` -------------------------------- ### Reset Codebase Memory MCP Cache Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md To reset the SQLite database and clear all persisted data, remove the cache directory. This is useful for starting fresh. ```bash rm -rf ~/.cache/codebase-memory-mcp/ ``` -------------------------------- ### Configure Custom File Extensions (Global) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Map additional file extensions to supported languages globally for all projects. This configuration applies if no per-project configuration exists. ```json // ~/.config/codebase-memory-mcp/config.json (or $XDG_CONFIG_HOME/...) {"extra_extensions": {'.twig': 'html', '.phtml': 'php'}} ``` -------------------------------- ### List Indexed Projects using CLI Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md The `list_projects` command provides a summary of all indexed projects, including their respective node and edge counts. ```bash codebase-memory-mcp cli list_projects ``` -------------------------------- ### Index a Repository using CLI Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Use the `index_repository` command to add a code repository to the graph. Auto-sync ensures the index remains up-to-date. ```bash codebase-memory-mcp cli index_repository '{"repo_path": "/path/to/repo"}' ``` -------------------------------- ### Run Project Linter Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/CONTRIBUTING.md Run the project's linting tools, including clang-tidy, cppcheck, and clang-format. All linting checks must pass before committing code, as enforced by the pre-commit hook. ```bash scripts/lint.sh ``` -------------------------------- ### Define Procedure with Tilde Parameters Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/tools/tree-sitter-magma/test/corpus/functions.txt Procedures using the tilde (~) prefix for parameters indicate pass-by-reference semantics. This is useful for in-place modifications. ```magma procedure Swap(~x, ~y) t := x; x := y; y := t; end procedure; ``` -------------------------------- ### Verify SLSA Provenance Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/SECURITY.md Use this command to verify that a downloaded binary was produced by the project's CI, ensuring its origin and integrity. ```bash gh attestation verify --repo DeusData/codebase-memory-mcp ``` -------------------------------- ### Call a Procedure Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/tools/tree-sitter-form/test/corpus/procedures.txt Use the `#call` keyword followed by the procedure name and arguments to execute a procedure. ```form #call simplify(result) ``` -------------------------------- ### If Statement Syntax Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/tools/tree-sitter-form/test/corpus/control_flow.txt Demonstrates the basic syntax for an if statement, including a condition and a block to execute. The condition uses a function call with arguments and a comparison to a number. ```Tree-sitter Form if (count(x, 1) > 0) id x = 0; endif; ``` ```Tree-sitter Form (source_file (if_statement (binary_expression (function_application name: (identifier) (identifier) (number)) (number)) (substitution_statement (identifier) (number)))) ``` -------------------------------- ### CLI Mode: Index Repository Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/pkg/npm/README.md Indexes a specified code repository using the 'index_repository' MCP tool. Provide the repository path within a JSON object. ```bash codebase-memory-mcp cli index_repository '{"repo_path": "/path/to/repo"}' ``` -------------------------------- ### Running Test and Lint Scripts Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/CONTRIBUTING.md Execute these scripts to ensure code quality and test coverage before submitting changes. ```bash scripts/test.sh ``` ```bash scripts/lint.sh ``` -------------------------------- ### Manual MCP Configuration for Claude Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Add this JSON configuration to your ~/.claude/.mcp.json file (global) or a project-specific .mcp.json to manually configure the MCP server. Restart your agent after applying the configuration. ```json { "mcpServers": { "codebase-memory-mcp": { "command": "/path/to/codebase-memory-mcp", "args": [] } } } ``` -------------------------------- ### Verify SHA-256 Checksum Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/SECURITY.md Check the SHA-256 checksum of a downloaded file against a provided checksums file to ensure the file has not been corrupted or tampered with. ```bash sha256sum -c checksums.txt ``` -------------------------------- ### Query Graph (Go) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Executes a graph query. Used for Q9, Q10, and Q11 in the codebase-memory-mcp benchmark. ```go query_graph ``` ```go query_graph(properties) ``` ```go query_graph(IMPLEMENTS) ``` -------------------------------- ### Module Declaration Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/tools/tree-sitter-form/test/corpus/control_flow.txt Shows the syntax for declaring a module. This is used to organize code and define namespaces. ```Tree-sitter Form .sort ``` ```Tree-sitter Form (source_file (module_directive)) ``` -------------------------------- ### Query Graph with Cypher-like Syntax using CLI Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Execute read-only Cypher-like queries against the graph using the `query_graph` command. Supports basic graph traversal and data retrieval. ```bash codebase-memory-mcp cli query_graph '{"query": "MATCH (f:Function) RETURN f.name LIMIT 5"}' ``` -------------------------------- ### Search Graph by Name Pattern and Label using CLI Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Employ the `search_graph` command for structured searches within the graph, filtering by name patterns and node labels. ```bash codebase-memory-mcp cli search_graph '{"name_pattern": ".*Handler.*", "label": "Function"}' ``` -------------------------------- ### Query Graph in Java Project Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Queries the graph database for specific information in a Java project. Used for Q9 and Q10 in the Java benchmark. ```java query_graph ``` ```java query_graph(properties) ``` -------------------------------- ### Set Custom Cache Directory via Environment Variable Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Override the default storage location for project indexes and configuration by exporting the CBM_CACHE_DIR environment variable. ```bash # Store indexes in a custom directory export CBM_CACHE_DIR=~/my-projects/cbm-data ``` -------------------------------- ### Perform Security Audit Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/CONTRIBUTING.md Initiate a comprehensive security audit for the C project using the Makefile. This command runs multiple security layers, including static analysis, fuzzing, and integrity checks. ```makefile make -f Makefile.cbm security ``` -------------------------------- ### Index Repository with Absolute Path Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Ensure the `index_repository` function receives an absolute path to the repository to avoid errors. Use this when indexing specific projects. ```python index_repository(repo_path="/absolute/path") ``` -------------------------------- ### List Django Project Directory Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Lists the top-level directory entries for the Django project. ```python list_directory ``` -------------------------------- ### Define a Simple Procedure Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/tools/tree-sitter-form/test/corpus/procedures.txt Use the `#procedure` and `#endprocedure` keywords to define a procedure. Local variables can be declared within the procedure body. ```form #procedure simplify(expr) id x = 1; #endprocedure ``` -------------------------------- ### Trace Function Call Paths using CLI Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Utilize the `trace_path` command to perform a Breadth-First Search (BFS) traversal, identifying function callers and callees within a specified direction. ```bash codebase-memory-mcp cli trace_path '{"function_name": "Search", "direction": "both"}' ``` -------------------------------- ### Fetch and Display GitHub Releases Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/index.html This JavaScript code fetches the latest releases from a GitHub repository and renders them on the page. It includes functions for escaping HTML, rendering basic Markdown for release notes, and formatting dates. It handles potential errors by providing a fallback link to GitHub. ```javascript (function () { var REPO = 'DeusData/codebase-memory-mcp'; var listEl = document.getElementById('releases-list'); if (!listEl) return; function esc(s) { return String(s) .replace(/&/g, '&').replace(//g, '>') .replace(/"/g, '"'); } function renderMarkdown(md) { var lines = esc(md || '').split(/\r?\n/); var html = '', inList = false; function inline(t) { return t .replace(/`([^"]+)`/g, '$1') .replace(/\*\*([^"]+)\*\*/g, '$1') .replace(/\(\[([^\]]+)\]\((https?:\/\/[^\s]+)\)\)/g, '$2'); } for (var i = 0; i < lines.length; i++) { var ln = lines[i]; var h = ln.match(/^(#{1,6})\s+(.*)$/); var li = ln.match(/^\s*\[-\]\s+(.*)$/); if (h) { if (inList) { html += ''; inList = false; } var lvl = Math.min(h[1].length + 3, 6); html += '' + inline(h[2]) + ''; } else if (li) { if (!inList) { html += ''; inList = false; } } else { if (inList) { html += ''; inList = false; } html += '

' + inline(ln) + '

'; } } if (inList) html += ''; return html; } function fmtDate(iso) { if (!iso) return ''; var d = new Date(iso); if (isNaN(d)) return ''; return d.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' }); } function renderRelease(r) { var tag = esc(r.tag_name || r.name || 'release'); var name = r.name && r.name !== r.tag_name ? ' — ' + esc(r.name) : ''; var url = esc(r.html_url || ('https://github.com/' + REPO + '/releases')); var date = fmtDate(r.published_at); var body = (r.body || '').trim(); var bodyHtml = body ? '
Release notes
' + renderMarkdown(body) + '
' : '

View on GitHub →

'; return '
' + '
' + '' + tag + '' + name + '' + '' + date + '' + '
' + bodyHtml + '
'; } fetch('https://api.github.com/repos/' + REPO + '/releases?per_page=5', { headers: { 'Accept': 'application/vnd.github+json' } }) .then(function (res) { if (!res.ok) throw new Error('HTTP ' + res.status); return res.json(); }) .then(function (data) { if (!Array.isArray(data) || data.length === 0) throw new Error('no releases'); listEl.innerHTML = data.map(renderRelease).join(''); }) .catch(function () { listEl.innerHTML = '

Couldn\'t load releases right now — ' + 'view them on GitHub →

'; }); })(); ``` -------------------------------- ### Trace Call Path (Go) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Traces the call path of a function or method. Used for Q7 and Q8 in the codebase-memory-mcp benchmark. ```go trace_call_path(outbound) ``` ```go trace_call_path(inbound) ``` -------------------------------- ### Verify Sigstore Cosign Signature Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/SECURITY.md Verify the keyless signature of a binary using Sigstore cosign. This confirms the authenticity of the artifact without relying on traditional keys. ```bash cosign verify-blob --bundle .bundle ``` -------------------------------- ### Advanced Search with Raw Output and jq Filtering Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Perform a `search_graph` query with raw output enabled and pipe the results to `jq` for further processing, such as extracting specific fields like names. ```bash codebase-memory-mcp cli --raw search_graph '{"label": "Function"}' | jq '.results[].name' ``` -------------------------------- ### Filter Query Results by Project Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Add the `project` parameter to queries to narrow down results to a specific project. Use `list_projects` to obtain project names. ```python project="name" ``` -------------------------------- ### Search Graph with Connections (Lua) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Searches the code graph for nodes and includes connected nodes. Useful for finding a node and its immediate dependencies or dependents. ```lua search_graph(include_connected) ``` -------------------------------- ### Test Codebase Memory MCP Agent Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/README.md Verify the Codebase Memory MCP agent is running and outputting JSON by sending an empty JSON object to its expected input. ```bash echo '{}' | /path/to/binary ``` -------------------------------- ### VirusTotal Verification Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/SECURITY.md Utilize VirusTotal to scan downloaded binaries for malware or to check existing reports. Links to reports are often found in release notes. ```bash # https://www.virustotal.com/ ``` -------------------------------- ### Search Graph in Swift Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Used for analyzing Swift codebases, including indexing files, finding functions, classes, and searching by name patterns. Note that Swift properties are indexed as Fields. ```swift search_graph(File) ``` ```swift search_graph(Function) ``` ```swift search_graph(Class) ``` ```swift search_graph(name_pattern=Request) ``` ```swift get_code_snippet ``` ```swift search_code(TODO) ``` ```swift trace_call_path(write) ``` ```swift trace_call_path(inbound) ``` ```swift query_graph ``` ```swift search_graph(Variable) ``` ```swift search_graph(Module) ``` ```swift list_directory ``` -------------------------------- ### Search Graph by Name Pattern in Bash Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Searches the graph for nodes matching a name pattern, such as 'run', within the bats-core project. Identifies related functions or modules. ```bash search_graph(name_pattern=run) ``` -------------------------------- ### Magma While Loop Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/tools/tree-sitter-magma/test/corpus/control_flow.txt Use this while loop for conditional iteration. The loop continues as long as the condition evaluates to true. Ensure the condition is correctly formed. ```magma while n gt 0 do n := n - 1; end while; ``` -------------------------------- ### Search OCaml by Name Pattern Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Searches the OCaml graph for nodes matching a specific name pattern. ```ocaml search_graph(name_pattern=build) ``` -------------------------------- ### Search Graph (Go) Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Searches the graph for nodes or edges based on type or pattern. Used for Q2, Q3, and Q4 in the codebase-memory-mcp benchmark. ```go search_graph(Function) ``` ```go search_graph(Class) ``` ```go search_graph(name_pattern=test) ``` -------------------------------- ### Trace Outbound Calls in C++ Project Source: https://github.com/deusdata/codebase-memory-mcp/blob/main/docs/BENCHMARK.md Traces the outbound call path from a specific function in a C++ project. Used for Q7 in the C++ benchmark. ```cpp trace_call_path(push_back) ```