API
The public REST API: scan servers, read stored reports, manage monitor targets and webhooks, read the directory and leaderboard. Keys, rate limits and errors.
On this page
- Authentication
- Rate limits
- Errors
- POST /api/v1/scan
- SDK
- Reports
- GET /api/v1/scans/{id}
- GET /api/v1/scans?url=
- Monitored servers
- POST /api/v1/servers
- GET /api/v1/servers
- DELETE /api/v1/servers/{id}
- GET /api/v1/servers/{id}/status
- Directory and leaderboard
- GET /api/v1/directory/{slug}
- GET /api/v1/leaderboard and /api/v1/leaderboard/{category}
- Webhooks
- POST /api/v1/webhooks
- Deliveries
The API runs the same scan as the web page and the CLI and returns the full report as JSON. It also reads stored reports, manages monitored servers and webhooks, and serves the public directory and leaderboard. The machine-readable contract is packages/sdk/openapi.yaml (OpenAPI 3.1). A typed TypeScript client is in packages/sdk (@shipyard/sdk).
Authentication
Create an API key in the dashboard. Keys start with shp_. Send it on every request:
Authorization: Bearer shp_...
A missing key returns 401 with WWW-Authenticate: Bearer realm="mcp-shipyard". A wrong or revoked key returns 401 with WWW-Authenticate: Bearer error="invalid_token".
Rate limits
Limits are per key, as sliding one-hour windows, in three buckets: scans 30, writes (POST and DELETE on servers and webhooks) 60, reads (every GET) 600. The public directory and leaderboard need no key and allow 120 requests per minute per client IP. Every response after authentication carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (unix seconds). When a window is full you get 429 with X-RateLimit-Remaining: 0 and Retry-After in seconds. A request counts before its body is validated, so a 400 or 422 still uses a slot.
Errors
Always { "error": "<message>" } with one of: 400 invalid input, 401 missing or bad key, 402 plan limit, 404 not found (also for ids that belong to another team), 409 conflict, 422 private or local address, 429 rate limited, 500, 502 target unreachable, 504 target timed out. Team data is scoped to the key's team: another team's id is always a 404.
POST /api/v1/scan
curl -sS https://mcpshipyard.com/api/v1/scan \
-H "Authorization: Bearer $SHIPYARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://mcp.example.com/mcp"}'
Body: { "url": string, "headers"?: Record<string,string>, "oauthSessionId"?: string }.
headers(at most 20) are sent to the target for this scan only, so authenticated servers can be scanned. They are never stored and never logged, and they are not part of the report.oauthSessionIdis the id of a stored sign-in of your team (ses_..., from the connections page after you used "Sign in to scan tools"). Shipyard refreshes it if needed and scans with it. It only works for the server URL it was issued for. See OAuth scans.
Success returns 200 with the ScanReport (id, probe, rules, and evals and presence when run), plus X-Report-Id. The report is saved for your team.
Errors are always { "error": "<message>" }:
| Status | Meaning |
|---|---|
| 400 | url missing, not parseable, or not http or https; bad headers; oauthSessionId for a different server |
| 401 | missing, invalid or revoked key |
| 404 | oauthSessionId is not a stored sign-in of your team |
| 422 | private or local address (localhost, 10.x, 192.168.x, 172.16-31.x, 169.254.x, .local, .internal) |
| 429 | hourly limit reached |
| 500 | scan failed |
| 502 | target unreachable |
| 504 | target timed out |
Scans can take up to 60 seconds. Set your client timeout above that.
SDK
import { Shipyard } from "@shipyard/sdk";
const shipyard = new Shipyard({ apiKey: process.env.SHIPYARD_API_KEY! });
const report = await shipyard.scan("https://mcp.example.com/mcp");
It retries 429 using Retry-After and throws typed errors. It has a method per endpoint below (getScan, listScans, addServer, listServers, deleteServer, serverStatus, directory, leaderboard, createWebhook, listWebhooks, deleteWebhook). See the package README.
Reports
Reports are private to the team that ran the scan. Anonymous scans from the home page have no team and stay open to anyone with the id. Owners can make a team report public with the Share panel on the report page, which creates a read-only /r/{token} link without account data and is noindex unless the owner allows indexing.
GET /api/v1/scans/{id}
A stored report by the id from X-Report-Id. Returns the ScanReport. 404 if the id is unknown or belongs to another team. Uses the read bucket, not the scan bucket.
GET /api/v1/scans?url=
Your team's stored scans of one server URL, newest first: { "url", "scans": [{ "id", "url", "createdAt", "reachable", "score", "toolCount" }] }. limit defaults to 20, max 100. 400 without url.
Monitored servers
POST /api/v1/servers
Start monitoring. Body: { "url": string, "label"?: string, "headers"?: Record<string,string>, "fixtures"?: ToolFixture[], "evalCases"?: EvalCase[] }. Returns 201 { "id", "url", "label"?, "createdAt" }. 409 if your team already monitors the URL, 402 over the plan's server count, 422 for a private address. Stored headers are encrypted and write-only: no endpoint returns them.
GET /api/v1/servers
{ "servers": [{ "id", "url", "label"?, "createdAt" }] }.
DELETE /api/v1/servers/{id}
Stop monitoring. 204, or 404 for an unknown id or another team's server.
GET /api/v1/servers/{id}/status
From the stored checks: { "id", "url", "state": "up" | "degraded" | "down" | "unknown", "lastCheckedAt", "uptime30d", "checks30d", "latencyMs": { "p50", "p95" }, "toolCount", "lastScanId", "lastEval": { "ranAt", "scanId", "passRate", "overallPassRate", "totalCostUsd" } | null, "openIncidents": [{ "id", "startedAt", "severity", "title", "detail" }] }. uptime30d is the percentage of checks in the last 30 days that reached the server, or null with no checks. Latencies are the handshake-to-finish time of reachable checks, or null. down means the latest check failed to reach the server, degraded means it did but has a failing blocker or major finding.
Directory and leaderboard
Public, no key, cached, 120 requests per minute per client IP.
GET /api/v1/directory/{slug}
{ "slug", "name", "url", "description", "repository"?, "version"?, "health", "score", "auth", "toolCount", "transport"?, "protocolVersion"?, "lastCheckedAt" }. 404 for unknown slugs.
GET /api/v1/leaderboard and /api/v1/leaderboard/{category}
The first lists categories: { "model"?, "date"?, "categories": [{ "slug", "title", "description"?, "entries"? }] }. The second ranks one: { "category", "title", "model"?, "updatedAt", "trials"?, "entries": [{ "rank", "name", "slug"?, "url"?, "share", "ciLow"?, "ciHigh"?, "picks"? }], "nextCursor"? }. share is the share of trials where the model picked the server (0 to 1). limit defaults to 50, max 200. Pass nextCursor as cursor for the next page. 404 for unknown categories.
Webhooks
POST /api/v1/webhooks
Body: { "url": https URL on a public host, "events": ("server.down" | "server.recovered" | "tools.changed" | "score.dropped")[], "serverIds"?: string[] }. Omit serverIds for all of your team's monitored servers. Returns 201 with { "id", "url", "events", "serverIds", "createdAt", "secret" }. The secret is shown once. A team can have 10 webhooks.
GET /api/v1/webhooks lists them without secrets. DELETE /api/v1/webhooks/{id} returns 204, or 404 for another team's id.
Deliveries
Sent when a check of a monitored server differs from the previous one: server.down (reachable, then not), server.recovered, tools.changed (names, descriptions, schemas or annotations differ), score.dropped (overall score down 5 points or more).
POST with Content-Type: application/json and body { "id", "type", "createdAt", "data" }, where data has serverId, url, scanId and event details. Two headers: X-Shipyard-Timestamp (unix seconds) and X-Shipyard-Signature: sha256=<hex>, the HMAC-SHA256 of "<timestamp>.<raw body>" with your secret. Compare in constant time and reject timestamps more than 5 minutes old. This is the same format as the signed webhook sink of the monitor.
import { createHmac, timingSafeEqual } from "node:crypto";
const expected = "sha256=" + createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest("hex");
const ok = expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
A delivery is tried up to 3 times, 1 second and then 5 seconds apart, on network errors, 408, 429 and 5xx. There is no longer retry queue: if your endpoint is down for longer, poll GET /api/v1/servers/{id}/status. The URL is resolved and checked at send time, and private addresses are refused.