registry/docker-compose.yml
adam jones 53d67be5bd
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.
2025-10-03 23:58:37 +03:00

45 lines
2.1 KiB
YAML

services:
registry:
image: modelcontextprotocol/registry:dev
pull_policy: never
container_name: registry
build:
dockerfile: Dockerfile
depends_on:
postgres:
condition: service_healthy
# See .env.example for more documentation
environment:
- MCP_REGISTRY_DATABASE_URL=${MCP_REGISTRY_DATABASE_URL:-postgres://mcpregistry:mcpregistry@postgres:5432/mcp-registry}
- MCP_REGISTRY_ENVIRONMENT=${MCP_REGISTRY_ENVIRONMENT:-test}
- MCP_REGISTRY_GITHUB_CLIENT_ID=${MCP_REGISTRY_GITHUB_CLIENT_ID:-Iv23licy3GSiM9Km5jtd}
- 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:-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}
- MCP_REGISTRY_OIDC_EXTRA_CLAIMS=${MCP_REGISTRY_OIDC_EXTRA_CLAIMS:-[{"hd":"modelcontextprotocol.io"}]}
- MCP_REGISTRY_OIDC_EDIT_PERMISSIONS=${MCP_REGISTRY_OIDC_EDIT_PERMISSIONS:-*}
- MCP_REGISTRY_OIDC_PUBLISH_PERMISSIONS=${MCP_REGISTRY_OIDC_PUBLISH_PERMISSIONS:-*}
- MCP_REGISTRY_ENABLE_REGISTRY_VALIDATION=${MCP_REGISTRY_ENABLE_REGISTRY_VALIDATION:-true}
ports:
- 8080:8080
restart: "unless-stopped"
postgres:
image: postgres:16-alpine
container_name: postgres
environment:
POSTGRES_DB: mcp-registry
POSTGRES_USER: mcpregistry
POSTGRES_PASSWORD: mcpregistry
PGDATA: /var/lib/postgresql/data/pgdata
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mcpregistry -d mcp-registry"]
interval: 1s
retries: 30
ports:
- "5432:5432"
restart: "unless-stopped"