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