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

> Explore utility scripts and command-line tools in DeusData/codebase-memory-mcp. Automate installation, building, testing, and security audits for the MCP binary with this developer guide.

- Repository: [Martin Vogel/codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp)
- Tags: how-to-guide
- Published: 2026-07-14

---

**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`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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:

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

```

### One-Line Installers for Unix and Windows

For quick installation, the repository provides [`scripts/install.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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`](https://github.com/DeusData/codebase-memory-mcp/blob/main/setup.sh) under the hood while exposing the `--ui` flag to install the optional UI variant:

```bash

# 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`](https://github.com/DeusData/codebase-memory-mcp/blob/main/setup.sh) with native PowerShell conventions.

## Build and Development Tools

### Compiling from Source with build.sh

The [`scripts/build.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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/`:

```bash
./scripts/build.sh

```

### Grammar Management with vendor-grammar.sh

When adding new language support, developers use [`scripts/vendor-grammar.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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:

```bash
./scripts/test.sh

```

### Rapid Initialization Testing

For CI pipelines requiring fast validation, [`scripts/test_mcp_rapid_init.py`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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`](https://github.com/DeusData/codebase-memory-mcp/blob/main/scripts/smoke-test.sh)**: Performs simple runtime sanity checks to verify basic functionality
- **[`scripts/soak-test.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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:

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

```

## Code Quality and Security Scripts

### Static Analysis with lint.sh

The [`scripts/lint.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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:

```bash
./scripts/lint.sh

```

### Security Auditing

The security-focused command-line tools include:

- **[`scripts/security-audit.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/scripts/security-audit.sh)**: Verifies checksums of vendored sources and audits known-vulnerability patterns
- **[`scripts/security-fuzz.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/scripts/security-fuzz.sh)**: Performs fuzz testing of the binary interface to identify edge cases and potential security vulnerabilities

## Compliance and Maintenance Utilities

### License Compliance

The [`scripts/license-gate.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/scripts/license-gate.sh) and [`scripts/license-gate-check.py`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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`](https://github.com/DeusData/codebase-memory-mcp/blob/main/license-policy.json) to validate compatibility:

```bash
./scripts/license-gate.sh

```

### Language Support Configuration

The [`scripts/new-languages.json`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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:

```bash
./scripts/install.sh

```

Then build from source when developing:

```bash
./scripts/build.sh

```

Validate your changes with the test suite:

```bash
./scripts/test.sh
./scripts/smoke-test.sh

```

Before committing, ensure compliance and quality:

```bash
./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`](https://github.com/DeusData/codebase-memory-mcp/blob/main/setup.sh), [`install.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/install.sh), and `install.ps1`, supporting both pre-built binaries and source compilation with the `--from-source` flag.
- **Building** from source uses [`build.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/build.sh), which wraps the vendored `make` targets and outputs to `build/c/`.
- **Testing** utilities include [`test.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/test.sh) for full Docker-based suites, [`test_mcp_rapid_init.py`](https://github.com/DeusData/codebase-memory-mcp/blob/main/test_mcp_rapid_init.py) for rapid CI validation, and [`smoke-test.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/smoke-test.sh)/[`soak-test.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/soak-test.sh) for runtime verification.
- **Quality assurance** relies on [`lint.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/lint.sh) for static analysis and [`security-audit.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/security-audit.sh) for vulnerability scanning.
- **Compliance** is enforced by [`license-gate.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/license-gate.sh) and [`license-gate-check.py`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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`](https://github.com/DeusData/codebase-memory-mcp/blob/main/scripts/setup.sh) script or the one-line [`scripts/install.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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`](https://github.com/DeusData/codebase-memory-mcp/blob/main/scripts/smoke-test.sh) utility performs quick runtime sanity checks to verify basic functionality, while [`scripts/soak-test.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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`](https://github.com/DeusData/codebase-memory-mcp/blob/main/scripts/license-gate.sh) script, assisted by [`scripts/license-gate-check.py`](https://github.com/DeusData/codebase-memory-mcp/blob/main/scripts/license-gate-check.py), parses the [`license-policy.json`](https://github.com/DeusData/codebase-memory-mcp/blob/main/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.