Utility Scripts and Command-Line Tools in codebase-memory-mcp: A Complete Developer Guide

The codebase-memory-mcp repository includes a comprehensive suite of utility scripts and command-line tools located in the scripts/ directory that automate installation, building, testing, linting, security auditing, and license compliance for the MCP binary.

The DeusData/codebase-memory-mcp project ships with a complete toolchain of helper scripts that enable developers to install, build, and verify the binary without external dependencies. These utility scripts and command-line tools live under the top-level scripts/ directory and provide thin wrappers around the core codebase-memory-mcp binary, invoking sub-commands such as index_repository, search_graph, and trace_path to provide a full development workflow.

Installation Scripts

Cross-Platform Setup with setup.sh

The scripts/setup.sh script serves as the platform-agnostic installer that handles binary deployment and environment configuration. This utility downloads pre-built artifacts, performs checksum verification, and places the binary into ~/.local/bin with colorized output and automatic cleanup.

To build from source instead of downloading pre-built binaries, pass the --from-source flag:

./scripts/setup.sh --from-source

One-Line Installers for Unix and Windows

For quick installation, the repository provides scripts/install.sh (macOS/Linux) and scripts/install.ps1 (Windows). These command-line tools implement the "curl-pipe-bash" pattern and PowerShell equivalents, respectively, delegating to setup.sh under the hood while exposing the --ui flag to install the optional UI variant:


# macOS/Linux one-line installation

curl -sSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/install.sh | bash

# With UI variant

curl -sSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/install.sh | bash -s -- --ui

Windows-Specific Setup

The scripts/setup-windows.ps1 script provides PowerShell-specific path handling and environment configuration for Windows-only environments, offering the same functionality as setup.sh with native PowerShell conventions.

Build and Development Tools

Compiling from Source with build.sh

The scripts/build.sh utility acts as a convenience wrapper for compiling the static binary and optional UI binary from source. This script runs the vendored make targets and places all build artifacts under build/c/:

./scripts/build.sh

Grammar Management with vendor-grammar.sh

When adding new language support, developers use scripts/vendor-grammar.sh to regenerate vendored Tree-Sitter grammar files. This command-line tool synchronizes upstream grammar changes into the repository's internal parser infrastructure.

Testing Utilities

Full Test Suite with test.sh

The scripts/test.sh utility executes the complete test suite using the project's internal test-infrastructure Docker images. It pulls the appropriate Dockerfile, builds a container, and runs make test inside the isolated environment:

./scripts/test.sh

Rapid Initialization Testing

For CI pipelines requiring fast validation, scripts/test_mcp_rapid_init.py provides a Python-based fast-path that spins up a minimal MCP server instance. This script validates that the binary can start without requiring a full index generation, reducing feedback time in continuous integration workflows.

Runtime Verification

The repository includes two distinct command-line tools for runtime validation:

  • scripts/smoke-test.sh: Performs simple runtime sanity checks to verify basic functionality
  • scripts/soak-test.sh: Executes long-duration stress tests that repeatedly invoke MCP tools to detect memory leaks or crashes under sustained load

CI Reproduction with repro.sh

When builds fail in continuous integration, scripts/repro.sh helps developers reproduce failures locally. This utility checks out a specific commit, builds the binary, and runs the failing test in an environment matching CI:

./scripts/repro.sh <commit-hash> <test-command>

Code Quality and Security Scripts

Static Analysis with lint.sh

The scripts/lint.sh utility runs comprehensive static analysis across the codebase using clang-tidy, cppcheck, and shellcheck. This script is invoked by CI pipelines to enforce code quality standards and catch potential issues before merge:

./scripts/lint.sh

Security Auditing

The security-focused command-line tools include:

Compliance and Maintenance Utilities

License Compliance

The scripts/license-gate.sh and scripts/license-gate-check.py utilities enforce that all vendored dependencies comply with the project's license policy. The Python helper parses license-policy.json to validate compatibility:

./scripts/license-gate.sh

Language Support Configuration

The scripts/new-languages.json file provides a declarative list of language IDs and their associated Tree-Sitter grammar sources. The build system consumes this configuration to vend new language support during compilation.

How to Use These Scripts

These utility scripts and command-line tools are designed to work together in a standard development workflow. First, install the binary:

./scripts/install.sh

Then build from source when developing:

./scripts/build.sh

Validate your changes with the test suite:

./scripts/test.sh
./scripts/smoke-test.sh

Before committing, ensure compliance and quality:

./scripts/lint.sh
./scripts/license-gate.sh
./scripts/security-audit.sh

Summary

  • The codebase-memory-mcp repository maintains all utility scripts in the top-level scripts/ directory, providing a self-contained development environment.
  • Installation is handled by setup.sh, install.sh, and install.ps1, supporting both pre-built binaries and source compilation with the --from-source flag.
  • Building from source uses build.sh, which wraps the vendored make targets and outputs to build/c/.
  • Testing utilities include test.sh for full Docker-based suites, test_mcp_rapid_init.py for rapid CI validation, and smoke-test.sh/soak-test.sh for runtime verification.
  • Quality assurance relies on lint.sh for static analysis and security-audit.sh for vulnerability scanning.
  • Compliance is enforced by license-gate.sh and license-gate-check.py, ensuring all dependencies meet the project's license policy.

Frequently Asked Questions

Where are the utility scripts located in the codebase-memory-mcp repository?

All utility scripts and command-line tools are located in the scripts/ directory at the repository root. This includes installation helpers, build wrappers, testing utilities, and security auditing tools that support the core MCP binary.

How do I install the codebase-memory-mcp binary without building from source?

Use the scripts/setup.sh script or the one-line scripts/install.sh for Unix systems. These scripts download pre-built binaries, verify checksums, and install to ~/.local/bin automatically. For Windows, use scripts/install.ps1 or scripts/setup-windows.ps1 for PowerShell-specific handling.

What is the difference between smoke-test.sh and soak-test.sh?

The scripts/smoke-test.sh utility performs quick runtime sanity checks to verify basic functionality, while scripts/soak-test.sh executes long-duration stress tests that repeatedly invoke MCP tools to detect memory leaks, crashes, or stability issues under sustained load.

How does the license compliance system work?

The scripts/license-gate.sh script, assisted by scripts/license-gate-check.py, parses the license-policy.json file to verify that all vendored dependencies comply with the project's license requirements. This prevents incompatible licenses from entering the codebase during the build process.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →