Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ CMD mcpd daemon \
--runtime-file $MCPD_RUNTIME_FILE

# Example run:
# docker run -p 8090:8090
# docker run -p 8090:8090 \
# -v $PWD/.mcpd.toml:/etc/mcpd/.mcpd.toml \
# -v HOME/.config/mcpd/secrets.dev.toml:/home/mcpd/.config/mcpd/secrets.prd.toml \
# -v $HOME/.config/mcpd/secrets.dev.toml:/home/mcpd/.config/mcpd/secrets.prd.toml \
# -e MCPD_LOG_LEVEL=debug \
# mzdotai/mcpd:v0.0.2
# mzdotai/mcpd:v0.0.3
95 changes: 95 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Installing `mcpd`

## via Homebrew

Add the Mozilla.ai tap:

```bash
brew tap mozilla-ai/tap
```

Then install `mcpd`:

```bash
brew install mcpd
```

Or install directly from the cask:

```bash
brew install --cask mozilla-ai/tap/mcpd
```

## via GitHub releases

Official releases can be found on the [mcpd GitHub releases page](https://github.com/mozilla-ai/mcpd/releases).

The following is an example of manually downloading and installing `mcpd` using `curl` and `jq` by running `install_mcpd`:

```bash
function install_mcpd() {
command -v curl >/dev/null || { echo "curl not found"; return 1; }
command -v jq >/dev/null || { echo "jq not found"; return 1; }

latest_version=$(curl -s https://api.github.com/repos/mozilla-ai/mcpd/releases/latest | jq -r .tag_name)
os=$(uname)
arch=$(uname -m)

zip_name="mcpd_${os}_${arch}.tar.gz"
url="https://github.com/mozilla-ai/mcpd/releases/download/${latest_version}/${zip_name}"

echo "Downloading: $url"
curl -sSL "$url" -o "$zip_name" || { echo "Download failed"; return 1; }

echo "Extracting: $zip_name"
tar -xzf "$zip_name" mcpd || { echo "Extraction failed"; return 1; }

echo "Installing to /usr/local/bin"
sudo mv mcpd /usr/local/bin/mcpd && sudo chmod +x /usr/local/bin/mcpd || { echo "Install failed"; return 1; }

rm -f "$zip_name"
echo "mcpd installed successfully"
}
```

## via local Go binary build

```bash
# Clone the Git repo
git clone git@github.com:mozilla-ai/mcpd.git
cd mcpd
# Checkout a specific tag (or build latest main)
git fetch --tags
git checkout v0.0.3
# Use Makefile commands to build and install mcpd
make build
sudo make install # Installs mcpd 'globally' to /usr/local/bin
```

## Run with Docker

`mcpd` is available as the Docker image [mzdotai/mcpd](https://hub.docker.com/repository/docker/mzdotai/mcpd/general).

!!! note "Dockerfile environment variables"
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`.

### Default environment variables

| Name | Default Value |
|---------------------|--------------------------------------------|
| `MCPD_API_PORT` | `8090` |
| `MCPD_LOG_LEVEL` | `info` |
| `MCPD_LOG_PATH` | `/var/log/mcpd/mcpd.log` |
| `MCPD_CONFIG_FILE` | `/etc/mcpd/.mcpd.toml` |
| `MCPD_RUNTIME_FILE` | `/home/mcpd/.config/mcpd/secrets.prd.toml` |


To run `mcpd` with Docker, map the required port and bind mount your `.mcpd.toml` configuration file and runtime secrets file:

```bash
docker run -p 8090:8090 \
-v $PWD/.mcpd.toml:/etc/mcpd/.mcpd.toml \
-v $HOME/.config/mcpd/secrets.dev.toml:/home/mcpd/.config/mcpd/secrets.prd.toml \
-e MCPD_LOG_LEVEL=debug \
mzdotai/mcpd:v0.0.3
```
3 changes: 3 additions & 0 deletions docs/makefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ The `mcpd` project includes a `Makefile` to streamline common developer tasks.

These commands manage the [MkDocs](https://www.mkdocs.org) developer documentation site for `mcpd`.

!!! note "Environment"
Docs commands assume you have `uv` installed and available in your `PATH` (in additon to Go).

- **Generate CLI reference docs from the Cobra commands**
```bash
make docs-cli
Expand Down
14 changes: 7 additions & 7 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ brew tap mozilla-ai/tap
brew install mcpd
```

Official releases can be downloaded from [mcpd's GitHub releases page](https://github.com/mozilla-ai/mcpd/releases).
!!! tip "Installation methods"
Please see our [Installation](installation.md) page for additional ways to install and run `mcpd`.

---

Expand All @@ -31,16 +32,16 @@ Add the latest version of the `time` server:
mcpd add time
```

Or add a specific version and restrict access to specific tools:
You can also restrict access to allow only specific tools:
```bash
mcpd add time --version 0.6.2 --tool get_current_time
mcpd add time --tool get_current_time
```

---

## 4. Set Startup Arguments

Configure any startup flags required by the server:
Configure any startup flags for the server, in this case `--local-timezone` is optional, but let's set it:
```bash
mcpd config args set time -- --local-timezone=Europe/London
```
Expand Down Expand Up @@ -77,7 +78,6 @@ curl -s -X POST -H "Content-Type: application/json" \
http://localhost:8090/api/v1/servers/time/tools/get_current_time | jq
```

## 8. Use `mcpd` in your Agentic Python application

# Using mcpd in your Python application

For tutorials on using mcpd with agents in Python, please refer to the [Python mcpd SDK](https://github.com/mozilla-ai/mcpd-sdk-python) documentation.
For [examples](https://github.com/mozilla-ai/mcpd-sdk-python/tree/main/examples/anyagent) on using `mcpd` with agents in Python, please refer to the [Python SDK](https://github.com/mozilla-ai/mcpd-sdk-python) documentation.
3 changes: 2 additions & 1 deletion mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ markdown_extensions:
nav:
- Home: index.md
- Requirements: requirements.md
- Installation: installation.md
- Tutorial: tutorial.md
- Configuration: configuration.md
- Execution Context: execution-context.md
- Makefile: makefile.md
- Tutorial: tutorial.md
- CLI Reference:
- Overview: commands/mcpd.md