MorphDB
// a backend for vibe-coded sites

Schema fluid.
API stable.

A coding agent reshapes your data model as fast as it changes the UI — no migrations — while the site you ship keeps calling the same unchanging endpoints. Here's the whole idea in one demo:

schema · the agent edits this
task
    GET/objects/task/abc-123 URL NEVER CHANGES
    
        
    schema went from lean to morphed — the endpoint URL didn't move.
    01 the problem

    When you vibe-code, the data model never sits still.

    Add a field, split a type, link two things — every change normally means rewriting a database schema and migrating every existing row. So the design churn that makes building fun becomes the thing that slows you down.

    MorphDB makes a schema edit free and instant, and keeps the HTTP API frozen while the shape underneath changes. The agent stops fighting the database and just builds.

    02 the mental model

    Apps → types → objects.

    Three nested ideas. That's the whole data model.

    appone per website · fully isolated
    A single MorphDB process hosts many apps (tenants). Each carries an X-App-Key; nothing leaks across apps.
    typefields + relations
    Your data model inside an app — like task, user. Just a set of fields (raw values) and relations (links to other types). The agent reshapes these constantly.
    objectthe instances · each has a _guid
    The actual rows — one task, one user. Written and read by the site over generic endpoints. Relations ride along as fields on the object body.
    03 the big idea

    Two audiences, one database.

    MorphDB cleanly separates who changes the shape from who moves the data — and that separation is why the API can stay frozen.

    you · the coding agent

    Reshape the schema

    Call tools to add a field, declare a relation, retype something. Instant, O(1), no rows rewritten.

    acts on the schema, via mcp tools
    add_fieldadd_relationdescribe_typeset_schema
    the site · your frontend

    Read & write data

    Plain fetch against generic object endpoints. These URLs never change when the schema morphs.

    acts on the data, over stable http
    POST /objects/taskGET /objects/task?done=falsePATCH /objects/task/{id}
    both meet at one SQLite-backed process — schema edits never touch the endpoints the site calls.
    04 why it doesn't break

    Lazy invalidation: rows are never migrated.

    How can the shape change under live data without breaking it? Every object is stored as raw JSON and projected through the current schema on every read.

    Add a field → old rows simply read it as empty (or its default). Drop a field → it vanishes from the view, the bytes stay put. Retype a field → a value that no longer fits reads as unset until rewritten. A schema edit is one tiny metadata write — zero row rewrites, whether you have ten objects or ten million.

    05 relations

    Declared once. Inverse for free. Filterable like a foreign key.

    A relation is declared on one side; the inverse appears automatically on the other. Under the hood each link is a single row in an indexed edge table — so you can traverse both ways in one read, and filter a list by it like an ORM foreign key.

    business name · score stage status · label stages ▸ ◂ business one business · many stages
    filter a list by a relation
    GET /objects/stage?business=<guid>&status=build
    "All of this business's stages that are in build." The relation filter is resolved through the indexed edge table and composes with field filters, sort, and pagination — so you model a link as a relation, never a guid-bearing string field.
    06 how claude plugs in

    The agent reshapes schema over MCP — through a pipe, not a port.

    Claude Code talks to MorphDB's tools through a tiny server, morphdb mcp. It's a stdio server: Claude launches it as a child process and exchanges newline-delimited JSON-RPC over its stdin/stdout — no network, no port. You never run or stop it; Claude owns its whole lifecycle.

    mcp client
    Claude Code
    { "method": "tools/call", "name": "add_relation" }stdin ▸
    { "result": { "ok": true } }◂ stdout
    mcp server
    morphdb mcp
    a pneumatic tube between two programs — 11 tools: register_app · add_field · add_relation · describe_type · set_schema · query_objects · …
    07 under the hood

    Two files from the standard library. Nothing else.

    MorphDB is deliberately tiny and dependency-free, so a coding agent can install and reason about all of it.

    0 dependencies — just Python's http.server + sqlite3
    Daemon
    morphdb start — the HTTP backend, backgrounded.
    CLI
    start · stop · status · logs · dashboard · mcp
    MCP server
    stdio tools Claude spawns to edit schema.
    Claude skill
    teaches the agent the whole workflow.
    Dashboard
    read-only ER view of every app + type.