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>.
POST /api/list_tables
Section titled “POST /api/list_tables”Body: none, or {}
curl -X POST https://mcp.911cpb.org/api/list_tables -H "X-API-Key: $PG_MCP_TOKEN"Returns [{ "table_schema", "table_name", "table_type" }].
POST /api/describe_table
Section titled “POST /api/describe_table”{ "table": "Device", "schema": "public" }Returns [{ "column_name", "data_type", "is_nullable", "column_default" }].
POST /api/query
Section titled “POST /api/query”{ "sql": "select count(*) as n from \"Device\"" }Returns:
{ "rowCount": 1, "rows": [{ "n": "92313" }], "truncated": false }Status codes
Section titled “Status codes”| 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": "..." } |