13 FOCUSED GUIDES

Schema design

Model relationships, choose constraints and plan schema changes with the generated API in mind.

MCPBackend stores each project's data in SQLite and exposes supported tables through generated REST endpoints. Use the schema tools and dashboard for supported changes. The design examples here are patterns to adapt, not claims that the API exposes every SQLite feature or arbitrary SQL.

Estimate backend capacity
PRACTICAL FIELD GUIDE

Choose a primary key before wiring record URLs

The primary key determines how an individual record is addressed through the generated API.

Read the guide →
PRACTICAL FIELD GUIDE

Create parent records before dependent records

A foreign-key relationship makes the existence of a referenced parent part of data validity.

Read the guide →
PRACTICAL FIELD GUIDE

Review cascading deletes before enabling them

A cascading relationship can remove dependent rows when a parent is deleted.

Read the guide →
PRACTICAL FIELD GUIDE

Required or nullable: choose the empty-state contract

A nullable column and a required column encode different guarantees for every API caller.

Read the guide →
PRACTICAL FIELD GUIDE

Add a required column to a table with existing rows

A new required column needs a value for rows that already exist.

Read the guide →
PRACTICAL FIELD GUIDE

Use a unique field without confusing it with validation

A unique constraint prevents duplicate stored values according to the database's comparison behavior.

Read the guide →
PRACTICAL FIELD GUIDE

Store money with an explicit unit and currency

Money fields need a unit and currency contract, not just a numeric type.

Read the guide →
PRACTICAL FIELD GUIDE

Keep timestamp formats and timezones consistent

Timestamp text needs a consistent format if the application relies on sorting and comparison.

Read the guide →
PRACTICAL FIELD GUIDE

JSON column or related table for nested data?

A JSON field is useful for flexible payloads, while related tables make frequently queried relationships more explicit.

Read the guide →
PRACTICAL FIELD GUIDE

Boolean fields: agree on the stored representation

MCPBackend's boolean schema type uses SQLite integer storage, so clients need a consistent representation at the API boundary.

Read the guide →
PRACTICAL FIELD GUIDE

Plan indexes around real filters and sorting

An index should serve a query the application actually performs.

Read the guide →
PRACTICAL FIELD GUIDE

Renaming a column can break generated clients

A schema rename changes the field and filter names that API callers use.

Read the guide →
PRACTICAL FIELD GUIDE

Why tables starting with an underscore are reserved

MCPBackend reserves underscore-prefixed tables for internal data such as application users.

Read the guide →