Skip to content

Commit 13b789a

Browse files
ptelangclaude
andcommitted
Add comprehensive usage guide for meta-mcp MCP server
This guide documents how to use the meta-mcp server with ToolHive for intelligent tool discovery and unified access to multiple MCP servers. Includes setup instructions along with practical examples and best practices. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent f2a5126 commit 13b789a

File tree

1 file changed

+236
-0
lines changed

1 file changed

+236
-0
lines changed
Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
---
2+
title: meta-mcp server guide
3+
sidebar_label: meta-mcp
4+
description:
5+
Using the meta-mcp server with ToolHive for intelligent tool discovery and
6+
unified MCP server access.
7+
last_update:
8+
author: stacklok-claude
9+
date: 2025-09-18
10+
---
11+
12+
import Tabs from '@theme/Tabs';
13+
import TabItem from '@theme/TabItem';
14+
import MCPMetadata from '@site/src/components/MCPMetadata';
15+
16+
## Overview
17+
18+
The meta-mcp server acts as an intelligent intermediary between AI clients and
19+
multiple MCP servers. It provides semantic tool discovery, unified access to
20+
multiple MCP servers through a single endpoint, and intelligent routing of
21+
requests to appropriate MCP tools.
22+
23+
Key features include:
24+
25+
- **Semantic Tool Discovery**: Uses embeddings and hybrid search (semantic +
26+
BM25) to find the right tools for your tasks
27+
- **Unified Access**: Single endpoint to access all your MCP servers without
28+
managing multiple connections
29+
- **Tool Management**: Seamlessly manage large numbers of MCP tools across
30+
different servers
31+
- **Intelligent Routing**: Automatically routes requests to the appropriate MCP
32+
server based on tool requirements
33+
34+
The meta-mcp server is developed by Stacklok and requires Python 3.13+.
35+
36+
## Metadata
37+
38+
<MCPMetadata name='meta-mcp' />
39+
40+
## Usage
41+
42+
<Tabs groupId='mode' queryString='mode'>
43+
<TabItem value='ui' label='UI' default>
44+
45+
:::info[Prerequisites]
46+
47+
- ToolHive UI (version >= 0.6.0) must be running
48+
- ToolHive CLI (version >= 0.3.1) :::
49+
50+
1. **Create a dedicated group for meta-mcp**:
51+
52+
Navigate to the Groups section and create a new group called `meta`. This
53+
ensures that AI clients are configured with only the meta-mcp server while
54+
other MCP servers remain available but not directly configured in clients.
55+
56+
2. **Install meta-mcp in the dedicated group**:
57+
58+
In the UI, select the `meta` group and add the meta-mcp server from the
59+
registry.
60+
61+
3. **Configure your AI client**:
62+
63+
Use the client configuration feature in ToolHive UI to register your AI
64+
client (like Cursor or Claude Desktop) with the `meta` group only.
65+
66+
4. **Add other MCP servers to the default group**:
67+
68+
Install other MCP servers you want to access through meta-mcp in the default
69+
group. These will be discovered automatically by meta-mcp.
70+
71+
</TabItem>
72+
<TabItem value='cli' label='CLI'>
73+
74+
:::info[Prerequisites]
75+
76+
- ToolHive UI (version >= 0.6.0) must be running for setup
77+
- ToolHive CLI (version >= 0.3.1) :::
78+
79+
**Step 1: Create a dedicated group and run meta-mcp**
80+
81+
```bash
82+
# Create the meta group
83+
thv group create meta
84+
85+
# Run meta-mcp in the dedicated group
86+
thv run --group meta meta-mcp
87+
```
88+
89+
**Step 2: Configure your AI client for the meta group**
90+
91+
```bash
92+
# Register your AI client with the meta group
93+
# Examples for different clients:
94+
thv client register cursor --group meta
95+
thv client register claude-desktop --group meta
96+
97+
# Verify the configuration
98+
thv client list-registered
99+
```
100+
101+
**Step 3: Add MCP servers to the default group**
102+
103+
```bash
104+
# Add MCP servers that you want to access through meta-mcp
105+
thv run github
106+
thv run filesystem
107+
thv run time
108+
109+
# Verify the configuration - meta-mcp should be in 'meta' group, others in 'default'
110+
thv ls
111+
```
112+
113+
**Advanced Usage: Custom configuration**
114+
115+
If you need custom configuration for meta-mcp, you can specify environment
116+
variables:
117+
118+
```bash
119+
# Run with custom ToolHive connection settings
120+
TOOLHIVE_HOST=localhost TOOLHIVE_PORT=8080 thv run --group meta meta-mcp
121+
122+
# Run with custom polling interval (default: 60 seconds)
123+
thv run --group meta --env POLLING_INTERVAL=30 meta-mcp
124+
```
125+
126+
</TabItem>
127+
<TabItem value='k8s' label='Kubernetes'>
128+
129+
```yaml title="meta-mcp.yaml"
130+
apiVersion: toolhive.stacklok.dev/v1alpha1
131+
kind: MCPServer
132+
metadata:
133+
name: meta-mcp
134+
namespace: toolhive-system
135+
labels:
136+
app.kubernetes.io/name: meta-mcp
137+
spec:
138+
name: meta-mcp
139+
registry: stacklok
140+
group: meta
141+
env:
142+
- name: TOOLHIVE_HOST
143+
value: 'toolhive-api-server'
144+
- name: TOOLHIVE_PORT
145+
value: '8080'
146+
- name: POLLING_INTERVAL
147+
value: '60'
148+
```
149+
150+
Apply the configuration:
151+
152+
```bash
153+
kubectl apply -f meta-mcp.yaml
154+
```
155+
156+
Then configure other MCP servers in the default group:
157+
158+
```yaml title="other-mcp-servers.yaml"
159+
apiVersion: toolhive.stacklok.dev/v1alpha1
160+
kind: MCPServer
161+
metadata:
162+
name: github
163+
spec:
164+
name: github
165+
registry: stacklok
166+
# group defaults to "default" if not specified
167+
---
168+
apiVersion: toolhive.stacklok.dev/v1alpha1
169+
kind: MCPServer
170+
metadata:
171+
name: filesystem
172+
spec:
173+
name: filesystem
174+
registry: stacklok
175+
```
176+
177+
</TabItem>
178+
</Tabs>
179+
180+
## Sample prompts
181+
182+
Once meta-mcp is configured and running, you can use it with natural language
183+
prompts. The server will automatically discover and route to appropriate tools:
184+
185+
**Direct Task Examples:**
186+
187+
- "Get the details of GitHub issue 1911 from stacklok/toolhive repo"
188+
- "List recent PRs from stacklok/toolhive repo"
189+
190+
**The meta-mcp workflow:**
191+
192+
1. Your AI client sends the request to meta-mcp
193+
2. Meta-mcp uses hybrid semantic and keyword search to find relevant tools
194+
across all connected MCP servers
195+
3. Meta-mcp server returns the short list of matching tools to the client
196+
4. Client selects one tool from the short list and uses meta-mcp to call that
197+
tool
198+
5. Results are returned from meta-mcp to the client
199+
200+
## Available tools
201+
202+
The meta-mcp server provides two main tools:
203+
204+
### find_tool
205+
206+
Discovers available tools that match your requirements using hybrid semantic and
207+
keyword search.
208+
209+
**Parameters:**
210+
211+
- `tool_description`: Description of the task or capability needed (e.g., "web
212+
search", "analyze CSV file")
213+
- `tool_keywords`: Space-separated keywords of the task or capability needed
214+
(e.g., "list issues github", "SQL query postgres")
215+
216+
### call_tool
217+
218+
Executes a specific tool with provided parameters after discovery.
219+
220+
**Parameters:**
221+
222+
- `server_name`: Name of the MCP server providing the tool
223+
- `tool_name`: Name of the tool to execute
224+
- `parameters`: Dictionary of arguments required by the tool
225+
226+
## Recommended practices
227+
228+
- **Use descriptive group names**: Keep meta-mcp in a dedicated group to
229+
maintain clean client configurations
230+
- **Regular updates**: Keep both ToolHive and meta-mcp updated for the latest
231+
features and compatibility
232+
233+
:::tip[Best Practice] Start with a small set of MCP servers in the default group
234+
and gradually add more as you become familiar with meta-mcp's tool discovery
235+
capabilities. This makes it easier to understand which tools are being used for
236+
different tasks. :::

0 commit comments

Comments
 (0)