Skip to content

Commit c4ef9d6

Browse files
committed
Reorganise groups content and update the docs for running MCP servers
Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent 3fa575d commit c4ef9d6

File tree

3 files changed

+175
-150
lines changed

3 files changed

+175
-150
lines changed

docs/toolhive/guides-cli/registry.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,162 @@ thv config unset-registry
185185

186186
This restores the default behavior of using ToolHive's built-in registry.
187187

188+
## Organize servers with registry groups
189+
190+
Registry groups allow you to organize related MCP servers and run them together
191+
as a cohesive unit. This is particularly useful for creating team-specific
192+
toolkits, workflow-based server collections, or environment-specific
193+
configurations.
194+
195+
:::note
196+
197+
Registry groups are different from [runtime groups](./group-management.md).
198+
Registry groups organize server definitions within registry files, while runtime
199+
groups organize running server instances for access control.
200+
201+
:::
202+
203+
### Group structure
204+
205+
Groups are defined as a top-level array in your custom registry:
206+
207+
```json
208+
{
209+
"servers": {
210+
// Individual servers
211+
},
212+
"groups": [
213+
{
214+
"name": "group-name",
215+
"description": "Description of what this group provides",
216+
"servers": {
217+
"server-name": {
218+
// Complete server definition
219+
}
220+
},
221+
"remote_servers": {
222+
"remote-server-name": {
223+
// Complete remote server definition
224+
}
225+
}
226+
}
227+
]
228+
}
229+
```
230+
231+
### Key characteristics
232+
233+
- **Optional**: Groups are entirely optional. Omit the `groups` section if you
234+
only need individual servers
235+
- **Independent server definitions**: Each group contains complete server
236+
configurations, not references to top-level servers
237+
- **Self-contained**: Groups can define servers with the same names as top-level
238+
servers but with different configurations
239+
- **Flexible membership**: The same server can appear in multiple groups with
240+
different configurations
241+
242+
### Example: Multi-environment groups
243+
244+
Here's an example showing how groups can organize servers for different
245+
purposes:
246+
247+
```json title='registry-with-groups.json'
248+
{
249+
"$schema": "https://raw.githubusercontent.com/stacklok/toolhive/main/pkg/registry/data/schema.json",
250+
"version": "1.0.0",
251+
"last_updated": "2025-08-15T10:00:00Z",
252+
"servers": {
253+
"production-fetch": {
254+
"description": "Production web content fetching server",
255+
"image": "ghcr.io/stackloklabs/gofetch/server:latest",
256+
"status": "Active",
257+
"tier": "Community",
258+
"transport": "streamable-http",
259+
"permissions": {
260+
"network": {
261+
"outbound": {
262+
"allow_host": [".company.com"],
263+
"allow_port": [443]
264+
}
265+
}
266+
}
267+
}
268+
},
269+
"groups": [
270+
{
271+
"name": "frontend-dev",
272+
"description": "Tools for frontend development team",
273+
"servers": {
274+
"dev-fetch": {
275+
"description": "Development web content fetching with broader access",
276+
"image": "ghcr.io/stackloklabs/gofetch/server:latest",
277+
"status": "Active",
278+
"tier": "Community",
279+
"transport": "streamable-http",
280+
"permissions": {
281+
"network": {
282+
"outbound": {
283+
"allow_host": ["*"],
284+
"allow_port": [80, 443]
285+
}
286+
}
287+
}
288+
}
289+
}
290+
},
291+
{
292+
"name": "testing-suite",
293+
"description": "Servers needed for automated testing workflows",
294+
"servers": {
295+
"test-fetch": {
296+
"description": "Restricted fetch server for testing",
297+
"image": "ghcr.io/stackloklabs/gofetch/server:latest",
298+
"status": "Active",
299+
"tier": "Community",
300+
"transport": "streamable-http",
301+
"args": ["--timeout", "5s"],
302+
"permissions": {
303+
"network": {
304+
"outbound": {
305+
"allow_host": ["test.example.com"],
306+
"allow_port": [443]
307+
}
308+
}
309+
}
310+
}
311+
}
312+
}
313+
]
314+
}
315+
```
316+
317+
This registry provides:
318+
319+
- A production-ready `production-fetch` server at the top level
320+
- A `frontend-dev` group with a more permissive `dev-fetch` server
321+
- A `testing-suite` group with a restricted `test-fetch` server
322+
323+
Each server has the same base image but different configurations appropriate for
324+
its use case.
325+
326+
### Run registry groups
327+
328+
You can run entire groups using the group command:
329+
330+
```bash
331+
# Run all servers in the frontend-dev group
332+
thv group run frontend-dev
333+
334+
# Run all servers in the testing-suite group
335+
thv group run testing-suite
336+
337+
# You can also pass environment variables and secrets to group runs
338+
thv group run frontend-dev --env DEV_MODE=true --secret API_KEY=my-secret
339+
```
340+
341+
Groups provide a convenient way to start multiple related servers with a single
342+
command.
343+
188344
## Next steps
189345

190346
See [Run MCP servers](./run-mcp-servers.mdx) to run an MCP server from the

docs/toolhive/guides-cli/run-mcp-servers.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,25 @@ Use `thv search <NAME>` or `thv registry list` to discover available servers.
6565

6666
:::
6767

68+
### Run registry groups
69+
70+
If your custom registry includes groups, you can also run an entire group of
71+
servers:
72+
73+
```bash
74+
thv group run <GROUP_NAME>
75+
```
76+
77+
For example, to run all servers in a group called `dev-toolkit`:
78+
79+
```bash
80+
thv group run dev-toolkit
81+
```
82+
83+
This starts all servers defined within the specified registry group. See
84+
[Registry groups](./registry.md#organize-servers-with-registry-groups) for more
85+
information about organizing servers into groups in your custom registry.
86+
6887
:::info[What's happening?]
6988

7089
When you run an MCP server from the registry, ToolHive handles different server

docs/toolhive/tutorials/custom-registry.mdx

Lines changed: 0 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -284,156 +284,6 @@ After updating the file, the new server is immediately available for ToolHive
284284
CLI commands. For the UI, navigate to the registry settings and click **Save**
285285
to see the new server listed.
286286

287-
## Working with groups
288-
289-
Groups allow you to organize related MCP servers and run them together as a
290-
cohesive unit. This is particularly useful for:
291-
292-
- **Team-specific toolkits**: Create groups for different teams (frontend,
293-
backend, DevOps)
294-
- **Workflow-based organization**: Group servers needed for specific workflows
295-
(testing, deployment, monitoring)
296-
- **Environment-specific configurations**: Different server configurations for
297-
development, staging, and production
298-
299-
### Group structure
300-
301-
Groups in your registry have the following structure:
302-
303-
```json
304-
{
305-
"groups": [
306-
{
307-
"name": "group-name",
308-
"description": "Description of what this group provides",
309-
"servers": {
310-
"server-name": {
311-
// Complete server definition
312-
}
313-
},
314-
"remote_servers": {
315-
"remote-server-name": {
316-
// Complete remote server definition
317-
}
318-
}
319-
}
320-
]
321-
}
322-
```
323-
324-
### Key characteristics of groups
325-
326-
- **Independent server definitions**: Each group contains complete server
327-
configurations, not references to top-level servers
328-
- **Self-contained**: Groups can define servers with the same names as top-level
329-
servers but with different configurations
330-
- **Organizational only**: Groups provide organization but don't affect server
331-
runtime behavior
332-
- **Flexible membership**: Servers can appear in multiple groups with different
333-
configurations
334-
335-
### Example: Multi-group registry
336-
337-
Here's a more comprehensive example showing how groups can organize servers for
338-
different purposes:
339-
340-
```json title='advanced-registry.json'
341-
{
342-
"$schema": "https://raw.githubusercontent.com/stacklok/toolhive/main/pkg/registry/data/schema.json",
343-
"version": "1.0.0",
344-
"last_updated": "2025-08-15T10:00:00Z",
345-
"servers": {
346-
"production-fetch": {
347-
"description": "Production web content fetching server",
348-
"image": "ghcr.io/stackloklabs/gofetch/server:latest",
349-
"status": "Active",
350-
"tier": "Community",
351-
"transport": "streamable-http",
352-
"permissions": {
353-
"network": {
354-
"outbound": {
355-
"allow_host": [".company.com"],
356-
"allow_port": [443]
357-
}
358-
}
359-
}
360-
}
361-
},
362-
"groups": [
363-
{
364-
"name": "frontend-dev",
365-
"description": "Tools for frontend development team",
366-
"servers": {
367-
"dev-fetch": {
368-
"description": "Development web content fetching with broader access",
369-
"image": "ghcr.io/stackloklabs/gofetch/server:latest",
370-
"status": "Active",
371-
"tier": "Community",
372-
"transport": "streamable-http",
373-
"permissions": {
374-
"network": {
375-
"outbound": {
376-
"allow_host": ["*"],
377-
"allow_port": [80, 443]
378-
}
379-
}
380-
}
381-
}
382-
}
383-
},
384-
{
385-
"name": "testing-suite",
386-
"description": "Servers needed for automated testing workflows",
387-
"servers": {
388-
"test-fetch": {
389-
"description": "Restricted fetch server for testing",
390-
"image": "ghcr.io/stackloklabs/gofetch/server:latest",
391-
"status": "Active",
392-
"tier": "Community",
393-
"transport": "streamable-http",
394-
"args": ["--timeout", "5s"],
395-
"permissions": {
396-
"network": {
397-
"outbound": {
398-
"allow_host": ["test.example.com"],
399-
"allow_port": [443]
400-
}
401-
}
402-
}
403-
}
404-
}
405-
}
406-
]
407-
}
408-
```
409-
410-
This registry provides:
411-
412-
- A production-ready `production-fetch` server at the top level
413-
- A `frontend-dev` group with a more permissive `dev-fetch` server
414-
- A `testing-suite` group with a restricted `test-fetch` server
415-
416-
Each server has the same base image but different configurations appropriate for
417-
its use case.
418-
419-
### Running groups
420-
421-
You can run entire groups using the group command:
422-
423-
```bash
424-
# Run all servers in the frontend-dev group
425-
thv group run frontend-dev
426-
427-
# Run all servers in the testing-suite group
428-
thv group run testing-suite
429-
430-
# You can also pass environment variables and secrets to group runs
431-
thv group run frontend-dev --env DEV_MODE=true --secret API_KEY=my-secret
432-
```
433-
434-
Groups provide a convenient way to start multiple related servers with a single
435-
command.
436-
437287
## Production considerations
438288

439289
While this tutorial uses a local file for simplicity, in production environments

0 commit comments

Comments
 (0)