Skip to content

fix(registry-client): accept 2025-12-11 wrapped MCP Registry schema#6

Merged
arwenizEr merged 2 commits into
mainfrom
fix/mcp-registry-wrapped-schema
May 21, 2026
Merged

fix(registry-client): accept 2025-12-11 wrapped MCP Registry schema#6
arwenizEr merged 2 commits into
mainfrom
fix/mcp-registry-wrapped-schema

Conversation

@arwenizEr
Copy link
Copy Markdown
Collaborator

Summary

registry.modelcontextprotocol.io switched 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

  • Split `ServerRaw` into:
    • `ServerCore` — 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` 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 pass unchanged.

Test plan

  • CI green (Linux / macOS / Windows)
  • `pakx search filesystem` against the live MCP Registry returns >0 results (was 0 on `main`)

arwenizEr added 2 commits May 21, 2026 17:06
`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.
@arwenizEr arwenizEr merged commit 2b6c92e into main May 21, 2026
5 checks passed
@arwenizEr arwenizEr deleted the fix/mcp-registry-wrapped-schema branch May 21, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant