Visitar URL original
docs(api): clarify per-version listings and latest filtering (#1735) · modelcontextprotocol/registry@13f90b2 · GitHub
Skip to content

Commit 13f90b2

Browse files
authored
docs(api): clarify per-version listings and latest filtering (#1735)
Callers can mistake the first search result for the current version because the list documentation does not explain that results contain one record per version. Document ascending name/version-string ordering, explain that it is neither semantic-version nor publication-date ordering, and show `version=latest` for current records only. The clarification appears in the API guide, reference OpenAPI document, and generated documentation for both API versions. Closes #1676. Validation: - CI build, lint, schema/example validation, govulncheck, and full unit/integration tests passed for `aff04c2`. - Local `make validate` and `go test ./internal/api -run '^TestOpenAPIEndpointCompliance$' -count=1` passed. - `gofmt` and `git diff --check` passed. - Live read-only verification reproduced superseded records without the filter and only `isLatest=true` with `version=latest`. This changes documentation only; query behavior and result ordering are unchanged.
1 parent edd9fa7 commit 13f90b2

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

‎docs/reference/api/official-registry-api.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,19 @@ The official registry extends the `GET /v0.1/servers` endpoint with additional q
4040
- `updated_since` - Filter servers updated after RFC3339 timestamp (e.g., `2025-08-07T13:15:04.280Z`)
4141
- `search` - Case-insensitive substring search on server names (e.g., `filesystem`)
4242
- This is intentionally simple. For more advanced searching and filtering, use a subregistry.
43-
- `version` - Filter by version (currently supports `latest` for latest versions only)
43+
- `version` - Filter by version (`latest` for latest versions only, or an exact version such as `1.2.3`)
4444
- `include_deleted` - Include deleted servers in results (default: `false`, but automatically `true` when `updated_since` is provided for incremental sync)
4545

4646
These extensions enable efficient incremental synchronization for downstream registries and improved server discovery. Parameters can be combined and work with standard cursor-based pagination.
4747

48+
Listings contain one record per server version. Without a `version` filter, results can include multiple versions of the same server, including superseded versions. This also applies when `search` is provided.
49+
50+
Results are ordered by server name, then by version string, both ascending. Version strings are compared as text, not by semantic version or publication date; for example, `1.10.0` sorts before `1.2.0`. Do not treat the first result for a server as its latest version.
51+
52+
To retrieve only the latest version of each matching server, pass `version=latest`. Returned records have `_meta["io.modelcontextprotocol.registry/official"].isLatest` set to `true`. Keep the same filters when following `metadata.nextCursor` to subsequent pages.
53+
54+
Example: `GET /v0.1/servers?search=filesystem&version=latest`
55+
4856
Example: `GET /v0.1/servers?search=filesystem&updated_since=2025-08-01T00:00:00Z&version=latest`
4957

5058
### Server Detail

‎docs/reference/api/openapi.yaml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ paths:
2222
get:
2323
tags: [servers]
2424
summary: List MCP servers
25-
description: Returns a list of all registered MCP servers
25+
description: |
26+
Returns a paginated list with one record per server version. Without a version filter, results include superseded versions, including when search is provided.
27+
28+
The official registry orders results by server name, then by version string, both ascending. Versions are compared as text, not by semantic version or publication date; the first result for a server is not necessarily its latest version.
29+
30+
Use version=latest to return only the latest version of each matching server. Keep the same filters when following metadata.nextCursor.
2631
parameters:
2732
- name: cursor
2833
in: query

‎internal/api/handlers/v0/servers.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ func RegisterServersEndpoints(api huma.API, pathPrefix string, registry service.
8989
Method: http.MethodGet,
9090
Path: pathPrefix + "/servers",
9191
Summary: "List MCP servers",
92-
Description: "Get a paginated list of MCP servers from the registry",
93-
Tags: []string{tagServers},
92+
Description: "Get a paginated list with one record per server version. Without a version filter, results include superseded versions, including when search is provided. " +
93+
"Results are ordered by server name, then by version string, both ascending. Versions are compared as text, not by semantic version or publication date; the first result for a server is not necessarily its latest version. " +
94+
"Use version=latest to return only the latest version of each matching server. Keep the same filters when following metadata.nextCursor.",
95+
Tags: []string{tagServers},
9496
}, func(ctx context.Context, input *ListServersInput) (*Response[apiv0.ServerListResponse], error) {
9597
// Build filter from input parameters
9698
filter := &database.ServerFilter{}

0 commit comments

Comments
 (0)