manage_api_keys
List and revoke API keys (service keys) for the Butterbase platform account.
A self-hosted backend — Postgres with row-level security, auth, storage, functions, realtime, RAG and an LLM gateway — with every one of those surfaces exposed to agents as MCP tools.
LABSCO SUMMARY
Schema, row-level security, functions, storage, realtime and RAG all sit behind the same MCP surface, so the model can provision the thing it needs instead of asking you to open a dashboard first.
The runtime data plane of Butterbase, an open-source backend-as-a-service. A Fastify control API fronts three Postgres planes, a Deno runtime for serverless functions, S3/R2 storage and a Python agent runtime, and embeds an MCP server at /mcp.
/mcp or over stdio via npx @butterbase/mcpDocker, Node 22+ and npm. Clone with --recurse-submodules, because a plain clone leaves packages/plugin/ empty and npm install silently skips that workspace. Then npm ci, cp .env.example .env, and docker compose -f docker-compose.local.yml up -d; the first run builds images and can take several minutes. Schema is not applied on container start — run npm run migrate:all, then npm run seed:dev to create the local dev user. The control API answers on http://localhost:4000 and MCP on http://localhost:4000/mcp. Self-hosting runs the AI gateway without upstream router adapters and with a no-op billing provider; those live in the managed offering, and you wire your own through the BillingProvider, QuotaEnforcer and RouterAdapter interfaces.
Run a container — build the image from the repository, then point your client at it
USE CASES
Ask for a schema and it lands as a real per-app Postgres database with declarative schema, migrations and automatic REST endpoints — no glue code between the model and the data plane.
RLS policy management is a first-class surface with user-isolation helpers, so the isolation rules are written and reviewed as policy rather than reconstructed from application code.
Managed RAG collections handle document ingestion, semantic search and synthesized answers inside the same backend that already holds the data.
The local Docker Compose profile brings up the control API, three Postgres planes, the Deno runtime, Redis and LocalStack S3 — with AUTH_ENABLED=false for a first smoke test.
Durable Objects give you stateful per-key actors for exactly this — chat rooms, multiplayer state, rate limiters and long-running agents that outlive a single request.
Listed in project code.
manage_api_keysList and revoke API keys (service keys) for the Butterbase platform account.
manage_billingManage billing, plans, usage, and spending caps for the Butterbase platform account.
create_frontend_deploymentCreate a frontend deployment and get an upload URL.
deploy_functionDeploy or update a serverless function with custom business logic.
butterbase_docsRead comprehensive Butterbase documentation (local, no API calls).
init_appCreate a new backend app with isolated database and API endpoints.
insert_rowInsert a new row into a table using the auto-generated REST API.
manage_integrationsManage third-party integrations for a Butterbase app (e.g., Gmail, Slack, Google Calendar).
invoke_functionInvoke a deployed function and return its full HTTP response.
list_partner_apisList third-party partner APIs (Seedance, Z.AI / 智谱, Qingyun, etc.) configured for a specific Butterbase hackathon.
list_regionsList the regions an app can be created or moved to.
manage_aiUse the app's AI gateway: chat, embeddings, list models, read/update config, read usage.
manage_appManage app lifecycle: list, delete, pause/resume, get config, update access mode, secure, update CORS, clone, and find templates.
manage_auth_configManage authentication configuration for an app.
manage_auth_usersManage end-user auth records for an app.
manage_durable_objectsManage Durable Object (DO) classes for an app: register/update code, list/get/delete, view usage, and manage shared env vars.
manage_edge_ssrManage Edge SSR (Cloudflare Workers) deployments: prebuilt-zip flow, server-side build flow, list history.
manage_frontendManage frontend deployments, environment variables, and custom domains for a Butterbase app.
manage_functionManage function lifecycle: list, delete, get logs, and update environment variables.
manage_kvManage app KV store: config rules (expose/unexpose namespaces) and data-plane operations (get/set/del/incr etc).
manage_migrationsRead and control in-flight app migrations.
manage_oauthManage OAuth providers for end-user authentication (configure, get, update, delete).
manage_rag_contentManage RAG (Retrieval-Augmented Generation) collections and documents.
manage_realtimeManage realtime WebSocket notifications for database tables.
manage_repoManage an app's repo (content-addressed code snapshots).
manage_rlsManage Row-Level Security (RLS): enable on tables, create/update/delete policies, list, and one-shot user isolation setup.
manage_schemaManage the database schema: read current schema, apply changes, preview changes, and audit migration history.
manage_storageManage app storage: presigned upload/download URLs, list/delete objects, update config.
move_appMigrate an app to a different region.
move_app_statusGet the current status of an app migration.
teardown_source_replicaTear down the source replica kept after a completed app migration.
query_audit_logsQuery audit events for an app — authentication, admin mutations, and function invocations.
rag_queryQuery a RAG collection using natural language to retrieve relevant document chunks.
seed_databaseInsert multiple rows into a table in a single call.
select_rowsQuery rows from a table using the auto-generated REST API.
prep_and_submit_hackathon_entryPrep and submit your project to a Butterbase hackathon.
submit_suggestionSubmit feedback, bug reports, or feature suggestions to the Butterbase platform team.
BEFORE YOU INSTALL
37 tools registered in the project's code.
BUTTERBASE_API_KEY in your environment
Both documented clients run the server on your machine.
INSTALLATION
git clone --recurse-submodules https://github.com/butterbase-ai/butterbase.git
cd butterbase
npm ci
cp .env.example .env
docker compose -f docker-compose.local.yml up -d
curl -sf http://localhost:4000/health/ready
npm run migrate:all
npm run seed:dev{
"mcpServers": {
"butterbase": {
"url": "http://localhost:4000/mcp",
"headers": {
"Authorization": "Bearer ${env:BUTTERBASE_MCP_TOKEN}"
}
}
}
}Connects to the control API the steps above start. The local Docker Compose profile runs with AUTH_ENABLED=false, so the Authorization header only matters once you enable auth and export BUTTERBASE_MCP_TOKEN with a bb_sk_ key.
{
"mcpServers": {
"butterbase": {
"command": "npx",
"args": [
"-y",
"@butterbase/mcp"
],
"env": {
"BUTTERBASE_API_KEY": "<YOUR_BUTTERBASE_API_KEY>"
}
}
}
}The stdio package talks to http://localhost:4000 by default, so start the stack above first; set CONTROL_API_URL if your control API runs elsewhere. BUTTERBASE_API_KEY is only checked when auth is enabled on your instance — with the local profile you can leave it out.