Skip to content

Commit 0f0af05

Browse files
committed
* Updated missing MCPM fields in results
* Renamed `package.go` to `server.go` to match the type. * Renamed `buildPackageResult` func to `serverForID` to match Mozilla AI registry * Added missing fields Publisher/Author and Homepage
1 parent 4f4a443 commit 0f0af05

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed
File renamed without changes.

internal/provider/mcpm/registry.go

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (r *Registry) Resolve(name string, opt ...options.ResolveOption) (packages.
130130
"filters", fs,
131131
)
132132

133-
result, transformed := r.buildPackageResult(name)
133+
result, transformed := r.serverForID(name)
134134
if !transformed {
135135
return packages.Server{}, fmt.Errorf("failed to build package result for '%s'", name)
136136
}
@@ -176,7 +176,7 @@ func (r *Registry) Search(
176176
r.logger.Debug("Searching for package", "name", name, "filters", fs, "source", opts.Source)
177177
var results []packages.Server
178178
for id := range r.mcpServers {
179-
result, transformed := r.buildPackageResult(id)
179+
result, transformed := r.serverForID(id)
180180
if !transformed {
181181
continue
182182
}
@@ -200,11 +200,11 @@ func (r *Registry) Search(
200200
return results, nil
201201
}
202202

203-
// buildPackageResult attempts to convert the MCPServer associated with the specified ID,
203+
// serverForID attempts to convert the MCPServer associated with the specified ID,
204204
// into a Server.
205205
// Returns the transformed result, and a flag to indicate if the transformation was successful.
206206
// If the server cannot be transformed due to unsupported or malformed runtime installations, false is returned.
207-
func (r *Registry) buildPackageResult(pkgKey string) (packages.Server, bool) {
207+
func (r *Registry) serverForID(pkgKey string) (packages.Server, bool) {
208208
// Sanity check to ensure things work when a random ID gets supplied.
209209
sd, foundServer := r.mcpServers[pkgKey]
210210
if !foundServer {
@@ -237,19 +237,23 @@ func (r *Registry) buildPackageResult(pkgKey string) (packages.Server, bool) {
237237
installations := convertInstallations(sd, r.supportedRuntimes)
238238

239239
return packages.Server{
240-
Source: RegistryName,
241-
ID: pkgKey,
242-
Name: pkgKey,
243-
DisplayName: sd.DisplayName,
244-
Description: sd.Description,
245-
License: sd.License,
246-
Tools: tools,
247-
Tags: sd.Tags,
240+
Arguments: arguments,
248241
Categories: sd.Categories,
242+
Deprecated: false, // MCPM doesn't support deprecated packages
243+
Description: sd.Description,
244+
DisplayName: sd.DisplayName,
245+
Homepage: sd.Homepage,
246+
ID: pkgKey,
249247
Installations: installations,
250-
Arguments: arguments,
251248
IsOfficial: sd.IsOfficial,
252-
Deprecated: false, // MCPM doesn't support deprecated packages
249+
License: sd.License,
250+
Name: pkgKey,
251+
Publisher: packages.Publisher{
252+
Name: sd.Author.Name,
253+
},
254+
Source: RegistryName,
255+
Tags: sd.Tags,
256+
Tools: tools,
253257
}, true
254258
}
255259

0 commit comments

Comments
 (0)