diff --git a/.env.example b/.env.example index 786fc1bf5..6deabd08a 100644 --- a/.env.example +++ b/.env.example @@ -11,6 +11,11 @@ MCP_REGISTRY_DATABASE_URL=postgres://username:password@localhost:5432/mcp-regist # For offline development, use: data/seed.json MCP_REGISTRY_SEED_FROM=https://registry.modelcontextprotocol.io/v0/servers +# Validate seed data against the registry rules on import (default: true) +# Set to false for offline development when seeding from a local file, since +# data/seed.json is not guaranteed to pass validation +MCP_REGISTRY_ENABLE_REGISTRY_VALIDATION=true + # GitHub OAuth configuration # These creds are for local development with the 'MCP Registry Login (Local)' GitHub App # They don't provide any real privileged access, hence why it's okay that they're here diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index b37dd3858..e37366155 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -9,5 +9,5 @@ To publish an MCP server to the registry, use the `mcp-publisher` CLI tool. See ## Development - Use `make` targets where possible (run `make help` to see available targets) -- Run `make check` to run lint, unit tests, and integration tests +- Run `make check` to run lint, schema validation, and all tests (this also stops any running dev-compose environment) - Run `make dev-compose` to start the local development environment \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a5a42cb03..7a1e1b5f2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,8 @@ See the [README](README.md#quick-start) for prerequisites and instructions on ru ### Running checks ```bash -# Run lint, unit tests and integration tests +# Run lint, schema validation, and all tests +# Note: this also runs `make dev-down`, stopping any running dev-compose environment make check ``` diff --git a/README.md b/README.md index 5424e0dda..817836501 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,9 @@ Often (but not always) ideas flow through this pipeline: #### Pre-requisites - **Docker** -- **Go 1.24.x** +- **Go** - version per the `go` directive in [go.mod](./go.mod); the Go toolchain fetches it for you - **ko** - Container image builder for Go ([installation instructions](https://ko.build/install/)) -- **golangci-lint v2.4.0** +- **golangci-lint** - version per the `golangci-lint-action` pin in [ci.yml](./.github/workflows/ci.yml), so local lint matches CI #### Running the server @@ -94,7 +94,8 @@ See [the publisher guide](./docs/modelcontextprotocol-io/quickstart.mdx) for mor #### Other commands ```bash -# Run lint, unit tests and integration tests +# Run lint, schema validation, and all tests +# Note: this also runs `make dev-down`, stopping any running dev-compose environment make check ``` @@ -110,7 +111,8 @@ For Claude and other AI tools: Always prefer make targets over custom commands w ``` ├── cmd/ # Application entry points -│ └── publisher/ # Server publishing tool +│ ├── publisher/ # Server publishing tool +│ └── registry/ # Registry API server ├── data/ # Seed data ├── deploy/ # Deployment configuration (Pulumi) ├── docs/ # Documentation @@ -119,6 +121,7 @@ For Claude and other AI tools: Always prefer make targets over custom commands w │ ├── auth/ # Authentication (GitHub OAuth, JWT, namespace blocking) │ ├── config/ # Configuration management │ ├── database/ # Data persistence (PostgreSQL) +│ ├── importer/ # Seed data import │ ├── service/ # Business logic │ ├── telemetry/ # Metrics and monitoring │ └── validators/ # Input validation diff --git a/docker-compose.yml b/docker-compose.yml index 7eb71c25a..3fff7bca1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,6 @@ services: # 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} diff --git a/scripts/mirror_data/README.md b/scripts/mirror_data/README.md index 3237211f5..2cc3a87b3 100644 --- a/scripts/mirror_data/README.md +++ b/scripts/mirror_data/README.md @@ -14,7 +14,7 @@ These scripts help you: ## Prerequisites -- Go 1.24.x +- Go — see the [prerequisites in the root README](../../README.md#pre-requisites) for the required version - PostgreSQL (via Docker or local installation) - Required Go packages: ```bash @@ -31,7 +31,7 @@ go run scripts/mirror_data/fetch_production_data.go ``` This will: -- Fetch all servers from https://registry.modelcontextprotocol.io/v0.1/servers +- Fetch all servers from https://registry.modelcontextprotocol.io/v0/servers - Handle pagination automatically - Save data to `scripts/mirror_data/production_servers.json` - Be respectful to the API with rate limiting @@ -71,7 +71,7 @@ This will: 4. Analyze the data and report statistics 5. Show sample servers with NULL status values -To test a different migration, edit `maxMigration` in the script (line 24) +To test a different migration, edit `maxMigration` in `load_production_data.go` ### 4. Test Migrations @@ -80,8 +80,8 @@ After loading the data, you can test migrations against real production data. #### Testing a Single Migration ```bash -# Test migration 008 -cat internal/database/migrations/008_separate_official_metadata.sql | \ +# Test the separate_official_metadata migration +cat internal/database/migrations/009_separate_official_metadata.sql | \ docker exec -i test-postgres psql -U postgres -d registry_test ``` @@ -90,7 +90,7 @@ cat internal/database/migrations/008_separate_official_metadata.sql | \ 1. **Check the error output:** ```bash # Run migration and capture all output -cat internal/database/migrations/008_separate_official_metadata.sql | \ +cat internal/database/migrations/009_separate_official_metadata.sql | \ docker exec -i test-postgres psql -U postgres -d registry_test 2>&1 | \ grep -E "(ERROR|NOTICE|WARNING)" ``` @@ -126,7 +126,7 @@ EOF # Start a transaction to test and rollback docker exec test-postgres psql -U postgres -d registry_test <