Skip to content

Commit b521894

Browse files
committed
Update documentation (re: installation)
1 parent ad647a2 commit b521894

File tree

5 files changed

+110
-11
lines changed

5 files changed

+110
-11
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ CMD mcpd daemon \
7070
--runtime-file $MCPD_RUNTIME_FILE
7171

7272
# Example run:
73-
# docker run -p 8090:8090
73+
# docker run -p 8090:8090 \
7474
# -v $PWD/.mcpd.toml:/etc/mcpd/.mcpd.toml \
75-
# -v HOME/.config/mcpd/secrets.dev.toml:/home/mcpd/.config/mcpd/secrets.prd.toml \
75+
# -v $HOME/.config/mcpd/secrets.dev.toml:/home/mcpd/.config/mcpd/secrets.prd.toml \
7676
# -e MCPD_LOG_LEVEL=debug \
77-
# mzdotai/mcpd:v0.0.2
77+
# mzdotai/mcpd:v0.0.3

docs/installation.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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+
```

docs/makefile.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ The `mcpd` project includes a `Makefile` to streamline common developer tasks.
7979

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

82+
!!! note "Environment"
83+
Docs commands assume you have `uv` installed and available in your `PATH` (in additon to Go).
84+
8285
- **Generate CLI reference docs from the Cobra commands**
8386
```bash
8487
make docs-cli

docs/tutorial.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ brew tap mozilla-ai/tap
1010
brew install mcpd
1111
```
1212

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

1516
---
1617

@@ -31,16 +32,16 @@ Add the latest version of the `time` server:
3132
mcpd add time
3233
```
3334

34-
Or add a specific version and restrict access to specific tools:
35+
You can also restrict access to allow only specific tools:
3536
```bash
36-
mcpd add time --version 0.6.2 --tool get_current_time
37+
mcpd add time --tool get_current_time
3738
```
3839

3940
---
4041

4142
## 4. Set Startup Arguments
4243

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

81+
## 8. Use `mcpd` in your Agentic Python application
8082

81-
# Using mcpd in your Python application
82-
83-
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.
83+
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.

mkdocs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ markdown_extensions:
4343
nav:
4444
- Home: index.md
4545
- Requirements: requirements.md
46+
- Installation: installation.md
47+
- Tutorial: tutorial.md
4648
- Configuration: configuration.md
4749
- Execution Context: execution-context.md
4850
- Makefile: makefile.md
49-
- Tutorial: tutorial.md
5051
- CLI Reference:
5152
- Overview: commands/mcpd.md

0 commit comments

Comments
 (0)