Skip to content

Commit f443f4a

Browse files
authored
Add custom registry tutorial and JSON schema reference (#123)
Signed-off-by: Dan Barr <[email protected]> Co-authored-by: Dan Barr <[email protected]>
1 parent 6a63ecb commit f443f4a

File tree

13 files changed

+1160
-30
lines changed

13 files changed

+1160
-30
lines changed

.github/workflows/update-toolhive-reference.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
title: |
7171
Update ToolHive reference docs for ${{ steps.imports.outputs.version }}
7272
body: |
73-
This PR updates the ToolHive CLI and API reference documentation to the latest release: ${{ steps.imports.outputs.version }}.
73+
This PR updates the ToolHive CLI and API reference documentation for release: ${{ steps.imports.outputs.version }}.
7474
commit-message: |
7575
Update ToolHive reference docs for ${{ steps.imports.outputs.version }}
7676
labels: |

docs/toolhive/guides-cli/registry.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ By default, ToolHive uses a built-in registry of verified MCP servers. You can
132132
configure ToolHive to use a custom registry instead. This is useful for
133133
organizations that want to maintain their own private registry of MCP servers.
134134

135+
The registry is a JSON file that follows the
136+
[ToolHive registry schema](../reference/registry-schema.mdx). Once you configure
137+
a custom registry, ToolHive uses it for all commands that interact with the
138+
registry, such as `thv registry list`, `thv registry info`, and `thv run`.
139+
140+
Refer to the
141+
[built-in registry file](https://github.com/stacklok/toolhive/blob/main/pkg/registry/data/registry.json)
142+
for examples of MCP server entries.
143+
135144
### Set a remote registry URL
136145

137146
To configure ToolHive to use a remote registry, set the registry URL:
@@ -154,14 +163,6 @@ To configure ToolHive to use a local registry, set the registry file:
154163
thv config set-registry <PATH>
155164
```
156165

157-
The registry must be a JSON file that follows the same format as the
158-
[built-in registry](https://github.com/stacklok/toolhive/blob/main/pkg/registry/data/registry.json).
159-
Once you configure a remote registry, all registry commands
160-
([`thv registry list`](../reference/cli/thv_registry_list.md),
161-
[`thv registry info`](../reference/cli/thv_registry_info.md),
162-
[`thv search`](../reference/cli/thv_search.md)) will use the remote registry
163-
instead of the built-in one.
164-
165166
### Check the current registry location
166167

167168
To see which registry (URL or path) is currently configured:
@@ -189,6 +190,8 @@ This restores the default behavior of using ToolHive's built-in registry.
189190
See [Run MCP servers](./run-mcp-servers.mdx) to run an MCP server from the
190191
registry.
191192

193+
Learn how to [create a custom MCP registry](../tutorials/custom-registry.mdx).
194+
192195
## Related information
193196

194197
- [`thv registry` command reference](../reference/cli/thv_registry.md)

docs/toolhive/reference/crd-spec.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ description:
66
toc_max_heading_level: 4
77
---
88

9-
import CRDRef from '@site/static/api-specs/crd-api.md';
9+
import CRDRef from '@site/static/api-specs/toolhive-crd-api.md';
1010

1111
<CRDRef />
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: ToolHive registry JSON schema
3+
description: The JSON schema for the ToolHive registry.
4+
displayed_sidebar: toolhiveSidebar
5+
---
6+
7+
import JSONSchemaViewer from '@theme/JSONSchemaViewer';
8+
import Schema from '@site/static/api-specs/toolhive-registry-schema.json';
9+
10+
This is the JSON schema for the ToolHive registry. It defines the structure and
11+
constraints for the registry entries, ensuring that all entries conform to a
12+
consistent format.
13+
14+
To use this schema in your own custom registry file, add a `$schema` property at
15+
the top of your JSON file:
16+
17+
```json
18+
{
19+
"$schema": "https://raw.githubusercontent.com/stacklok/toolhive/main/pkg/registry/data/schema.json",
20+
...
21+
}
22+
```
23+
24+
<JSONSchemaViewer schema={Schema} />

0 commit comments

Comments
 (0)