Add filtering functionality to server list endpoint (#374)

## Summary
- Adds `updated_since`, `search`, and `version` query parameters to `GET
/v0/servers`
- Enables incremental synchronization via RFC3339 timestamp filtering
- Provides simple substring search on server names
- Supports latest version filtering with `version=latest`

This implementation provides the core filtering capabilities needed for
efficient registry synchronization and improved server discovery.

Fixes #291
Fixes #135
This commit is contained in:
adam jones 2025-09-08 13:55:33 -07:00 • committed by GitHub
commit a85456a9b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,13 +1,14 @@
package service
import (
"github.com/modelcontextprotocol/registry/internal/database"
apiv0 "github.com/modelcontextprotocol/registry/pkg/api/v0"
)
// RegistryService defines the interface for registry operations
type RegistryService interface {
// Retrieve all servers
List(cursor string, limit int) ([]apiv0.ServerJSON, string, error)
// Retrieve all servers with optional filtering
List(filter *database.ServerFilter, cursor string, limit int) ([]apiv0.ServerJSON, string, error)
// Retrieve a single server by registry metadata ID
GetByID(id string) (*apiv0.ServerJSON, error)
// Publish a server