Commit 8739ec4
Add registry format converters and support for the Official MCP Registry (#2469)
* Initial PoC of supporting the official MCP registry
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Temporarily copy the converters from toolhive-registry
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Complete the initial implementation
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Support setting the registry API via REST
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Move the whole converters package from toolhive-registry
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Fix the imports in the tests
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Config changes now take effect immediately without a restart
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Fix a small issue with converting the names
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Normalise the full name instead of simplifying it
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Fix imports after rebase - update to use pkg/registry/types
* Fix imports after package reorganization rebase
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Fix CodeQL warning and regenerate swagger docs
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Fix another CodeQL error
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Update MCP Registry API version from v0 to v0.1 in docs
The API endpoints use v0.1 as the version path component.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add User-Agent header to MCP Registry API client
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Extract environment variables from runtime arguments in MCP registry converter
Support extracting environment variables from both sources in the MCP Registry API format:
1. The dedicated environmentVariables field (preferred way)
2. The -e/--env flags in runtimeArguments (Docker CLI pattern)
Many servers in the MCP registry (like github-mcp-server) use the Docker CLI pattern
of specifying environment variables as runtime arguments with -e flags, rather than
using the dedicated environmentVariables field. This is a valid approach according to
the MCP registry schema.
Changes:
- Add extractEnvironmentVariables() to handle both sources
- Add extractEnvFromRuntimeArgs() to parse -e/--env flags
- Add parseEnvVarFromValue() to extract variable metadata
- Parse variable references like {token} and extract metadata (isSecret, isRequired, etc.)
- Handle static values and complex values with multiple equals signs
- Add comprehensive test suite with 15+ test cases covering all scenarios
- Add integration test with realistic GitHub MCP server data
This ensures ToolHive can properly consume all servers from the official MCP registry,
regardless of which format they use for environment variables.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Implement caching
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Update CLI documentation for registry commands
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Regenerate the swagger files
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
* Consolidate set-registry-api into set-registry
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
---------
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent cd66940 commit 8739ec4
File tree
85 files changed
+6427
-1056
lines changed- cmd
- regup/app
- thv-operator/pkg
- filtering
- sources
- mocks
- validation
- thv-proxyrunner/app
- thv/app
- docs
- arch
- cli
- server
- pkg
- api/v1
- auth/remote
- config
- mocks
- container/verifier
- mcp/server
- process
- registry
- api
- converters
- testdata
- image_to_server
- remote_to_server
- server_to_image
- server_to_remote
- mocks
- types
- runner
- retriever
- versions
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
85 files changed
+6427
-1056
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
| 70 | + | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
0 commit comments