Skip to content

REST API

Base URL: https://mcp.911cpb.org OpenAPI 3.1 spec: /openapi.json (public)

Every endpoint is a POST with a JSON body and needs Authorization: Bearer <token> or X-API-Key: <token>.

Body: none, or {}

Terminal window
curl -X POST https://mcp.911cpb.org/api/list_tables -H "X-API-Key: $PG_MCP_TOKEN"

Returns [{ "table_schema", "table_name", "table_type" }].

{ "table": "Device", "schema": "public" }

Returns [{ "column_name", "data_type", "is_nullable", "column_default" }].

{ "sql": "select count(*) as n from \"Device\"" }

Returns:

{ "rowCount": 1, "rows": [{ "n": "92313" }], "truncated": false }
Code Meaning Body
200 Success Result JSON
400 Body isn’t JSON, or a required field is missing { "error": "..." }
401 Missing or wrong token Unauthorized
404 Unknown path { "error": "Not found" }
405 Not a POST { "error": "Use POST" }
422 Query rejected by the query rules, or Postgres error (syntax, timeout) { "error": "..." }