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".
| Address | https://api.lordbase.com/e/v1/mcp/ |
| Transport | Streamable HTTP (JSON answers, no session) |
| Authentication | Authorization: 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_databasesandwrite_backupsto create databases and users, take backups, run queries and reveal connection details. - Add
write_workspacesonly 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
| Tool | What it does | Token scopes | Kind |
|---|---|---|---|
get_plan | Plan and usage | read_workspaces | read |
list_workspaces | List workspaces | read_workspaces | read |
create_workspace | Create a workspace | write_workspaces | write |
list_databases | List databases | read_databases | read |
get_database | Read a database | read_databases | read |
create_database | Create a database | write_databases | write |
pause_database | Pause a database | write_databases | changes availability |
resume_database | Resume a database | write_databases | write |
clone_database | Clone a database | write_databases | write |
get_connection_details | Host, port, user and password | write_databases | reveals a secret |
list_database_users | List database users | read_databases | read |
create_database_user | Create a database user | write_databases | write |
list_backups | List backups | read_backups | read |
create_backup | Back up now | write_backups | write |
restore_backup | Restore a backup | write_backups + write_databases | replaces data |
get_restore_status | Restore status | read_backups | read |
list_backup_schedules | List backup schedules | read_backups | read |
create_backup_schedule | Schedule backups | write_backups | write |
get_metrics | Current metrics | read_databases | read |
get_metrics_history | Metrics history | read_databases | read |
check_health | Health check | read_databases | read |
get_query_analytics | Query analytics summary (PostgreSQL) | read_databases | read |
list_slow_queries | Slow queries (PostgreSQL) | read_databases | read |
list_active_queries | Active queries (PostgreSQL) | read_databases | read |
get_pooling_status | Connection pooling (PostgreSQL) | read_databases | read |
list_tables | Tables, collections or keys | read_databases | read |
read_table | Read rows | read_databases | read |
run_query | Run SQL or a Redis/MongoDB command | write_databases | can change data |
list_extensions | PostgreSQL extensions | read_databases | read |
enable_extension | Enable an allowed extension | write_databases | write |
list_audit_logs | Audit logs | read_databases | read |
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
Originheader get403, so a web page cannot drive the server with your token.
Protocol details: MCP server reference.