Skip to content

Commit 3a91075

Browse files
committed
Fix the upstream format support + add tests & examples
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
1 parent 0a4b4be commit 3a91075

File tree

6 files changed

+2400
-90
lines changed

6 files changed

+2400
-90
lines changed

examples/README.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ syncPolicy:
115115
- Creating curated/filtered subsets
116116
- Registry federation scenarios
117117

118-
**Note:** Upstream format conversion is not yet fully implemented. Use Git or File sources for production.
118+
**Format Structure:**
119+
The upstream format uses a wrapper structure with `version`, `meta`, and `data` sections (see `examples/upstream-registry.json`).
120+
Each server follows the MCP 2025-10-17 schema with `$schema`, `packages[]`, and `_meta` extensions for ToolHive-specific metadata (tier, status, tools, etc.).
119121

120122
---
121123

@@ -256,23 +258,33 @@ filter:
256258
3. Tag include (empty = include all)
257259
4. Tag exclude
258260

261+
### Data Format Examples
262+
263+
See the example files for format reference:
264+
- **ToolHive format** (`examples/toolhive-registry.json`): Flat structure with servers as an object/map
265+
- **Upstream format** (`examples/upstream-registry.json`): Wrapper structure with meta/data sections and MCP 2025-10-17 schema
266+
259267
### Git Version Pinning
260268

261269
```yaml
262-
source:
263-
git:
264-
repository: https://github.com/stacklok/toolhive.git
270+
registries:
271+
- name: my-registry
272+
format: toolhive # or "upstream"
273+
git:
274+
repository: https://github.com/stacklok/toolhive.git
265275
266-
# Option 1: Track latest on a branch
267-
branch: main
276+
# Option 1: Track latest on a branch
277+
branch: main
268278
269-
# Option 2: Pin to a release tag
270-
tag: v1.2.3
279+
# Option 2: Pin to a release tag
280+
tag: v1.2.3
271281
272-
# Option 3: Pin to exact commit
273-
commit: abc123def456
282+
# Option 3: Pin to exact commit
283+
commit: abc123def456
274284
275-
path: pkg/registry/data/registry.json
285+
path: pkg/registry/data/registry.json
286+
syncPolicy:
287+
interval: "30m"
276288
```
277289

278290
---

examples/registry-sample.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)