Skip to content

Infrastructure Endpoints

Health checks, metrics, and the MCP HTTP transport.

Health Probes

MethodEndpointDescription
GET/api/health/liveLiveness probe
GET/api/health/readyReadiness probe (checks DB)
GET/api/health/startupStartup probe (uptime, version, environment)

GET /health/live

Liveness probe for container orchestration. Returns { "status": "ok" }.

GET /health/ready

Readiness probe. Checks database connectivity.

Response

json
{
  "status": "ready",
  "checks": {
    "database": "ok"
  }
}

When degraded (503):

json
{
  "status": "degraded",
  "checks": {
    "database": "error"
  }
}

GET /health/startup

Startup probe. Returns service information.

Response

json
{
  "status": "started",
  "uptime": 12345,
  "version": "1.0.0",
  "environment": "production"
}

Metrics

GET /metrics

Prometheus metrics endpoint. Requires X-Admin-Key header.

MethodEndpointDescription
GET/api/metricsPrometheus metrics (requires X-Admin-Key)

MCP over HTTP

The MCP server is available over Streamable HTTP at /api/mcp, protected by admin authentication. This endpoint implements the Model Context Protocol over HTTP, enabling remote MCP clients to access portfolio tools, resources, and prompts.

All three methods require the X-Admin-Key header. Sessions are stateful -- after initialization, include the mcp-session-id header returned by the server.

MethodEndpointDescription
POST/api/mcpMCP JSON-RPC requests (initialize, tool calls)
GET/api/mcpSSE stream for server-initiated notifications
DELETE/api/mcpTerminate MCP session

POST /api/mcp

Send JSON-RPC requests to the MCP server. The first request must be an initialize request (no session ID). Subsequent requests must include the mcp-session-id header.

Headers

HeaderRequiredDescription
X-Admin-KeyYesAdmin API key
Content-TypeYesapplication/json
mcp-session-idAfter initSession ID from initialization response

Request Body (initialize example)

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-03-26",
    "capabilities": {},
    "clientInfo": { "name": "my-client", "version": "1.0.0" }
  }
}

Response includes an mcp-session-id header and the JSON-RPC response body.

GET /api/mcp

Open an SSE (Server-Sent Events) stream for server-initiated notifications. Requires a valid mcp-session-id header.

DELETE /api/mcp

Terminate an MCP session and clean up server-side resources. Requires a valid mcp-session-id header.

For full details on available MCP tools, resources, and prompts, see the MCP Server integration guide.

See Also

Released under the MIT License.