Skip to content

Commit 15f007d

Browse files
committed
Address suggestions
Signed-off-by: Juan Antonio Osorio <[email protected]>
1 parent bd1a8d2 commit 15f007d

File tree

3 files changed

+38
-50
lines changed

3 files changed

+38
-50
lines changed

docs/toolhive/guides-cli/advanced-cicd.mdx

Lines changed: 31 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ description:
55
ToolHive.
66
---
77

8-
This guide covers advanced CI/CD patterns for production environments using
9-
ToolHive's [`thv build`](../reference/cli/thv_build.md) command. These patterns
10-
include multi-architecture builds, supply chain security, and efficient change
11-
detection.
8+
This guide covers advanced CI/CD patterns for building MCP server containers
9+
using ToolHive's [`thv build`](../reference/cli/thv_build.md) command. These
10+
patterns include multi-architecture builds, supply chain security, and efficient
11+
change detection.
12+
13+
These patterns are intended for anyone building MCP server containers regularly,
14+
such as maintainers of MCP servers or organizations deploying custom servers or
15+
repackaging existing ones.
1216

1317
## Prerequisites
1418

@@ -19,9 +23,10 @@ Before implementing these advanced patterns, ensure you have:
1923
- Container registry access for pushing images
2024
- Understanding of Docker Buildx for multi-architecture builds
2125

22-
## Multi-architecture builds
26+
## Multi-architecture MCP server builds
2327

24-
Build containers for multiple architectures (amd64, arm64) using Docker Buildx:
28+
Build MCP server containers for multiple architectures (amd64, arm64) using
29+
Docker Buildx:
2530

