Merge pull request #6 from modelcontextprotocol/sridharavinash/seed

Add count to server response and fix Makefile paths
This commit is contained in:
Avinash Sridhar 2025-04-23 22:32:44 -04:00 • committed by GitHub
commit 4c401c0b25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -40,12 +40,12 @@ test:
# Run the application
run:
@echo "Running $(BINARY_NAME)..."
@$(GO) run $(MAIN_PATH)
@$(GO) run $(MAIN_PACKAGE)/main.go $(MAIN_PACKAGE)/version.go
# Run the application with test environment (using fake service)
run-test:
@echo "Running $(BINARY_NAME) with test environment..."
@APP_ENV=test $(GO) run $(MAIN_PATH)
@APP_ENV=test $(GO) run $(MAIN_PACKAGE)/main.go $(MAIN_PACKAGE)/version.go
# Install dependencies
deps:

View file

@ -20,6 +20,8 @@ type PaginatedResponse struct {
// Metadata contains pagination metadata
type Metadata struct {
NextCursor string `json:"next_cursor,omitempty"`
Count int `json:"count,omitempty"`
Total int `json:"total,omitempty"`
}
// ServersHandler returns a handler for listing registry items
@ -82,6 +84,7 @@ func ServersHandler(registry service.RegistryService) http.HandlerFunc {
if nextCursor != "" {
response.Metadata = Metadata{
NextCursor: nextCursor,
Count: len(registries),
}
}