Skip to main content

Base URL

All API endpoints are served under /api/v1 unless otherwise noted. The health endpoint is at /api/health. Interactive API documentation is available at:
  • Swagger UI: http://localhost:3000/api/docs
  • ReDoc: http://localhost:3000/api/redoc

Authentication

All /api/v1/* endpoints require an authenticated admin session, except:
  • GET /api/v1/auth/status — check if setup is needed
  • POST /api/v1/auth/setup — create first admin
  • POST /api/v1/auth/login — authenticate
  • POST /api/v1/auth/login/verify-2fa — complete 2FA login
  • POST /api/v1/auth/logout — clear session
  • GET /api/health — health check

Pagination

Endpoints that return lists accept:
ParameterTypeDefaultMax
skipinteger0
limitinteger50100
Response shape:
{
  "items": [],
  "total": 0
}

Health

GET /api/health

Returns backend health status.
{
  "status": "ok",
  "version": "..."
}

Auth

GET /api/v1/auth/status

Check whether initial admin setup is required. No auth required.

POST /api/v1/auth/setup

Create the first admin account. Only works when no admin exists. No auth required.
FieldTypeRequired
usernamestringyes
passwordstringyes (min 8 chars)

POST /api/v1/auth/login

Authenticate with username and password. If 2FA is enabled, returns a pending_token for the verification step. No auth required.

POST /api/v1/auth/login/verify-2fa

Verify a TOTP code or recovery code. No auth required.
FieldTypeRequired
pending_tokenstringyes
codestringyes
is_recoverybooleanno

POST /api/v1/auth/logout

Clear the session cookie.

GET /api/v1/auth/me

Get current admin info. Returns username and totp_enabled.

PATCH /api/v1/auth/me

Update username and/or password. Requires current_password.

2FA Endpoints

EndpointDescription
POST /api/v1/auth/2fa/setupBegin 2FA setup (returns QR code + recovery codes)
POST /api/v1/auth/2fa/verify-setupVerify TOTP code to activate 2FA
POST /api/v1/auth/2fa/disableDisable 2FA (requires password + TOTP)
POST /api/v1/auth/2fa/regenerate-recoveryRegenerate recovery codes
GET /api/v1/auth/2fa/statusGet 2FA status and remaining recovery codes

Connections

GET /api/v1/connections

List all connections. Supports pagination.

POST /api/v1/connections

Create a new connection.
FieldTypeRequired
namestringyes
db_typestringyes
hoststringyes
portintegeryes
databasestringyes
usernamestringno
passwordstringno
ssl_modestringno
extra_paramsobjectno

GET /api/v1/connections/{id}

Get a single connection.

PATCH /api/v1/connections/{id}

Update a connection. Supports optimistic locking via version field.

DELETE /api/v1/connections/{id}

Delete a connection (cascades to tools, resources, prompts).

POST /api/v1/connections/{id}/test

Test connectivity. Returns success, message, and latency_ms.

Tools

GET /api/v1/tools

List all tools. Supports pagination.

POST /api/v1/tools

Create a new tool.
FieldTypeRequired
connection_idUUIDyes
namestringyes
descriptionstringyes
sql_querystringyes
parametersarrayno
tagsarrayno
return_typestringno
transform_templatestringno

GET /api/v1/tools/{id} / PATCH /api/v1/tools/{id} / DELETE /api/v1/tools/{id}

Standard CRUD. PATCH auto-increments version.

POST /api/v1/tools/{id}/duplicate

Create a copy with _copy suffix.

Resources

GET /api/v1/resources / POST /api/v1/resources

List or create resources.
FieldTypeRequired
connection_idUUIDyes
namestringyes
descriptionstringyes
uri_templatestringyes
sql_querystringyes
parametersarrayno
mime_typestringno

GET /api/v1/resources/{id} / PATCH /api/v1/resources/{id} / DELETE /api/v1/resources/{id}

Standard CRUD.

Prompts

GET /api/v1/prompts / POST /api/v1/prompts

List or create prompts.
FieldTypeRequired
namestringyes
descriptionstringyes
templatestringyes
argumentsarrayno

GET /api/v1/prompts/{id} / PATCH /api/v1/prompts/{id} / DELETE /api/v1/prompts/{id}

Standard CRUD.

Schema

GET /api/v1/schema/{connection_id}/tables

List all tables in the connected database.

GET /api/v1/schema/{connection_id}/tables/{table}/columns

List columns for a specific table.

Preview

POST /api/v1/preview/execute

Execute a SQL query in read-only mode (10-second timeout).
FieldTypeRequired
connection_idUUIDyes
sql_querystringyes
parametersobjectno
transform_templatestringno
Returns rows, columns, row_count, execution_time. When transform_template is provided, also returns transformed_result and optionally transform_error.

Deploy

POST /api/v1/deploy

Generate code and deploy the MCP server.

GET /api/v1/deploy/status

Get deployment status: stopped, deploying, running, or error.

POST /api/v1/deploy/stop

Stop the running MCP container.

WS /api/v1/deploy/logs

WebSocket endpoint for streaming MCP container logs in real time.

Server Configuration

GET /api/v1/server/config

Get the current server configuration.

PATCH /api/v1/server/config

Update server configuration.

GET /api/v1/server/health

Get MCP server health status.

GET /api/v1/server/generated

Get the generated server code.

GET /api/v1/server/ssl/status / POST /api/v1/server/ssl/issue

SSL certificate status and issuance.

History

GET /api/v1/history

List change history entries. Filter by entity_type, entity_id, action.

GET /api/v1/history/{entity_type}/{entity_id}

Get change history for a specific entity.

POST /api/v1/history/{history_id}/rollback

Rollback an entity to a previous snapshot.

Queue & Metrics

GET /api/v1/queue/metrics

Current queue metrics per connection.

GET /api/v1/metrics/stats

Per-tool aggregate performance statistics.

GET /api/v1/metrics/timeseries

Minute-level time-series data. Query param: period (1h, 6h, 24h, 7d).

Export / Import

GET /api/v1/export-import/export

Export all entities as JSON (passwords excluded).

POST /api/v1/export-import/import

Import entities from JSON. Supports dry_run query parameter.

Agent Tokens & OAuth Clients

POST /api/v1/agent-tokens / GET /api/v1/agent-tokens / DELETE /api/v1/agent-tokens/{id}

Create, list, and revoke temporary agent tokens.

POST /api/v1/oauth-clients / GET /api/v1/oauth-clients / DELETE /api/v1/oauth-clients/{id}

Create, list, and revoke OAuth2 clients.

GET /api/v1/agent-activity

List recent agent activity log.

Error Responses

All errors follow a consistent format:
{
  "detail": "Human-readable error message"
}
HTTP StatusMeaning
400Bad request (validation error)
401Not authenticated
403Forbidden
404Not found
409Conflict (duplicate name, version mismatch)
422Unprocessable entity (validation error)
429Rate limited
500Internal server error

See Also

Agent MCP

AI agent access via 44 MCP tools with tokens and OAuth2

Connections

Create and manage database connections (UI guide)

Tools

Build SQL-backed MCP tools (UI guide)

Deployment

Deploy the MCP server and connect clients

Security

Authentication, 2FA, and encryption details

Configuration

Environment variables for all services