fix: seed from production API by default to ensure validation passes (#611)

Fixes #584

## Summary

Changes the default seed source from local file to production API with
filtering to keep startup fast. This ensures local development
environments mirror production behavior and all seed data passes
validation by default.

## Changes

- **Default seed source**:
`https://registry.modelcontextprotocol.io/v0/servers?search=domdomegg`
(4 servers)
  - Fast startup (~1-2 seconds)
  - All data passes validation
  - Production-like environment by default
  
- **Updated `data/seed.json`**: Now contains filtered production data (4
servers) for offline development

- **Clear documentation**: Added comments in `docker-compose.yml` and
updated `README.md` and `.env.example` explaining:
  - How to use offline mode: `MCP_REGISTRY_SEED_FROM=data/seed.json`
- How to fetch all servers:
`MCP_REGISTRY_SEED_FROM=https://registry.modelcontextprotocol.io/v0/servers`

- **Validation stays enabled**:
`MCP_REGISTRY_ENABLE_REGISTRY_VALIDATION=true` by default

## Why this approach

Per @domdomegg's comment in #584, the goal is to make local environments
as similar to production as possible. Using the production API with
filtering achieves this while keeping startup fast.
This commit is contained in:
adam jones 2025-10-03 21:58:37 +01:00 • committed by GitHub
commit 53d67be5bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 84 additions and 12597 deletions

View file

@ -8,7 +8,8 @@ MCP_REGISTRY_VERSION=dev
MCP_REGISTRY_DATABASE_URL=postgres://username:password@localhost:5432/mcp-registry
# Path or URL to import seed data (supports local files and HTTP URLs)
MCP_REGISTRY_SEED_FROM=data/seed.json
# For offline development, use: data/seed.json
MCP_REGISTRY_SEED_FROM=https://registry.modelcontextprotocol.io/v0/servers
# GitHub OAuth configuration
# These creds are for local development with the 'MCP Registry Login (Local)' GitHub App

View file

@ -40,7 +40,9 @@ Often (but not always) ideas flow through this pipeline:
make dev-compose
```
This starts the registry at [`localhost:8080`](http://localhost:8080) with PostgreSQL and seed data. The database uses ephemeral storage and is reset each time you restart the containers, ensuring a clean state for development and testing.
This starts the registry at [`localhost:8080`](http://localhost:8080) with PostgreSQL. The database uses ephemeral storage and is reset each time you restart the containers, ensuring a clean state for development and testing.
By default, the registry seeds from the production API with a filtered subset of servers (to keep startup fast). This ensures your local environment mirrors production behavior and all seed data passes validation. For offline development you can seed from a file without validation with `MCP_REGISTRY_SEED_FROM=data/seed.json MCP_REGISTRY_ENABLE_REGISTRY_VALIDATION=false make dev-compose`.
The setup can be configured with environment variables in [docker-compose.yml](./docker-compose.yml) - see [.env.example](./.env.example) for a reference.

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,7 @@ services:
- MCP_REGISTRY_GITHUB_CLIENT_SECRET=${MCP_REGISTRY_GITHUB_CLIENT_SECRET:-0e8db54879b02c29adef51795586f3c510a9341d}
- MCP_REGISTRY_JWT_PRIVATE_KEY=${MCP_REGISTRY_JWT_PRIVATE_KEY:-8103179d8ef955f6d3de6d6217224a909ec4060529dfeb1d4ca5a994537658cd}
- MCP_REGISTRY_ENABLE_ANONYMOUS_AUTH=${MCP_REGISTRY_ENABLE_ANONYMOUS_AUTH:-true}
- MCP_REGISTRY_SEED_FROM=${MCP_REGISTRY_SEED_FROM:-data/seed.json}
- MCP_REGISTRY_SEED_FROM=${MCP_REGISTRY_SEED_FROM:-https://registry.modelcontextprotocol.io/v0/servers?search=domdomegg}
- MCP_REGISTRY_OIDC_ENABLED=${MCP_REGISTRY_OIDC_ENABLED:-true}
- MCP_REGISTRY_OIDC_ISSUER=${MCP_REGISTRY_OIDC_ISSUER:-https://accounts.google.com}
- MCP_REGISTRY_OIDC_CLIENT_ID=${MCP_REGISTRY_OIDC_CLIENT_ID:-32555940559.apps.googleusercontent.com}