Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MCP registry

Gateways and MCP clients increasingly find servers through an MCP registry: a list of server.json entries, each naming a server, its version and the remotes (URLs) or packages that run it. Rustybin serves a mock registry at /mcp-registry that lists the instance's own MCP servers in the registry API's shape, takes entries you add or publish, and fails on purpose in the ways a registry sync has to survive. The console's MCP registry view also browses a real registry and opens any entry in the inspector.

The mock registry

The API is the registry's /v0.1 (the version frozen in 2025); /mcp-registry/v0 answers the same. Point a gateway's registry sync at https://<host>/mcp-registry.

Route
GET /mcp-registry/v0.1/serversOne record per server version, ordered by name then version; cursor, limit (1 to 100, default 30), search (a substring of the name, at least 3 characters), updated_since (RFC 3339), version (latest or an exact one), include_deleted
GET /mcp-registry/v0.1/servers/{serverName}/versionsEvery version of a server; the name is URL-encoded (io.rustybin%2Fmcp)
GET /mcp-registry/v0.1/servers/{serverName}/versions/{version}One version; latest for the latest
POST /mcp-registry/v0.1/publishPublish a server.json with a registry token
PATCH /mcp-registry/v0.1/servers/{serverName}/versions/{version}/status, PATCH /mcp-registry/v0.1/servers/{serverName}/statusactive, deprecated or deleted, with an optional statusMessage (published entries)
POST /mcp-registry/v0.1/validate{valid, issues}
POST /mcp-registry/v0.1/auth/{method}Token stubs: github-at, github-oidc, oidc, dns, http, none
GET /mcp-registry/v0.1/health, ping, versionAs the registry has them

Errors are problem documents (application/problem+json: title, status, detail, errors), as the registry answers them.

GET {{base_url}}/mcp-registry/v0.1/servers?version=latest&limit=3
HTTP 200
[Asserts]
jsonpath "$.metadata.count" == 3
jsonpath "$.metadata.nextCursor" exists
jsonpath "$.servers[0].server.name" startsWith "io.rustybin/"
jsonpath "$.servers[0]._meta['io.modelcontextprotocol.registry/official'].isLatest" == true
[Captures]
cursor: jsonpath "$.metadata.nextCursor"

Follow metadata.nextCursor with the same filters:

GET {{base_url}}/mcp-registry/v0.1/servers?version=latest&limit=3&cursor={{cursor}}
HTTP 200
[Asserts]
jsonpath "$.metadata.count" == 3
GET {{base_url}}/mcp-registry/v0.1/servers?search=ab
HTTP 422
[Asserts]
header "Content-Type" == "application/problem+json"
jsonpath "$.detail" contains "at least 3 characters"

Entries

  • Generated for every MCP server of the instance, in the io.rustybin namespace: io.rustybin/mcp and its variants (mcp-protected, mcp-apikey, the named servers, mcp-sse with an sse remote), io.rustybin/manage for the management server, and io.rustybin/mock-<name> for each mock whose MCP server is serving (deployed, on, MCP enabled; visitor mocks are never listed). The remote URLs use the request's origin, so a gateway in front of the instance sees URLs it can reach (with RUSTYBIN_TRUST_FORWARD, the forwarded host). The headers a remote needs (the API key header, Authorization) are declared on it, and _meta carries the instance path under io.modelcontextprotocol.registry/publisher-provided. A mock's version is its spec's info.version; the others carry the Rustybin version.
  • From the config file: registry.servers in rustybin.yaml, validated when the file loads (an invalid entry is skipped with a warning) and reloaded with it.
  • Published through the API.

File and published entries together are bounded (256). The io.rustybin namespace is reserved for the generated entries; a version can be published once.

GET {{base_url}}/mcp-registry/v0.1/servers/io.rustybin%2Fmock-petstore/versions/latest
HTTP 200
[Asserts]
jsonpath "$.server['$schema']" == "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json"
jsonpath "$.server.remotes[0].type" == "streamable-http"
jsonpath "$.server.remotes[0].url" endsWith "/mock/petstore/_rustybin/mcp"
jsonpath "$._meta['io.modelcontextprotocol.registry/official'].status" == "active"
version: 1
mocks: []
registry:
  servers:
    - $schema: https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json
      name: io.example/weather
      description: Forecasts and alerts for any city
      version: 1.0.0
      remotes:
        - type: streamable-http
          url: https://weather.example.com/mcp

Publishing

