Skip to content

Add v0.1 server browse endpoints#4871

Open
rdimitrov wants to merge 3 commits intomainfrom
registry/v01-server-endpoints
Open

Add v0.1 server browse endpoints#4871
rdimitrov wants to merge 3 commits intomainfrom
registry/v01-server-endpoints

Conversation

@rdimitrov
Copy link
Copy Markdown
Member

Summary

  • The Desktop/FE team needs upstream-compatible server browse endpoints to align with the registry server's API. Currently servers are only available via the ToolHive-specific /api/v1beta/registry/{name}/servers endpoint which returns ToolHive types.
  • Add v0.1 server endpoints that return ServerJSON matching the upstream MCP registry spec, with pagination and search. Combine with the existing skills endpoint into a single router with shared helpers.

Fixes #4199

Type of change

  • New feature

Test plan

  • Unit tests (task test)
  • Linting (task lint-fix)

Changes

File Change
pkg/api/v1/registry_v01.go New: combined router + shared helpers (pagination, provider accessor, JSON errors)
pkg/api/v1/registry_v01_servers.go New: list + get server handlers with ServerJSON conversion
pkg/api/v1/registry_v01_servers_test.go New: integration + unit tests
pkg/api/v1/registry_v01_skills.go Refactored to use shared helpers
pkg/api/v1/registry_v01_skills_test.go Updated for shared router
pkg/api/server.go Mount combined RegistryV01Router()

Does this introduce a user-facing change?

Yes — two new API endpoints:

  • GET /registry/{name}/v0.1/servers (paginated, searchable via ?q=)
  • GET /registry/{name}/v0.1/servers/{serverName}/versions/latest

Generated with Claude Code

Add upstream-compatible server browse endpoints:
- GET /registry/{name}/v0.1/servers (paginated, searchable)
- GET /registry/{name}/v0.1/servers/{serverName}/versions/latest

Servers are converted from ToolHive types to ServerJSON using
toolhive-core converters. Same pattern as the skills endpoint.

Combine skills and servers into a single RegistryV01Router with
shared helpers (provider accessor, pagination, JSON errors).
Refactor skills handlers to use shared helpers.

Ref: #4199

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added the size/L Large PR: 600-999 lines changed label Apr 15, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 61.74497% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.09%. Comparing base (e92dba4) to head (94ae593).

Files with missing lines Patch % Lines
pkg/api/v1/registry_v01_servers.go 49.42% 35 Missing and 9 partials ⚠️
pkg/api/v1/registry_v01.go 78.57% 11 Missing and 1 partial ⚠️
pkg/api/server.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4871      +/-   ##
==========================================
+ Coverage   69.06%   69.09%   +0.03%     
==========================================
  Files         531      533       +2     
  Lines       55172    55264      +92     
==========================================
+ Hits        38104    38185      +81     
- Misses      14140    14142       +2     
- Partials     2928     2937       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/L Large PR: 600-999 lines changed labels Apr 15, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Large PR Detected

This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.

How to unblock this PR:

Add a section to your PR description with the following format:

## Large PR Justification

[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformation

Alternative:

Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.

See our Contributing Guidelines for more details.


This review will be automatically dismissed once you add the justification section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rdimitrov rdimitrov force-pushed the registry/v01-server-endpoints branch from fd52881 to d298cd4 Compare April 15, 2026 22:39
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Apr 15, 2026
The page overflow guard was computed against the default limit (50)
before the actual limit from the query string was parsed. This meant
(page-1)*limit could overflow when both a large page and custom
limit were specified. Fix by parsing both page and limit first,
then computing the cap.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rdimitrov rdimitrov force-pushed the registry/v01-server-endpoints branch from f1ab2bf to 94ae593 Compare April 15, 2026 22:55
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Extra large PR: 1000+ lines changed

Projects

None yet

1 participant