> For the complete documentation index, see [llms.txt](https://docs.mozilla.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mozilla.ai/mcpd/reference/makefile.md).

# Makefile

The `mcpd` project includes a `Makefile` to streamline common developer tasks.

{% hint style="warning" %}
**Running make**

All commands should be run from the **root of the repository**.
{% endhint %}

***

## Commands

{% hint style="info" %}
**Environment**

Most commands assume you have Go installed and available in your `PATH`.
{% endhint %}

### 🧱 Build

* **Build the binary**

  ```bash
  make build
  ```

  <div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p><strong>Architectures and Operating Systems</strong></p><p>You can explicitly build the binary for a different architecture (<code>amd64/arm64</code>) or operating systems with:</p><ul><li><code>make build-linux</code></li><li><code>make build-linux-arm64</code></li></ul></div>
* **Remove the compiled binary from the working directory**

  ```bash
  make clean
  ```
* **Install the binary to your system (typically `/usr/local/bin`)**

  ```bash
  sudo make install
  ```

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Dependency</strong></p><p>The <code>install</code> target relies on the standard <code>build</code> target.</p></div>
* **Uninstall the binary**

  ```bash
  sudo make uninstall
  ```

***

### 🧪 Test

* **Run all Go tests**

  ```bash
  make test
  ```

***

### ✅ Validation

* **Run linter with auto-fix**

  ```bash
  make lint
  ```
* **Validate Mozilla AI registry against JSON schema**

  ```bash
  make validate-registry
  ```

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>When to use</strong></p><p>Run this command before submitting PRs that modify:</p><ul><li><code>internal/provider/mozilla_ai/data/registry.json</code></li><li><code>internal/provider/mozilla_ai/data/schema.json</code></li></ul></div>

***

### 📜 License and Attribution

* **Check dependency licenses**

  ```bash
  make check-licenses
  ```

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Allowed licenses</strong></p><p>This validates that all dependencies use one of: <code>Apache-2.0</code>, <code>MIT</code>, <code>BSD-2-Clause</code>, <code>BSD-3-Clause</code>, <code>ZeroBSD</code>, or <code>Unlicense</code>.</p></div>
* **Check NOTICE file is up to date**

  ```bash
  make check-notice
  ```
* **Generate NOTICE file**

  ```bash
  make notice
  ```

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Third-party attribution</strong></p><p>Regenerates the NOTICE file with current dependency license information.</p></div>

***

### 🐳 Run

* **Start `mcpd` in a container**

  ```bash
  make local-up
  ```

  <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p><strong>Default files</strong></p><p>By default the following files will be mounted to the container:</p><ul><li><code>.mcpd.toml</code> - the project configuration file in this repository</li><li><code>~/.config/mcpd/secrets.dev.toml</code> - the default location for runtime configuration</li></ul></div>
* **Stop mcpd**

  ```bash
  make local-down
  ```

***

### 📝 Documentation

These commands build the [GitBook](https://docs.mozilla.ai/mcpd) documentation site for `mcpd`.

{% hint style="info" %}
**Environment**

Docs commands assume you have `uv` installed and available in your `PATH` (in addition to Go).
{% endhint %}

* **Generate CLI reference docs from the Cobra commands**

  ```bash
  make docs-cli
  ```
* **Generate the OpenAPI specification**

  ```bash
  make docs-api
  ```
* **Build the GitBook site into `site/` (runs the generators first)**

  ```bash
  make docs
  ```

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Previewing</strong></p><p>GitBook renders the published site from the <code>gitbook-docs</code> branch, so there is no local dev server. <code>make docs</code> assembles the publishable Markdown into <code>site/</code> for inspection.</p></div>

***

## 🧭 Target Reference

Here's a complete list of Makefile targets:

| Target              | Description                                              |
| ------------------- | -------------------------------------------------------- |
| `build`             | Compile the Go binary                                    |
| `build-dev`         | Compile the Go binary for development (no optimizations) |
| `build-linux`       | Compile the Go binary for Linux on amd64                 |
| `build-linux-arm64` | Compile the Go binary for Linux on arm64                 |
| `check-licenses`    | Validate all dependency licenses are allowed             |
| `check-notice`      | Verify NOTICE file is up to date                         |
| `clean`             | Remove compiled binary from working directory            |
| `docs`              | Build the GitBook documentation site into `site/`        |
| `docs-api`          | Generate the OpenAPI specification                       |
| `docs-cli`          | Generate CLI reference docs from the Cobra commands      |
| `install`           | Install binary to system path                            |
| `lint`              | Run linter with auto-fix (includes check-notice)         |
| `local-down`        | Stop a running `mcpd` Docker container                   |
| `local-up`          | Start `mcpd` in a Docker container                       |
| `notice`            | Generate NOTICE file with dependency licenses            |
| `test`              | Run all Go tests (includes lint)                         |
| `uninstall`         | Remove installed binary                                  |
| `validate-registry` | Validate Mozilla AI registry JSON schema                 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mozilla.ai/mcpd/reference/makefile.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