A publish needs Authorization: Bearer <registry token>. The auth/* stubs take the bodies the registry defines (github-at: {github_token}; github-oidc and oidc: {oidc_token}; dns and http: {domain, timestamp, signed_timestamp}; none: {}) and succeed: nothing is verified. Tokens last five minutes. One client address may mint 60 tokens a minute (10 in public mode), so a flood cannot push out the token someone else is publishing with; past that it gets 429 with Retry-After: 60.

POST {{base_url}}/mcp-registry/v0.1/auth/dns
Content-Type: application/json
{"domain": "example.com", "timestamp": "2026-10-30T12:00:00Z", "signed_timestamp": "c2lnbmVk"}
HTTP 200
[Asserts]
jsonpath "$.registry_token" startsWith "rbreg_"
jsonpath "$.expires_at" isInteger
[Captures]
token: jsonpath "$.registry_token"
POST {{base_url}}/mcp-registry/v0.1/publish
Authorization: Bearer {{token}}
Content-Type: application/json
{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.example/weather",
  "title": "Weather",
  "description": "Forecasts and alerts for any city",
  "version": "1.0.0",
  "remotes": [{
    "type": "streamable-http",
    "url": "https://weather.example.com/mcp",
    "headers": [{"name": "X-Api-Key", "description": "Your key", "isRequired": true, "isSecret": true}]
  }]
}
HTTP 200
[Asserts]
jsonpath "$.server.name" == "io.example/weather"
jsonpath "$._meta['io.modelcontextprotocol.registry/official'].isLatest" == true

The document is checked against the vendored server.json schema (https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json) and the registry's semantic checks: both name parts start and end with a letter or digit, the version is exact (not ^1.0, >=1, 1.x or latest), $schema is present. A schema violation answers 422, a semantic one 400, each with the failing locations. A remote on localhost is a warning here (the public registry refuses it).

POST {{base_url}}/mcp-registry/v0.1/publish
Authorization: Bearer {{token}}
Content-Type: application/json
{"name": "weather", "version": "^1.0"}
HTTP 422
[Asserts]
jsonpath "$.errors[*].location" contains "body.name"
jsonpath "$.detail" contains "description"

Published versions change status with the same token; a deleted version leaves the list unless include_deleted=true, and always shows to updated_since (that is how a sync learns about deletions):

PATCH {{base_url}}/mcp-registry/v0.1/servers/io.example%2Fweather/versions/1.0.0/status
Authorization: Bearer {{token}}
Content-Type: application/json
{"status": "deprecated", "statusMessage": "Use 2.0.0"}
HTTP 200
[Asserts]
jsonpath "$._meta['io.modelcontextprotocol.registry/official'].status" == "deprecated"
jsonpath "$._meta['io.modelcontextprotocol.registry/official'].statusMessage" == "Use 2.0.0"
PATCH {{base_url}}/mcp-registry/v0.1/servers/io.example%2Fweather/status
Authorization: Bearer {{token}}
Content-Type: application/json
{"status": "active"}
HTTP 200
[Asserts]
jsonpath "$.servers" count == 1
jsonpath "$.servers[0]._meta['io.modelcontextprotocol.registry/official'].status" == "active"
POST {{base_url}}/mcp-registry/v0.1/validate
Content-Type: application/json
{"name": "io.example/x", "description": "One letter is too short a server name", "version": "1.0.0"}
HTTP 200
[Asserts]
jsonpath "$.valid" == false
jsonpath "$.issues[*].reference" contains "invalid-server-name"
GET {{base_url}}/mcp-registry/v0.1/health
HTTP 200
[Asserts]
jsonpath "$.status" == "ok"

GET {{base_url}}/mcp-registry/v0.1/ping
HTTP 200
[Asserts]
jsonpath "$.pong" == true

GET {{base_url}}/mcp-registry/v0.1/version
HTTP 200
[Asserts]
jsonpath "$.version" startsWith "rustybin-"
GET {{base_url}}/mcp-registry/v0/servers?version=latest&limit=1
HTTP 200
[Asserts]
jsonpath "$.servers" count == 1

In public mode (RUSTYBIN_PUBLIC_MODE) publishing and status changes also need the admin token as X-Rustybin-Admin-Token.

Scenarios

The registry.scenario setting (Management, Network, or the MCP registry view; seeded by RUSTYBIN_REGISTRY_SCENARIO) is what a gateway's registry sync must survive:

ScenarioThe registry
normalEvery entry, answered at once
emptyNo entries at all
large2000 synthetic entries on top (io.example.synthetic/server-0001 ...), every tenth with two versions and every fifth with a package: pagination and version=latest
flakyEvery third list request answers 503
slowEvery answer waits 2 seconds
staleEvery entry last updated on 2024-01-15 (updated_since finds nothing new)
invalidOne extra entry that violates the schema (no namespace, no description, an unknown transport)
auth_failEvery token exchange, publish and status change answers 401
PATCH {{base_url}}/_rustybin/settings
X-Rustybin-Admin-Token: {{admin_token}}
Content-Type: application/json
{"values": {"registry.scenario": "flaky"}}
HTTP 200

GET {{base_url}}/mcp-registry/v0.1/servers?limit=1
HTTP 200

GET {{base_url}}/mcp-registry/v0.1/servers?limit=1
HTTP 200

GET {{base_url}}/mcp-registry/v0.1/servers?limit=1
HTTP 503
[Asserts]
jsonpath "$.detail" contains "flaky"

PATCH {{base_url}}/_rustybin/settings
X-Rustybin-Admin-Token: {{admin_token}}
Content-Type: application/json
{"values": {"registry.scenario": null}}
HTTP 200

Validation and the instance's view

POST /_rustybin/registry/validate checks any server.json (the console's publish form calls it as you type). GET /_rustybin/registry is the console's view of the mock registry: every entry with its source (generated, file, published, scenario) and validity, the counts, the scenario and a sync snippet in generic JSON. DELETE /_rustybin/registry/servers/{serverName} (admin, ?version= for one) removes published entries.

POST {{base_url}}/_rustybin/registry/validate
Content-Type: application/json
{"name": "io.example/x", "description": "One letter is too short a server name", "version": "1.0.0"}
HTTP 200
[Asserts]
jsonpath "$.valid" == false
jsonpath "$.issues[*].reference" contains "invalid-server-name"
jsonpath "$.issues[*].reference" contains "schema-missing"
GET {{base_url}}/_rustybin/registry
HTTP 200
[Asserts]
jsonpath "$.scenario" == "normal"
jsonpath "$.counts.published" == 1
jsonpath "$.entries[?(@.source == 'published')].name" contains "io.example/weather"
jsonpath "$.sync_config.registries[0].api_version" == "v0.1"
DELETE {{base_url}}/_rustybin/registry/servers/io.example%2Fweather
X-Rustybin-Admin-Token: {{admin_token}}
HTTP 200
[Asserts]
jsonpath "$.versions" == 1

Browsing a real registry

GET /_rustybin/registry/browse?url=<registry>&search=&cursor=&limit=&version= fetches one page of a registry through the instance and answers its entries with their remotes (type, URL, the headers they declare and the auth that implies), packages and validity. url is a registry base (https://registry.modelcontextprotocol.io, the default; /v0.1 is appended unless the URL ends in /v0.1 or /v0) or /mcp-registry for this instance (in process). Pages are cached for a minute.

Outbound calls follow the egress policy under the purpose registry: registry.modelcontextprotocol.io and the hosts of the saved registries (registry.saved, seeded by RUSTYBIN_REGISTRY_SAVED) are allowed; anything else needs RUSTYBIN_EGRESS_ALLOW, and a registry on this machine the loopback switch.

GET {{base_url}}/_rustybin/registry/browse?url=/mcp-registry&search=weather
HTTP 200
[Asserts]
jsonpath "$.registry" == "/mcp-registry/v0.1"
jsonpath "$.servers[0].name" == "io.example/weather"
jsonpath "$.servers[0].remotes[0].auth.kind" == "api_key"
jsonpath "$.servers[0].remotes[0].auth.name" == "X-Api-Key"
jsonpath "$.servers[0].valid" == true

In the console

MCP registry (in "AI and agents") has two tabs:

  • Mock registry: the registry URL to point a gateway at, Copy as registry sync config (a generic JSON snippet), the scenario picker, the entries with their source, status and validity (each with its server.json, Inspect, Explain and, for published ones, remove), and Publish a server.json: an editor that validates as you type, an auth stub to get the token with, and Write a server.json for my mock (AI assist: the generated entry of a mock and its tools, rewritten by your provider and validated against the schema before it reaches the editor).
  • Browse a registry: the public registry, this instance's mock one, a saved registry or any URL (Save this registry adds it to registry.saved), search, latest or every version, pages; each entry with its remotes and packages, Validate, its server.json, Explain this server entry, and Open in inspector per remote, which opens the inspector on it with the auth the remote declares (through the relay; a remote on this instance opens as one of its servers).

On every surface

The same job from the API, the console, the command line, an agent and the configuration document.

SurfaceWhere
APIThe registry itself under /mcp-registry/v0.1 (and /v0); GET /_rustybin/registry, DELETE /_rustybin/registry/servers/{serverName}, POST /_rustybin/registry/validate, GET /_rustybin/registry/browse
ConsoleThe MCP registry view: Mock registry (the scenario, the entries, Publish a server.json) and Browse a registry (Open in inspector)
CLIrustybin registry status | publish <file> | delete <name> | validate <file> | browse [--registry U] [--search S], rustybin settings set registry.scenario flaky (reference)
Management MCPlist_registry_servers (entries under untrusted_entries, paged), set_registry_scenario, browse_registry (under untrusted_*), validate_server_json, unpublish_registry_server (agent page)
rustybin.yamlregistry.servers (file entries, validated on load), settings: registry.scenario, registry.saved (configuration as code)
EnvironmentRUSTYBIN_REGISTRY_SCENARIO, RUSTYBIN_REGISTRY_SAVED, RUSTYBIN_EGRESS_ALLOW for registries beyond the public one (configuration)