Skip to main content

Registry API

The MCP Registry API provides endpoints for managing MCP server registrations.

Base URL

http://localhost:8080

Authentication

Scanner operations require an API key in the X-API-Key header:

curl -H "X-API-Key: your-api-key" http://localhost:8080/mcp-servers

Endpoints Overview

EndpointMethodDescription
/mcp-serversGETList all MCP servers
/mcp-serversPOSTRegister a new server
/mcp-servers/:idGETGet server by ID
/mcp-servers/:idPUTUpdate server
/mcp-servers/:idDELETERemove server
/scannersGETList scanners
/scannersPOSTRegister scanner
/scanners/:idGETGet scanner by ID
/healthGETHealth check
/readyGETReadiness check

MCP Servers

GET /mcp-servers

List all registered MCP servers.

Query Parameters:

ParameterTypeDescription
statusstringFilter by status (active, unhealthy, unknown)
capabilitystringFilter by capability/tool name
scanner_idstringFilter by scanner

Response:

{
"servers": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "web-search",
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-web-search"],
"capabilities": {
"tools": [
{
"name": "search_web",
"description": "Search the web",
"input_schema": {
"type": "object",
"properties": {
"query": {"type": "string"}
}
}
}
],
"resources": [],
"prompts": []
},
"status": "active",
"last_verified": "2024-01-15T10:00:00Z",
"scanner_id": "scanner-uuid"
}
]
}

POST /mcp-servers

Register a new MCP server.

Headers:

X-API-Key: scanner-api-key
Content-Type: application/json

Request Body:

{
"name": "my-mcp-server",
"command": "node",
"args": ["./server.js"],
"env": {
"API_KEY": "secret"
},
"capabilities": {
"tools": [
{
"name": "my_tool",
"description": "Does something useful",
"input_schema": {
"type": "object",
"properties": {
"input": {"type": "string"}
},
"required": ["input"]
}
}
]
}
}

Response:

{
"id": "generated-uuid",
"name": "my-mcp-server",
"status": "active",
"created_at": "2024-01-15T10:00:00Z"
}

Status Codes:

CodeDescription
201Server registered
400Invalid request
401Invalid API key
409Server already exists

GET /mcp-servers/:id

Get a specific MCP server.

Response: Server object

Status Codes:

CodeDescription
200Server found
404Server not found

PUT /mcp-servers/:id

Update an MCP server.

Headers:

X-API-Key: scanner-api-key

Request Body: Same as POST

Status Codes:

CodeDescription
200Server updated
401Invalid API key
404Server not found

DELETE /mcp-servers/:id

Remove an MCP server.

Headers:

X-API-Key: scanner-api-key

Status Codes:

CodeDescription
204Server removed
401Invalid API key
404Server not found

Scanners

GET /scanners

List all registered scanners.

Response:

{
"scanners": [
{
"id": "scanner-uuid",
"agent_id": "scanner-001",
"name": "Production Scanner",
"last_seen": "2024-01-15T10:00:00Z",
"is_active": true,
"servers_count": 15
}
]
}

POST /scanners

Register a new scanner.

Request Body:

{
"agent_id": "scanner-001",
"name": "My Scanner",
"api_key": "secret-api-key"
}

Response:

{
"id": "generated-uuid",
"agent_id": "scanner-001",
"name": "My Scanner",
"created_at": "2024-01-15T10:00:00Z"
}

Status Codes:

CodeDescription
201Scanner registered
400Invalid request
409Agent ID already exists

GET /scanners/:id

Get a specific scanner.

Response: Scanner object with statistics

Health Checks

GET /health

Basic health check.

Response:

{
"status": "healthy",
"database": "connected"
}

GET /ready

Readiness check.

Response:

{
"status": "ready",
"database": "connected",
"servers_count": 25,
"scanners_count": 3
}

Error Responses

All error responses follow this format:

{
"error": "NotFound",
"message": "MCP server not found",
"details": {
"id": "non-existent-id"
}
}

Webhooks

The registry can send webhooks for server status changes:

{
"event": "server.status_changed",
"server_id": "uuid",
"old_status": "active",
"new_status": "unhealthy",
"timestamp": "2024-01-15T10:00:00Z"
}

Configure webhooks via environment variable:

WEBHOOK_URL=https://your-app.com/webhooks/mcp-registry

OpenAPI Specification

The full OpenAPI specification is available at:

  • /openapi.json - JSON format
  • /openapi.yaml - YAML format

Interactive API explorer coming soon with OpenAPI integration.