2631
```yaml
2732
name: Multi-arch Build
@@ -42,12 +47,9 @@ jobs:
4247
uses: docker/setup-buildx-action@v3
4348

4449
- name: Install ToolHive
45-
run: |
46-
# Install ToolHive CLI (replace with your preferred installation method)
47-
# See: https://github.com/stacklok/toolhive/releases
48-
wget https://github.com/stacklok/toolhive/releases/latest/download/toolhive_linux_amd64.tar.gz
49-
tar -xzf toolhive_linux_amd64.tar.gz
50-
sudo install -m 0755 thv /usr/local/bin/
50+
uses: StacklokLabs/toolhive-actions/install@v0
51+
with:
52+
version: latest
5153

5254
- name: Generate Dockerfile
5355
run: |
@@ -90,12 +92,9 @@ jobs:
9092
uses: docker/setup-buildx-action@v3
9193

9294
- name: Install ToolHive
93-
run: |
94-
# Install ToolHive CLI (replace with your preferred installation method)
95-
# See: https://github.com/stacklok/toolhive/releases
96-
wget https://github.com/stacklok/toolhive/releases/latest/download/toolhive_linux_amd64.tar.gz
97-
tar -xzf toolhive_linux_amd64.tar.gz
98-
sudo install -m 0755 thv /usr/local/bin/
95+
uses: StacklokLabs/toolhive-actions/install@v0
96+
with:
97+
version: latest
9998

10099
- name: Generate Dockerfile
101100
run: |
@@ -161,12 +160,9 @@ jobs:
161160
- uses: actions/checkout@v4
162161

163162
- name: Install ToolHive
164-
run: |
165-
# Install ToolHive CLI (replace with your preferred installation method)
166-
# See: https://github.com/stacklok/toolhive/releases
167-
wget https://github.com/stacklok/toolhive/releases/latest/download/toolhive_linux_amd64.tar.gz
168-
tar -xzf toolhive_linux_amd64.tar.gz
169-
sudo install -m 0755 thv /usr/local/bin/
163+
uses: StacklokLabs/toolhive-actions/install@v0
164+
with:
165+
version: latest
170166

171167
- name: Build containers
172168
run: |
@@ -199,12 +195,9 @@ jobs:
199195
- uses: actions/checkout@v4
200196

201197
- name: Install ToolHive
202-
run: |
203-
# Install ToolHive CLI (replace with your preferred installation method)
204-
# See: https://github.com/stacklok/toolhive/releases
205-
wget https://github.com/stacklok/toolhive/releases/latest/download/toolhive_linux_amd64.tar.gz
206-
tar -xzf toolhive_linux_amd64.tar.gz
207-
sudo install -m 0755 thv /usr/local/bin/
198+
uses: StacklokLabs/toolhive-actions/install@v0
199+
with:
200+
version: latest
208201

209202
- name: Build ${{ matrix.server.name }}
210203
run: |
@@ -233,12 +226,9 @@ jobs:
233226
- uses: actions/checkout@v4
234227

235228
- name: Install ToolHive
236-
run: |
237-
# Install ToolHive CLI (replace with your preferred installation method)
238-
# See: https://github.com/stacklok/toolhive/releases
239-
wget https://github.com/stacklok/toolhive/releases/latest/download/toolhive_linux_amd64.tar.gz
240-
tar -xzf toolhive_linux_amd64.tar.gz
241-
sudo install -m 0755 thv /usr/local/bin/
229+
uses: StacklokLabs/toolhive-actions/install@v0
230+
with:
231+
version: latest
242232

243233
- name: Build container
244234
run: |
@@ -284,10 +274,11 @@ build:
284274
services:
285275
- docker:dind
286276
before_script:
277+
# Install ToolHive CLI using curl and jq to get the latest version
287278
- |
288-
# Install ToolHive CLI
289-
wget https://github.com/stacklok/toolhive/releases/latest/download/toolhive_linux_amd64.tar.gz
290-
tar -xzf toolhive_linux_amd64.tar.gz
279+
VERSION=$(curl -s https://api.github.com/repos/stacklok/toolhive/releases/latest | jq -r .tag_name)
280+
wget "https://github.com/stacklok/toolhive/releases/download/${VERSION}/toolhive_${VERSION#v}_linux_amd64.tar.gz"
281+
tar -xzf "toolhive_${VERSION#v}_linux_amd64.tar.gz"
291282
install -m 0755 thv /usr/local/bin/
292283
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
293284
script:
@@ -322,6 +313,6 @@ When implementing advanced CI/CD patterns:
322313
## Related information
323314

324315
- [Build MCP server containers](./build-containers.mdx)
325-
- [Run MCP servers in Kubernetes](../guides-k8s/run-mcp-k8s.md)
316+
- [Run MCP servers in Kubernetes](../guides-k8s/run-mcp-k8s.mdx)
326317
- [`thv build` command reference](../reference/cli/thv_build.md)
327318
- [Secrets management](./secrets-management.mdx)

docs/toolhive/guides-cli/build-containers.mdx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ thv build --tag mcp-git:latest uvx://mcp-server-git@latest
123123
## Protocol schemes
124124

125125
The `thv build` command supports the same protocol schemes as
126-
[`thv run`](./run-mcp-servers.mdx):
126+
[`thv run`](./run-mcp-servers.mdx#run-a-server-using-protocol-schemes):
127127

128128
### Python (uvx)
129129

@@ -248,12 +248,9 @@ jobs:
248248
- uses: actions/checkout@v4
249249
250250
- name: Install ToolHive
251-
run: |
252-
# Install ToolHive CLI (replace with your preferred installation method)
253-
# See: https://github.com/stacklok/toolhive/releases
254-
wget https://github.com/stacklok/toolhive/releases/latest/download/toolhive_linux_amd64.tar.gz
255-
tar -xzf toolhive_linux_amd64.tar.gz
256-
sudo install -m 0755 thv /usr/local/bin/
251+
uses: StacklokLabs/toolhive-actions/install@v0
252+
with:
253+
version: latest
257254
258255
- name: Log in to Container Registry
259256
uses: docker/login-action@v3
@@ -322,15 +319,15 @@ thv build --tag my-server:dev go:///path/to/my-project
322319

323320
- Use built containers with [`thv run`](./run-mcp-servers.mdx) for local
324321
development
325-
- Deploy pre-built containers to [Kubernetes](../guides-k8s/run-mcp-k8s.md)
322+
- Deploy pre-built containers to [Kubernetes](../guides-k8s/run-mcp-k8s.mdx)
326323
- Set up [CI/CD pipelines](#cicd-integration) for automated building
327324
- Learn about [container registry workflows](#custom-image-tagging)
328325

329326
## Related information
330327

331328
- [`thv build` command reference](../reference/cli/thv_build.md)
332329
- [Run MCP servers](./run-mcp-servers.mdx)
333-
- [Run MCP servers in Kubernetes](../guides-k8s/run-mcp-k8s.md)
330+
- [Run MCP servers in Kubernetes](../guides-k8s/run-mcp-k8s.mdx)
334331
- [Custom permissions](./custom-permissions.mdx)
335332

336333
## Troubleshooting

sidebars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const sidebars: SidebarsConfig = {
6767
'toolhive/guides-cli/registry',
6868
'toolhive/guides-cli/run-mcp-servers',
6969
'toolhive/guides-cli/build-containers',
70-
'toolhive/guides-cli/advanced-cicd',
7170
'toolhive/guides-cli/manage-mcp-servers',
7271
'toolhive/guides-cli/secrets-management',
7372
'toolhive/guides-cli/client-configuration',
@@ -87,6 +86,7 @@ const sidebars: SidebarsConfig = {
8786
],
8887
},
8988
'toolhive/guides-cli/telemetry-and-metrics',
89+
'toolhive/guides-cli/advanced-cicd',
9090
{
9191
type: 'category',
9292
label: 'Command reference',

0 commit comments

Comments
 (0)