|
| 1 | +# Installing `mcpd` |
| 2 | + |
| 3 | +## via Homebrew |
| 4 | + |
| 5 | +Add the Mozilla.ai tap: |
| 6 | + |
| 7 | +```bash |
| 8 | +brew tap mozilla-ai/tap |
| 9 | +``` |
| 10 | + |
| 11 | +Then install `mcpd`: |
| 12 | + |
| 13 | +```bash |
| 14 | +brew install mcpd |
| 15 | +``` |
| 16 | + |
| 17 | +Or install directly from the cask: |
| 18 | + |
| 19 | +```bash |
| 20 | +brew install --cask mozilla-ai/tap/mcpd |
| 21 | +``` |
| 22 | + |
| 23 | +## via GitHub releases |
| 24 | + |
| 25 | +Official releases can be found on the [mcpd GitHub releases page](https://github.com/mozilla-ai/mcpd/releases). |
| 26 | + |
| 27 | +The following is an example of manually downloading and installing `mcpd` using `curl` and `jq` by running `install_mcpd`: |
| 28 | + |
| 29 | +```bash |
| 30 | +function install_mcpd() { |
| 31 | + command -v curl >/dev/null || { echo "curl not found"; return 1; } |
| 32 | + command -v jq >/dev/null || { echo "jq not found"; return 1; } |
| 33 | + |
| 34 | + latest_version=$(curl -s https://api.github.com/repos/mozilla-ai/mcpd/releases/latest | jq -r .tag_name) |
| 35 | + os=$(uname) |
| 36 | + arch=$(uname -m) |
| 37 | + |
| 38 | + zip_name="mcpd_${os}_${arch}.tar.gz" |
| 39 | + url="https://github.com/mozilla-ai/mcpd/releases/download/${latest_version}/${zip_name}" |
| 40 | + |
| 41 | + echo "Downloading: $url" |
| 42 | + curl -sSL "$url" -o "$zip_name" || { echo "Download failed"; return 1; } |
| 43 | + |
| 44 | + echo "Extracting: $zip_name" |
| 45 | + tar -xzf "$zip_name" mcpd || { echo "Extraction failed"; return 1; } |
| 46 | + |
| 47 | + echo "Installing to /usr/local/bin" |
| 48 | + sudo mv mcpd /usr/local/bin/mcpd && sudo chmod +x /usr/local/bin/mcpd || { echo "Install failed"; return 1; } |
| 49 | + |
| 50 | + rm -f "$zip_name" |
| 51 | + echo "mcpd installed successfully" |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +## via local Go binary build |
| 56 | + |
| 57 | +```bash |
| 58 | +# Clone the Git repo |
| 59 | +git clone git@github.com:mozilla-ai/mcpd.git |
| 60 | +cd mcpd |
| 61 | +# Checkout a specific tag (or build latest main) |
| 62 | +git fetch --tags |
| 63 | +git checkout v0.0.3 |
| 64 | +# Use Makefile commands to build and install mcpd |
| 65 | +make build |
| 66 | +sudo make install # Installs mcpd 'globally' to /usr/local/bin |
| 67 | +``` |
| 68 | + |
| 69 | +## Run with Docker |
| 70 | + |
| 71 | +`mcpd` is available as the Docker image [mzdotai/mcpd](https://hub.docker.com/repository/docker/mzdotai/mcpd/general). |
| 72 | + |
| 73 | +!!! note "Dockerfile environment variables" |
| 74 | + The [Dockerfile](https://github.com/mozilla-ai/mcpd/blob/main/Dockerfile) defines sensible defaults for configuration via environment variables. These can be overridden at runtime using `docker run -e KEY=VALUE`. |
| 75 | + |
| 76 | +### Default environment variables |
| 77 | + |
| 78 | +| Name | Default Value | |
| 79 | +|---------------------|--------------------------------------------| |
| 80 | +| `MCPD_API_PORT` | `8090` | |
| 81 | +| `MCPD_LOG_LEVEL` | `info` | |
| 82 | +| `MCPD_LOG_PATH` | `/var/log/mcpd/mcpd.log` | |
| 83 | +| `MCPD_CONFIG_FILE` | `/etc/mcpd/.mcpd.toml` | |
| 84 | +| `MCPD_RUNTIME_FILE` | `/home/mcpd/.config/mcpd/secrets.prd.toml` | |
| 85 | + |
| 86 | + |
| 87 | +To run `mcpd` with Docker, map the required port and bind mount your `.mcpd.toml` configuration file and runtime secrets file: |
| 88 | + |
| 89 | +```bash |
| 90 | +docker run -p 8090:8090 \ |
| 91 | + -v $PWD/.mcpd.toml:/etc/mcpd/.mcpd.toml \ |
| 92 | + -v $HOME/.config/mcpd/secrets.dev.toml:/home/mcpd/.config/mcpd/secrets.prd.toml \ |
| 93 | + -e MCPD_LOG_LEVEL=debug \ |
| 94 | + mzdotai/mcpd:v0.0.3 |
| 95 | +``` |
0 commit comments