MCPcopy Index your code
hub / github.com/butterbase-ai/butterbase

github.com/butterbase-ai/butterbase @v0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.0 ↗ · + Follow
3,637 symbols 11,223 edges 694 files 360 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Butterbase

AI-native, open-source backend-as-a-service. Postgres data plane, auth, storage, functions, an AI gateway, and a built-in Model Context Protocol (MCP) server. Apache-2.0 licensed.

Butterbase gives you the building blocks for AI-driven applications without lock-in: spin up a Postgres-backed backend with row-level security, ship serverless functions, route LLM traffic through a single gateway, and let agents drive it all via MCP tools.

Open-source vs. managed

This repo ships the runtime data plane:

  • services/control-api — Fastify control plane (apps, auth, storage, functions, AI gateway, RLS, migrations)
  • services/mcp-server — MCP server exposing 30+ backend ops as tools
  • services/agent-runtime, services/deno-runtime, services/build-runner — function and frontend execution
  • services/storage-indexer — async storage indexing
  • packages/sdk, packages/cli, packages/plugin, packages/shared — client surfaces

The managed offering at butterbase.ai adds: multi-region orchestration, billing, the AI router's upstream provider adapters, lease-based quota enforcement, and ops dashboards. Those live in a private repo that consumes this one as a submodule.

When you self-host this repo, the AI gateway runs with no upstream router adapters registered, billing uses a no-op provider, and quotas are unlimited — you wire your own implementations against the BillingProvider, QuotaEnforcer, and RouterAdapter interfaces in packages/shared.

Quickstart

Requirements: Docker, Node 22+, npm.

Always clone with --recurse-submodules. The Claude Code plugin (packages/plugin) lives in its own repo, butterbase-plugin, and is wired in here as a git submodule. A plain git clone will leave packages/plugin/ empty and npm install will silently skip that workspace.

git clone --recurse-submodules https://github.com/NetGPT-Inc/butterbase-oss.git
cd butterbase-oss
cp .env.example .env
docker compose -f docker-compose.local.yml up -d

If you forgot --recurse-submodules, run this from inside the repo to fix it:

git submodule update --init --recursive

To keep the plugin submodule current when pulling later, either run git pull --recurse-submodules each time, or set it as the default once:

git config --global submodule.recurse true

The control-api will be available at http://localhost:4000. See SETUP.md for full setup including auth provider configuration.

Architecture

                  ┌──────────────────────────────────┐
                  │  Your app / agent / MCP client   │
                  └──────────────┬───────────────────┘
                                 │
                  ┌──────────────▼───────────────────┐
                  │     control-api (Fastify)        │
                  │  apps · auth · storage · funcs   │
                  │  AI gateway · RLS · migrations   │
                  └──┬─────────┬─────────┬────────┬──┘
                     │         │         │        │
              ┌──────▼──┐ ┌────▼────┐ ┌──▼──┐ ┌───▼────┐
              │ Postgres│ │ Storage │ │ MCP │ │Function│
              │ runtime │ │ indexer │ │ srv │ │runtime │
              └─────────┘ └─────────┘ └─────┘ └────────┘

The control-api is the single entry point. Postgres holds tenant runtime metadata in db/runtime-plane and per-app data in db/data-plane. Functions run in agent-runtime or deno-runtime workers dispatched via Cloudflare Workers (dispatch-worker).

Documentation

Project status

Initial open-source release (v0.1.0). The internal data plane is production-tested by the managed offering. Public APIs and the MCP tool surface are stable but the OSS distribution is new — expect some self-host rough edges that we will smooth out from issues and PRs.

Contributing

See CONTRIBUTING.md. The boundary between OSS and the managed offering is intentional — please read the "scope" section before opening a PR that touches billing, quota math, or upstream router adapters.

Security

See SECURITY.md. Report vulnerabilities to security@butterbase.ai.

License

Apache-2.0. Copyright 2026 NetGPT Inc.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 1,686
Interface 919
Method 733
Class 299

Languages

TypeScript98%
Python2%

Modules by API surface

services/storage-indexer/worker-configuration.d.ts765 symbols
packages/cli/src/lib/api-client.ts128 symbols
packages/sdk/src/admin/types.ts53 symbols
packages/sdk/src/errors/kv.ts42 symbols
packages/sdk/src/kv.ts37 symbols
services/control-api/src/services/realtime-manager.ts34 symbols
services/control-api/src/services/kv/redis-client.ts32 symbols
stress_test.py30 symbols
packages/sdk/src/realtime/realtime-client.ts29 symbols
services/control-api/src/services/durable-objects.service.ts27 symbols
packages/sdk/src/lib/query-builder.ts26 symbols
services/control-api/src/routes/v1/kv-data.ts25 symbols

Datastores touched

butterbase_controlDatabase · 1 repos
butterbase_runtime_usDatabase · 1 repos
postgresDatabase · 1 repos
dbDatabase · 1 repos
butterbase_data_euDatabase · 1 repos
butterbase_runtimeDatabase · 1 repos
butterbase_runtime_euDatabase · 1 repos
data_euDatabase · 1 repos

For agents

$ claude mcp add butterbase \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page