docs: correct contributor prerequisites and stale dev-env references (#1520)
The README prerequisites were both stale, and the docs restated the Go version in three places. ## Prerequisites: name the source, do not restate the version | README said | Reality | |---|---| | `Go 1.24.x` | `go 1.26` in [go.mod](https://github.com/modelcontextprotocol/registry/blob/main/go.mod) | | `golangci-lint v2.4.0` | `v2.11.4` pinned in [ci.yml:30](https://github.com/modelcontextprotocol/registry/blob/main/.github/workflows/ci.yml#L30) | Rather than swap in fresher numbers — which only resets the clock on the same drift — this **removes the numbers** and names the authoritative file: ``` - **Go** - version per the `go` directive in go.mod; the Go toolchain fetches it for you - **golangci-lint** - version per the `golangci-lint-action` pin in ci.yml, so local lint matches CI ``` The Go version was stated in **three** places, which is exactly why all three drifted together. All three now point at a single source, so the prerequisites list cannot go stale. Two notes on why the numbers earn so little in prose: - **Go corrects itself.** `go.mod` has no `toolchain` directive, so under the default `GOTOOLCHAIN=auto` the toolchain downloads the required version automatically. A contributor on an older Go gets an upgrade, not a failure — it only hard-errors under `GOTOOLCHAIN=local`. (An earlier version of this description said such a contributor "cannot build"; that was too strong.) - **golangci-lint does not.** Version skew here genuinely changes what you see: running CI's config under a newer golangci-lint (2.12.2) surfaces 23 `goconst` findings in `cmd/publisher/commands/validate_test.go` that CI's pinned 2.11.4 does not report. That is why the README now points at the pin rather than a number someone has to keep in sync. ## `make check` does more than documented Documented in three files as "lint, unit tests and integration tests". Actually [`check: dev-down lint validate test-all`](https://github.com/modelcontextprotocol/registry/blob/main/Makefile#L85) — it also runs schema validation and **stops your running `dev-compose` environment**. Worth knowing before running it mid-session. The Makefile's own `##` help string already said this correctly; only the prose was stale. ## Other verified corrections - **README project structure** omitted `cmd/registry/` — the server entry point and ko/goreleaser build target — and `internal/importer/`. - **`tests/integration/README.md`** said the suite launches **MongoDB**. It launches PostgreSQL (`postgres-integration-test`), as the same file admits nine lines later. It also cited `/v0/servers/{server_id}`, a path removed a while ago; the test actually calls `GET /v0/servers` and `GET /v0/servers/{serverName}/versions/latest` ([main.go:210,255](https://github.com/modelcontextprotocol/registry/blob/main/tests/integration/main.go#L210)). - **`scripts/mirror_data/README.md`** pointed at `internal/database/migrations/008_separate_official_metadata.sql`, which does not exist — that migration is `009_`, while `008_` is `clean_invalid_data.sql`. (Migration 008's own header still calls itself "007a", which is how the numbering slipped.) Also swapped two "edit line NN" pointers for identifier names, since both had already drifted (`maxMigration` is at :30 not :24; the connection string at :23 not :17), and corrected the fetch URL from `/v0.1/servers` to the `/v0/servers` the script actually requests. - **`.env.example`** was missing `MCP_REGISTRY_ENABLE_REGISTRY_VALIDATION`, even though the config reads it ([config.go:18](https://github.com/modelcontextprotocol/registry/blob/main/internal/config/config.go#L18)) and README:50 tells contributors to set it while pointing at `.env.example` as *the* reference. - **`docker-compose.yml`** set `MCP_REGISTRY_ENVIRONMENT`, which nothing reads — no `ENVIRONMENT` env tag in `internal/config`, and no other occurrence in the repo. Removed. (The Pulumi-side `mcp-registry:environment` key is a separate, real thing and is untouched.) - **Deleted `CHANGES.md`** — 0 bytes, untouched since the squashed history base, zero references anywhere. ## Verification `docker compose config` validates. `grep` for `Go 1.x` / `golangci-lint vX` across all `.md`/`.mdx` now returns nothing outside `complete.md` (which #1522 deletes). Both `../../README.md#pre-requisites` links resolve and the anchor matches the real `#### Pre-requisites` heading. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
988b078e02
commit
3e463e52bb
8 changed files with 28 additions and 20 deletions
|
|
@ -11,6 +11,11 @@ MCP_REGISTRY_DATABASE_URL=postgres://username:password@localhost:5432/mcp-regist
|
||||||
# For offline development, use: data/seed.json
|
# For offline development, use: data/seed.json
|
||||||
MCP_REGISTRY_SEED_FROM=https://registry.modelcontextprotocol.io/v0/servers
|
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
|
# GitHub OAuth configuration
|
||||||
# These creds are for local development with the 'MCP Registry Login (Local)' GitHub App
|
# 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
|
# They don't provide any real privileged access, hence why it's okay that they're here
|
||||||
|
|
|
||||||
2
.github/copilot-instructions.md
vendored
2
.github/copilot-instructions.md
vendored
|
|
@ -9,5 +9,5 @@ To publish an MCP server to the registry, use the `mcp-publisher` CLI tool. See
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
- Use `make` targets where possible (run `make help` to see available targets)
|
- 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
|
- Run `make dev-compose` to start the local development environment
|
||||||
|
|
@ -32,7 +32,8 @@ See the [README](README.md#quick-start) for prerequisites and instructions on ru
|
||||||
### Running checks
|
### Running checks
|
||||||
|
|
||||||
```bash
|
```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
|
make check
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
11
README.md
11
README.md
|
|
@ -32,9 +32,9 @@ Often (but not always) ideas flow through this pipeline:
|
||||||
#### Pre-requisites
|
#### Pre-requisites
|
||||||
|
|
||||||
- **Docker**
|
- **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/))
|
- **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
|
#### Running the server
|
||||||
|
|
||||||
|
|
@ -94,7 +94,8 @@ See [the publisher guide](./docs/modelcontextprotocol-io/quickstart.mdx) for mor
|
||||||
#### Other commands
|
#### Other commands
|
||||||
|
|
||||||
```bash
|
```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
|
make check
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -110,7 +111,8 @@ For Claude and other AI tools: Always prefer make targets over custom commands w
|
||||||
|
|
||||||
```
|
```
|
||||||
├── cmd/ # Application entry points
|
├── cmd/ # Application entry points
|
||||||
│ └── publisher/ # Server publishing tool
|
│ ├── publisher/ # Server publishing tool
|
||||||
|
│ └── registry/ # Registry API server
|
||||||
├── data/ # Seed data
|
├── data/ # Seed data
|
||||||
├── deploy/ # Deployment configuration (Pulumi)
|
├── deploy/ # Deployment configuration (Pulumi)
|
||||||
├── docs/ # Documentation
|
├── 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)
|
│ ├── auth/ # Authentication (GitHub OAuth, JWT, namespace blocking)
|
||||||
│ ├── config/ # Configuration management
|
│ ├── config/ # Configuration management
|
||||||
│ ├── database/ # Data persistence (PostgreSQL)
|
│ ├── database/ # Data persistence (PostgreSQL)
|
||||||
|
│ ├── importer/ # Seed data import
|
||||||
│ ├── service/ # Business logic
|
│ ├── service/ # Business logic
|
||||||
│ ├── telemetry/ # Metrics and monitoring
|
│ ├── telemetry/ # Metrics and monitoring
|
||||||
│ └── validators/ # Input validation
|
│ └── validators/ # Input validation
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ services:
|
||||||
# See .env.example for more documentation
|
# See .env.example for more documentation
|
||||||
environment:
|
environment:
|
||||||
- MCP_REGISTRY_DATABASE_URL=${MCP_REGISTRY_DATABASE_URL:-postgres://mcpregistry:mcpregistry@postgres:5432/mcp-registry}
|
- 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_ID=${MCP_REGISTRY_GITHUB_CLIENT_ID:-Iv23licy3GSiM9Km5jtd}
|
||||||
- MCP_REGISTRY_GITHUB_CLIENT_SECRET=${MCP_REGISTRY_GITHUB_CLIENT_SECRET:-0e8db54879b02c29adef51795586f3c510a9341d}
|
- MCP_REGISTRY_GITHUB_CLIENT_SECRET=${MCP_REGISTRY_GITHUB_CLIENT_SECRET:-0e8db54879b02c29adef51795586f3c510a9341d}
|
||||||
- MCP_REGISTRY_JWT_PRIVATE_KEY=${MCP_REGISTRY_JWT_PRIVATE_KEY:-8103179d8ef955f6d3de6d6217224a909ec4060529dfeb1d4ca5a994537658cd}
|
- MCP_REGISTRY_JWT_PRIVATE_KEY=${MCP_REGISTRY_JWT_PRIVATE_KEY:-8103179d8ef955f6d3de6d6217224a909ec4060529dfeb1d4ca5a994537658cd}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ These scripts help you:
|
||||||
|
|
||||||
## Prerequisites
|
## 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)
|
- PostgreSQL (via Docker or local installation)
|
||||||
- Required Go packages:
|
- Required Go packages:
|
||||||
```bash
|
```bash
|
||||||
|
|
@ -31,7 +31,7 @@ go run scripts/mirror_data/fetch_production_data.go
|
||||||
```
|
```
|
||||||
|
|
||||||
This will:
|
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
|
- Handle pagination automatically
|
||||||
- Save data to `scripts/mirror_data/production_servers.json`
|
- Save data to `scripts/mirror_data/production_servers.json`
|
||||||
- Be respectful to the API with rate limiting
|
- Be respectful to the API with rate limiting
|
||||||
|
|
@ -71,7 +71,7 @@ This will:
|
||||||
4. Analyze the data and report statistics
|
4. Analyze the data and report statistics
|
||||||
5. Show sample servers with NULL status values
|
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
|
### 4. Test Migrations
|
||||||
|
|
||||||
|
|
@ -80,8 +80,8 @@ After loading the data, you can test migrations against real production data.
|
||||||
#### Testing a Single Migration
|
#### Testing a Single Migration
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Test migration 008
|
# Test the separate_official_metadata migration
|
||||||
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
|
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:**
|
1. **Check the error output:**
|
||||||
```bash
|
```bash
|
||||||
# Run migration and capture all output
|
# 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 | \
|
docker exec -i test-postgres psql -U postgres -d registry_test 2>&1 | \
|
||||||
grep -E "(ERROR|NOTICE|WARNING)"
|
grep -E "(ERROR|NOTICE|WARNING)"
|
||||||
```
|
```
|
||||||
|
|
@ -126,7 +126,7 @@ EOF
|
||||||
# Start a transaction to test and rollback
|
# Start a transaction to test and rollback
|
||||||
docker exec test-postgres psql -U postgres -d registry_test <<EOF
|
docker exec test-postgres psql -U postgres -d registry_test <<EOF
|
||||||
BEGIN;
|
BEGIN;
|
||||||
\i /dev/stdin < internal/database/migrations/008_separate_official_metadata.sql
|
\i /dev/stdin < internal/database/migrations/009_separate_official_metadata.sql
|
||||||
-- Inspect the results
|
-- Inspect the results
|
||||||
\d servers
|
\d servers
|
||||||
SELECT COUNT(*) FROM servers;
|
SELECT COUNT(*) FROM servers;
|
||||||
|
|
@ -145,7 +145,7 @@ go run scripts/mirror_data/load_production_data.go
|
||||||
|
|
||||||
2. **Test your migration changes:**
|
2. **Test your migration changes:**
|
||||||
```bash
|
```bash
|
||||||
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
|
docker exec -i test-postgres psql -U postgres -d registry_test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -183,7 +183,7 @@ The `load_production_data.go` script connects to:
|
||||||
- User: `postgres`
|
- User: `postgres`
|
||||||
- Password: `testpass`
|
- Password: `testpass`
|
||||||
|
|
||||||
Modify line 17 in the script if you need different connection parameters.
|
Modify the `sql.Open` connection string in `load_production_data.go` if you need different connection parameters.
|
||||||
|
|
||||||
## Example Output
|
## Example Output
|
||||||
|
|
||||||
|
|
@ -234,4 +234,4 @@ docker logs test-postgres
|
||||||
```
|
```
|
||||||
|
|
||||||
### Migration failures
|
### Migration failures
|
||||||
The script stops at migration 007 intentionally. To test migration 008, run it manually after the data is loaded.
|
The script stops at migration 007 intentionally. To test later migrations (008 onwards), run them manually after the data is loaded, in order.
|
||||||
|
|
@ -5,14 +5,14 @@ This directory contains an end-to-end test for publishing to the registry.
|
||||||
## What the Test Covers
|
## What the Test Covers
|
||||||
|
|
||||||
1. **Publisher Tool**: Tests the `publisher` CLI that publishes metadata to the registry
|
1. **Publisher Tool**: Tests the `publisher` CLI that publishes metadata to the registry
|
||||||
2. **Registry API**: Validates the `/v0/publish` and `/v0/servers/{server_id}` endpoints work correctly
|
2. **Registry API**: Validates that `/v0/publish`, `GET /v0/servers`, and `GET /v0/servers/{serverName}/versions/latest` work correctly
|
||||||
3. **Example Validation**: Ensures all example JSON in `docs/reference/server-json/generic-server-json.md` is valid and can be published
|
3. **Example Validation**: Ensures all example JSON in `docs/reference/server-json/generic-server-json.md` is valid and can be published
|
||||||
4. **Data Consistency**: Verifies published data matches what's retrieved from the registry
|
4. **Data Consistency**: Verifies published data matches what's retrieved from the registry
|
||||||
|
|
||||||
## Test Flow
|
## Test Flow
|
||||||
|
|
||||||
1. **Build**: Build `publisher` and `registry`
|
1. **Build**: Build `publisher` and `registry`
|
||||||
2. **Start Services**: Launch registry and MongoDB using Docker Compose with test configuration
|
2. **Start Services**: Launch registry and PostgreSQL using Docker Compose with test configuration
|
||||||
3. **Publish Examples**: Extract JSON examples from documentation and run `publisher` to publish each one
|
3. **Publish Examples**: Extract JSON examples from documentation and run `publisher` to publish each one
|
||||||
4. **Validate Responses**: GET each published server from the registry and compare it to the example JSON
|
4. **Validate Responses**: GET each published server from the registry and compare it to the example JSON
|
||||||
5. **Cleanup**: Stop Docker containers and remove temporary files
|
5. **Cleanup**: Stop Docker containers and remove temporary files
|
||||||
|
|
@ -22,7 +22,7 @@ This directory contains an end-to-end test for publishing to the registry.
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- Docker and Docker Compose
|
- Docker and Docker Compose
|
||||||
- Go 1.24
|
- Go — see the [prerequisites in the root README](../../README.md#pre-requisites) for the required version
|
||||||
- Make sure you're in the repository root directory
|
- Make sure you're in the repository root directory
|
||||||
|
|
||||||
### Run the Tests
|
### Run the Tests
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue