Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Empty file removed CHANGES.md
Empty file.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
```

Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
20 changes: 10 additions & 10 deletions scripts/mirror_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
```

Expand All @@ -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)"
```
Expand Down Expand Up @@ -126,7 +126,7 @@ EOF
# Start a transaction to test and rollback
docker exec test-postgres psql -U postgres -d registry_test <<EOF
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
\d servers
SELECT COUNT(*) FROM servers;
Expand All @@ -145,7 +145,7 @@ go run scripts/mirror_data/load_production_data.go

2. **Test your migration changes:**
```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
```

Expand Down Expand Up @@ -183,7 +183,7 @@ The `load_production_data.go` script connects to:
- User: `postgres`
- 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

Expand Down Expand Up @@ -234,4 +234,4 @@ docker logs test-postgres
```

### 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.
6 changes: 3 additions & 3 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ This directory contains an end-to-end test for publishing to the registry.
## What the Test Covers

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
4. **Data Consistency**: Verifies published data matches what's retrieved from the registry

## Test Flow

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
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
Expand All @@ -22,7 +22,7 @@ This directory contains an end-to-end test for publishing to the registry.
### Prerequisites

- 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

### Run the Tests
Expand Down
Loading