fix(registry-client): accept 2025-12-11 wrapped MCP Registry schema#6
Merged
Conversation
`registry.modelcontextprotocol.io` switched its list and detail
responses to a new envelope:
{ "server": <core>, "_meta": { ... } }
The flat shape (`core` fields at the top level) is still emitted by
older deployments. Today `pakx search` against the real upstream
returns zero MCP results because every entry hits the existing
`#[derive(Deserialize)]` on the flat-only `ServerRaw` and fails.
Surfaced while writing the TS port of this client for
`pakx-web` `/explore` (pakxdev/pakx-web#3) — both layers needed
the same fix.
- Split `ServerRaw` into:
- `ServerCore` — the flat field set (unchanged semantics).
- `ServerRaw` — `#[serde(untagged)]` enum over `Wrapped { server,
_meta }` and `Flat(ServerCore)`. Decoders try `Wrapped` first;
legacy flat payloads fall through.
- `into_package` now folds `_meta` (when present) into the
`install_hints` object so the resolver can read upstream status
flags without re-parsing.
- Two new wiremock tests cover the wrapped shape on both `search`
and `fetch`; existing flat-shape tests still pass unchanged.
CI clippy rejected `ServerRaw::Wrapped` / `ServerRaw::Flat` inside the impl block. Use `Self::*` instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
registry.modelcontextprotocol.ioswitched its list and detail responses to a new envelope:```json
{ "server": , "_meta": { ... } }
```
The flat shape (core fields at the top level) is still emitted by older deployments. Today `pakx search` against the real upstream returns zero MCP results because every entry hits the existing flat-only `ServerRaw` and fails decode.
Surfaced while writing the TS port of this client for `pakx-web` `/explore` (pakxdev/pakx-web#3) — both layers needed the same fix.
Changes
Test plan