Skip to main content

Use LordBase from an AI assistant (MCP)

LordBase runs a Model Context Protocol (MCP) server. Once connected, your AI assistant can list your workspaces and databases, create a database, read metrics and slow queries, take or restore a backup, browse tables and run queries, for example: "Create a PostgreSQL database called staging in my main workspace" or "Show me the slowest queries on the orders database".

Addresshttps://api.lordbase.com/e/v1/mcp/
TransportStreamable HTTP (JSON answers, no session)
AuthenticationAuthorization: Bearer YOUR_DEVELOPER_TOKEN

The server is a thin layer over the management API: every tool performs one API operation with your token, so your token's scopes, your workspace role and your plan limits apply exactly as they do for the API.

1. Create a token for your assistant​

In the signed-in dashboard, open Settings and create a token used only by your assistant. Choose its scopes from what you want the assistant to do:

  • Look but do not touch: read_workspaces, read_databases, read_backups. The assistant can list, inspect, read metrics, analytics and rows, but cannot change anything or see passwords.
  • Day-to-day work: add write_databases and write_backups to create databases and users, take backups, run queries and reveal connection details.
  • Add write_workspaces only if the assistant should create workspaces.

Give the token a short expiry and revoke it when you stop using it. See developer access tokens.

2. Connect your client​

Replace YOUR_DEVELOPER_TOKEN with the token. Keep it out of files you commit.

Claude Code

claude mcp add --transport http lordbase https://api.lordbase.com/e/v1/mcp/ \
--header "Authorization: Bearer YOUR_DEVELOPER_TOKEN"

Cursor (~/.cursor/mcp.json)

{
"mcpServers": {
"lordbase": {
"url": "https://api.lordbase.com/e/v1/mcp/",
"headers": { "Authorization": "Bearer YOUR_DEVELOPER_TOKEN" }
}
}
}

VS Code (.vscode/mcp.json; VS Code asks for the token and stores it securely)

{
"inputs": [
{ "type": "promptString", "id": "lordbase-token", "description": "LordBase developer token", "password": true }
],
"servers": {
"lordbase": {
"type": "http",
"url": "https://api.lordbase.com/e/v1/mcp/",
"headers": { "Authorization": "Bearer ${input:lordbase-token}" }
}
}
}

Other clients: any MCP client that supports Streamable HTTP with a custom Authorization header works. Clients that can only sign in with OAuth (some web connectors) are not supported yet.

Then ask your assistant: "List my LordBase workspaces."

Tools​

ToolWhat it doesToken scopesKind
get_planPlan and usageread_workspacesread
list_workspacesList workspacesread_workspacesread
create_workspaceCreate a workspacewrite_workspaceswrite
list_databasesList databasesread_databasesread
get_databaseRead a databaseread_databasesread
create_databaseCreate a databasewrite_databaseswrite
pause_databasePause a databasewrite_databaseschanges availability
resume_databaseResume a databasewrite_databaseswrite
clone_databaseClone a databasewrite_databaseswrite
get_connection_detailsHost, port, user and passwordwrite_databasesreveals a secret
list_database_usersList database usersread_databasesread
create_database_userCreate a database userwrite_databaseswrite
list_backupsList backupsread_backupsread
create_backupBack up nowwrite_backupswrite
restore_backupRestore a backupwrite_backups + write_databasesreplaces data
get_restore_statusRestore statusread_backupsread
list_backup_schedulesList backup schedulesread_backupsread
create_backup_scheduleSchedule backupswrite_backupswrite
get_metricsCurrent metricsread_databasesread
get_metrics_historyMetrics historyread_databasesread
check_healthHealth checkread_databasesread
get_query_analyticsQuery analytics summary (PostgreSQL)read_databasesread
list_slow_queriesSlow queries (PostgreSQL)read_databasesread
list_active_queriesActive queries (PostgreSQL)read_databasesread
get_pooling_statusConnection pooling (PostgreSQL)read_databasesread
list_tablesTables, collections or keysread_databasesread
read_tableRead rowsread_databasesread
run_queryRun SQL or a Redis/MongoDB commandwrite_databasescan change data
list_extensionsPostgreSQL extensionsread_databasesread
enable_extensionEnable an allowed extensionwrite_databaseswrite
list_audit_logsAudit logsread_databasesread

run_query follows the editor rules: on PostgreSQL, members run read-only SQL and owners/admins may write; Redis and MongoDB commands need an owner or admin.

Safety​

  • No deletions. Deleting databases, workspaces or users, member management, billing and token management are not available through MCP. Use the dashboard.
  • Tools that change data or availability are marked as such (destructiveHint), so clients ask you before running them. The server also tells assistants to ask before writes, restores, pauses and revealing passwords.
  • Your limits apply. Scopes, workspace roles, plan quotas and audit logs are the API's own. A tool the token may not use returns the API's refusal.
  • Browsers are refused. Requests carrying an Origin header get 403, so a web page cannot drive the server with your token.

Protocol details: MCP server reference.