The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Mini App MCP listing page.
Agent-First CRUD store MCP server — schema.yaml driven, SQLite backend, multi-table in a single daemon.
mini-app-mcp is a lightweight MCP server that manages one or more SQLite tables in a single running process. The shape of each table is defined entirely by a schema.yaml file; no migrations, no REST API, no GUI. CRUD is exposed exclusively as MCP tools, making it a natural backend for agents that need structured persistent storage.
schema.yaml as sole schema authority — field names, types, and required constraints are read from YAML at startup. No field is hard-coded in application code.MINI_APP_SCHEMA + MINI_APP_DB) preserves the original single-table behaviour.code field so agents can handle failures programmatically.The optional title and description keys at the table level provide human- and AI-readable metadata about the table. Each field entry may also carry an optional description string. All three keys follow the OpenAPI 3.1 / JSON Schema 2020-12 naming convention and are included in info tool output and the schema://json resource.
Supported types: string, number, boolean, array, object.
| Environment variable | Default | Description |
|---|---|---|
MINI_APP_USER_DIR | ~/.mini-app/ | Base directory for User-scope tables. Each subdirectory is treated as a table name and must contain schema.yaml and <table>.db. |
MINI_APP_PROJECT_DIR | ./.mini-app/ | Project-scope override directory. A table present here fully replaces the User-scope definition of the same name. |
MINI_APP_BACKUP_RETENTION | 10 | Maximum number of backup copies (YAML + DB snapshot pairs) to retain per table under _backup/. Older copies beyond this limit are deleted immediately after each backup write. |
MINI_APP_SNAPSHOT_RETENTION | 10 | Maximum number of snapshot generations to retain per table under _snapshots/. Strictly separate from MINI_APP_BACKUP_RETENTION; purges only _snapshots/ files and never touches _backup/. |
Tables are discovered at startup by scanning both directories. Project-scope definitions take precedence over User-scope definitions for the same table name.
| Environment variable | Default | Description |
|---|---|---|
MINI_APP_SCHEMA | ./schema.yaml | Path to the schema definition file |
MINI_APP_DB | (none — must be set) | Path to the SQLite database file |
When MINI_APP_SCHEMA and MINI_APP_DB are set the server starts in legacy mode, mounting exactly one table. The table argument on all tools may be omitted in this mode.
All variables can also be placed in a .mini-app-mcp.env file in the working directory.
All tools accept an optional table argument that selects the target table. In multi-table mode the argument is required; omitting it returns error code TABLE_REQUIRED. Supplying an unknown table name returns error code TABLE_NOT_FOUND. In legacy single-table mode the argument may be omitted.
| Tool | Description |
|---|---|
info | Returns the parsed schema (table name, field definitions) as JSON |
create | Inserts a new row; validates the data object against the schema |
get | Retrieves a single row by id. If id is shorter than 36 characters it is treated as a UUID prefix: zero matches return NOT_FOUND; two or more matches return AMBIGUOUS_ID with a candidate list. A full 36-character UUID always uses the exact-match path. Accepts an optional fields selector to project the returned data object to a named subset of schema fields. |
list | Returns rows with optional limit / offset pagination. Accepts an optional fields selector to project the returned data objects to a named subset of schema fields. |
update | Updates an existing row by id. If id is shorter than 36 characters it is treated as a UUID prefix (see get for resolution rules). Default mode is merge (RFC 7396): absent fields are preserved from the stored row, null values delete optional fields or raise a Validation error for required ones. Pass "mode": "replace" for full replacement (pre-0.9 behaviour). |
delete | Removes a row by id. If id is shorter than 36 characters it is treated as a UUID prefix (see get for resolution rules). |
reload | Re-scan MINI_APP_USER_DIR / MINI_APP_PROJECT_DIR and atomically replace the table registry. Legacy MINI_APP_SCHEMA + MINI_APP_DB are re-applied if set. Returns { mounted, added, removed }. Limitations: no file watcher (explicit invocation only); whole-registry replace (no per-table partial reload); no schema migration for existing rows; concurrent reload calls are last-write-wins. |
schema_create | Create a new schema.yaml under the specified scope (project or user) and register the table live. Pass dry_run: true to preview without writing. Fails with SCHEMA_EXISTS if the table already exists. |
schema_update | Replace an existing table's schema.yaml with a new definition (full overwrite). Backs up the previous YAML and a SQLite snapshot to _backup/ before writing. Pass dry_run: true to preview field changes without touching disk. |
schema_delete | Remove a table's schema.yaml (moved to _backup/) and unregister it from the live registry. Does not alter or drop the SQLite table — DDL changes remain the operator's responsibility. Pass dry_run: true to preview. |
schema_batch | Execute an array of ops[] atomically under a single SQLite SAVEPOINT. Any op failure rolls back all preceding ops, leaving YAML and DB untouched. All ops must target the same table. Returns per-op results or a BATCH_ABORTED error with the index of the failing op. |
data_snapshot | Create a point-in-time SQLite snapshot of one or all mounted tables using the SQLite hot backup API. Snapshots are written to <scope_root>/_snapshots/<table>.<unix_secs>.db. Pass table and/or scope to limit the target set; omit both to snapshot all mounted tables. Pass dry_run: true to preview the operation (target tables, row counts, would-purge count) without creating any files. Retention is controlled by MINI_APP_SNAPSHOT_RETENTION (default 10), independent of MINI_APP_BACKUP_RETENTION. |
row_materialize | Write one or more rows to arbitrary absolute paths on the local filesystem. Select rows by id or by a ListFilter expression. Choose output format (raw, markdown, json, yaml), field projection (All or a named subset), and whether to write one file per row (concat=false, default) or concatenate all rows into a single file (concat=true). Returns { count, files: [{path, bytes, sha256, row_id}] } — every file entry includes a SHA-256 hex digest of the written bytes. Pass dry_run: true to compute results without writing. |
alias_create | Register a named query alias for a table. Accepts name, either filter (a ListFilter expression) or filter_template (a MiniJinja template string — mutually exclusive with filter), optional params_schema (array of parameter name strings for a templated alias), optional default_limit, and optional description. Alias names are unique per table; duplicate names return ALIAS_ALREADY_EXISTS. Aliases are scoped per table and stored in the table's own SQLite database. |
alias_list | Return all aliases registered for a table as a JSON array of { name, filter, default_limit, description, params_schema } objects. |
alias_run | Execute a stored alias by name. Accepts optional runtime limit and offset that override the stored default_limit at call time. For parameterized aliases (those created with filter_template), also accepts a params object whose key-value pairs are injected into the template. Accepts an optional fields selector to project the returned data objects to a named subset of schema fields. If params_schema is set and params is omitted, returns ALIAS_PARAMS_REQUIRED. Template render failures return ALIAS_TEMPLATE_ERROR. Returns the same shape as the list tool. Returns ALIAS_NOT_FOUND for an unknown name. |
alias_delete | Delete a named alias for a table. Returns ALIAS_NOT_FOUND if the alias does not exist. |
In addition to the 17 tools above, the server exposes 7 read-only Resources addressable by URI. Resources are intended for agents that want to fetch the schema definition or reference documentation without invoking a mutating tool.
| URI | MIME | Content |
|---|---|---|
schema://yaml | application/yaml | Raw schema.yaml file content (read from disk on each request) |
schema://json | application/json | Parsed SchemaConfig as JSON (same shape the info tool returns) |
schema://json-schema | application/schema+json | JSON Schema (draft-07) derived from the schema's fields. Use this to validate data arguments before calling create / update |
docs://quickstart | text/markdown | Agent quickstart (mode detection + first-call recipe + pointers to the other docs:// resources), compiled into the binary. Distinct from this human-facing README — read this resource from inside the MCP session |
docs://tools | text/markdown | Cheat sheet of all 17 MCP tools and their input shapes |
docs://errors | text/markdown | Reference table of error codes returned by the server |
docs://filters | text/markdown | Guide for constructing filter objects (Eq/In/Like/Or/And) used by list, alias_create, and row_materialize |
The info tool and schema://json resource return equivalent content but serve different purposes: info is a callable tool (good for one-off introspection in a conversation), while resources are URI-addressable and can be subscribed to or cached by the client.
Start the server via --mcp (stdio transport) or --mcp-http (streamable HTTP transport). These are the only entry points; there is no REST/CLI-CRUD surface.
Place each table's schema.yaml and <table>.db under ~/.mini-app/<table>/ (User scope) or ./.mini-app/<table>/ (Project scope), then start without any extra environment variables:
Register it once in .mcp.json to serve all mounted tables:
Run one central daemon that owns the SQLite files, and connect from any number of devices as remote MCP clients. Because every device talks to the same single process, the single-writer storage model is preserved — no cross-device sync or conflict handling exists or is needed.
Client registration in .mcp.json (any device on the network):
Security model:
MINI_APP_HTTP_TOKEN is optional. The transport's built-in Host header validation (loopback-only) guards against DNS rebinding.MINI_APP_HTTP_TOKEN must be set — startup is refused otherwise. Every request must then carry Authorization: Bearer <token>.Daemon templates for the central host live under contrib/:
contrib/systemd/mini-app-mcp.service (systemd user unit; install instructions in the file header)contrib/launchd/io.github.ynishi.mini-app-mcp.plist (launchd user agent; install instructions in the file header)To host the central daemon on Fly.io instead of your own machine (persistent volume, edge TLS, bearer auth, daily backup cron), see docs/runbooks/fly-io-deploy.md and contrib/fly/fly.toml.
Or configure via .mini-app-mcp.env:
mini-app-mcp can write each created or updated row to disk as a Markdown file. This is useful for agents that read context from files, for version-controlling records with git, or for quick human inspection.
After every successful create or update call the server writes (or overwrites) a file:
The file format is:
delete does not remove the dump file by default (the record stays on disk as an archive).
Add a dump: section to your schema.yaml:
| Key | Default | Description |
|---|---|---|
dump.dir | <cwd>/.mini-app/<table>/ | Directory where <id>.md files are written. Relative paths are resolved from the server's working directory. |
dump.title_field | title | Field name in the stored JSON row to use as the Markdown heading. |
dump.body_field | body | Field name in the stored JSON row to use as the Markdown body. |
dump.sync | write-only | Sync direction. Only write-only is implemented. Setting bidirectional is accepted without error but logs a warning and behaves as write-only. |
mini-app-mcp exposes four tools for managing table schemas at runtime without restarting the server.
The tool writes <scope_dir>/notes/schema.yaml and immediately registers the new table in the live registry. Calling it again for the same table name returns SCHEMA_EXISTS. The optional title and description arguments are written to the YAML file and are immediately visible via info or schema://json. Individual field entries may also include a description string.
Before overwriting, the server backs up the existing schema.yaml and a point-in-time SQLite snapshot to <scope_dir>/_backup/notes.<timestamp>.yaml and <scope_dir>/_backup/notes.<timestamp>.db. The live registry is refreshed after the write. No DDL migration is applied — the underlying table structure is unchanged.
The schema.yaml is moved to _backup/ and the table is unregistered from the live registry. The SQLite database file is not modified. Dropping or altering the table remains the operator's responsibility.
All ops execute under a single SQLite SAVEPOINT. If any op fails the entire batch rolls back — YAML files are not written and the registry is not changed. All ops in one batch must target the same table.
All four schema tools accept dry_run: true. In dry-run mode the tool computes and returns affect counts (rows, fields_added, fields_removed) without writing to any YAML file, SQLite table, or backup directory.
Backup files accumulate in <scope_dir>/_backup/. The server automatically deletes the oldest copies beyond the retention limit (default 10 pairs per table). Override the limit with MINI_APP_BACKUP_RETENTION.
data_snapshot creates a standalone SQLite snapshot of one or more mounted tables without touching any YAML file or altering the schema:
Snapshots are written to <scope_root>/_snapshots/<table>.<unix_secs>.db using the SQLite hot backup API (rusqlite::Connection::backup), so the source database remains open and writable during the operation. The retention limit (default 10) is controlled independently via MINI_APP_SNAPSHOT_RETENTION and never interacts with _backup/.
With the s3-upload build feature, data_snapshot can push each written snapshot to any S3-protocol destination — AWS S3, Backblaze B2 (S3-Compatible API), Cloudflare R2, MinIO — selected purely by endpoint:
Configuration is environment-only (rides .mini-app-mcp.env); credentials never travel through tool-call arguments:
| Environment variable | Required | Description |
|---|---|---|
MINI_APP_S3_ENDPOINT | yes | S3-compatible endpoint URL. B2: https://s3.<region>.backblazeb2.com |
MINI_APP_S3_BUCKET | yes | Bucket name |
MINI_APP_S3_ACCESS_KEY_ID | yes | Access key id (B2: Application Key ID) |
MINI_APP_S3_SECRET_ACCESS_KEY | yes | Secret access key (B2: Application Key) |
MINI_APP_S3_PREFIX | no | Object key prefix (default mini-app-snapshots/) |
MINI_APP_S3_REGION | no | Signing region. Unset = derived automatically from s3.<region>.<domain> endpoints (B2 / AWS regional), so B2 users can omit it; hosts without an embedded region (MinIO, R2) fall back to the dummy us-east-1. An explicit value always wins — B2 rejects mismatched regions, so set it only if it matches your endpoint |
MINI_APP_S3_VIRTUAL_HOSTED_STYLE | no | true = virtual-hosted addressing (bucket.endpoint/key); default false = path style (endpoint/bucket/key), which MinIO requires and AWS / B2 / R2 accept |
MINI_APP_S3_CHECKSUM | no | sha256 = send x-amz-checksum-sha256 on put; default none, because some S3-compatible providers reject checksum headers with 400 InvalidArgument: Unsupported header |
Semantics:
UPLOAD_NOT_CONFIGURED immediately.upload_errors[] response field. Successes appear in uploaded[] as {table, key, bytes}.PutObject requests (no multipart), and no x-amz-checksum-* headers are sent unless you opt in via MINI_APP_S3_CHECKSUM=sha256 — the two aws-sdk-side pitfalls that break some S3-compatible providers do not apply by default.Alternative without the feature: keep the server as-is and ship snapshots externally, e.g. a cron entry mini-app snapshot → rclone copy ~/.mini-app/_snapshots b2:my-bucket/mini-app-snapshots or a restic backup ~/.mini-app job — equivalent result with the credentials held by the external tool.
contrib/backup/mini-app-backup.sh turns the upload into a cron job: it calls data_snapshot(upload=true) on a running --mcp-http daemon (initialize → tools/call over streamable HTTP; deps: curl, jq) and exits non-zero when the call fails or upload_errors[] is non-empty, so failures surface in cron mail / journal / supercronic logs. Against a local daemon:
In the container image the script is bundled as mini-app-backup together with supercronic; setting BACKUP_CRON (e.g. 0 3 * * *) makes the entrypoint run it on schedule alongside the server (see contrib/docker/entrypoint.sh).
row_materialize exports rows from any mounted table to the local filesystem in a format your agent or toolchain can consume directly — without re-reading the database.
ById fetches exactly one row by primary key. ByFilter accepts any ListFilter expression (the same eq / in / like / or / and combinators available in list).
format | Extension | Description |
|---|---|---|
raw | .txt | Field values joined by newlines in schema order (or specified order when projecting) |
markdown | .md | Each field rendered as a Markdown heading + value block |
json | .json | serde_json::to_string_pretty — single object per row, or JSON array when concat=true |
yaml | .yaml | YAML document stream — one document per row, separated by --- |
When concat=false (default), dest is treated as a directory and each row is written to {dest}/{id}.{ext}. The directory is created with create_dir_all if it does not exist.
When concat=true, dest is a file path. Raw rows are separated by \n\n, Markdown rows by ---\n, and YAML rows by ---\n. JSON uses a top-level array.
The destination path must be absolute. Relative paths are rejected immediately with MATERIALIZE_DEST_RELATIVE. No project-root sandbox is applied — any absolute path is permitted, giving agents full filesystem reach.
Unknown field names return MATERIALIZE_FIELD_UNKNOWN before any file is written.
Every entry in files[] includes a sha256 field — a 64-character hex digest of the exact bytes written. Agents can use this for idempotency checks or to verify content after transfer without re-reading the file.
row_id is the source row's primary key for per-row files and null for concatenated output.
Dry-run mode runs all validation, projection, serialization, and SHA-256 computation but skips std::fs::write. The response shape is identical to a real write — path, byte count, and digest are all populated as "would-be" values.
Add .mini-app/ (or your custom dump.dir) to .gitignore if you do not want dump files tracked by version control:
mini-app-mcp is table-agnostic, but a common pattern is to use a single table as a relation graph layer for agents that need typed edges between nodes (e.g. persona-AI memory: sister_of, member_of_studio, mother_of).
The reference schema lives at examples/schemas/relations.schema.yaml:
| Field | Type | Required | Notes |
|---|---|---|---|
from | string | yes | Source node id |
to | string | yes | Target node id |
type | string | yes | Edge label (sister_of, member_of_studio, ...) |
ts | number | yes | Unix seconds when asserted |
strength | number | no | Edge weight in [0.0, 1.0], defaults to 1.0 |
metadata | object | no | Free-form attributes |
source_entry_id | string | no | Foreign reference to a journal / log entry |
Use schema_batch with query ops to register N edges in one SAVEPOINT:
Any op failure rolls back the entire batch.
Use the dedicated replace op to swap an edge set in one atomic SAVEPOINT. The server handles UUID generation, timestamps, and JSON serialization; the caller supplies the match scope and items list only.
The replace op runs DELETE WHERE (match) + N INSERTs inside a single SAVEPOINT. Both phases roll back together on any failure. The response includes per-op affects:
Semantics:
match becomes a separate json_extract(data, '$.key') = value predicate joined by AND. Match value must be a scalar (string/number/bool/null).match ({}) is rejected with VALIDATION_ERROR to prevent accidental full-table wipes.items is validated against the table's schema before any SQL runs.query op (raw SQL escape hatch shown in Bulk insert) remains available for cases the replace op does not cover.The list tool returns rows in created_at DESC order with limit capped at 1000. An optional filter argument enables server-side row filtering over schema-validated fields.
| type | description |
|---|---|
eq | Equality match: {"type": "eq", "field": "...", "value": ...} |
in | Set membership: {"type": "in", "field": "...", "values": [...]} |
like | Partial-match on string fields: {"type": "like", "field": "...", "pattern": "..."}. % matches any substring; _ matches any single character. Restricted to string-typed fields. |
or | OR composition: {"type": "or", "filters": [...]} |
and | AND composition: {"type": "and", "filters": [...]} |
or and and accept Vec<ListFilter> recursively, enabling nested compositions to arbitrary depth.
Constraints: field names must be registered in the table's schema.yaml (unknown fields return a VALIDATION_ERROR). Values are type-checked against the schema field's declared type — the same typed scalar validation applied to BatchOp::Replace match values. Omitting filter returns all rows within limit/offset (full backward compatibility).
Fetch messages addressed to "alice" or "broadcast" in a single call:
For small graphs where client-side filtering is sufficient:
The update tool supports two modes controlled by the optional "mode" field.
Merge mode follows RFC 7396 (JSON Merge Patch) shallow semantics:
data keep their stored values.data with a non-null value replaces the stored value for that key. Nested objects are replaced wholesale (no deep merge).null deletes an optional field — if a key's value is null and the field is required: false in the schema, the field is removed from the stored row.null on a required field is a Validation error — if a key's value is null and the field is required: true, the call fails with VALIDATION_ERROR before any write occurs.Replace mode performs a full replacement: data is validated against the schema and then written as-is, completely overwriting the stored row. This is identical to the behaviour of update before version 0.9. Callers that relied on the old default and send partial data objects should switch to mode="replace" to restore the original behaviour.
| Mode | When to use |
|---|---|
merge (default) | Partial updates — only send the fields you want to change. Existing fields you omit are untouched. |
replace | Full rewrites — you supply the complete intended state of the row. Omitted fields are deleted. |
list, get, and alias_run all accept an optional fields argument that limits which schema fields appear in the returned data object. id, created_at, and updated_at are always included in the response envelope regardless of the selector.
Omitting fields is fully backward-compatible — existing callers receive complete rows without any change.
Unknown field names are rejected with VALIDATION_ERROR before any query executes. Field name validation consults schema.yaml's canonical field definitions — not the actual keys present in stored rows — so projection errors are caught reliably even when the field is simply absent from a particular row.
Query aliases let you save a ListFilter expression (or a MiniJinja filter template) under a short name and replay it — with optional per-call limit / offset overrides — without repeating the filter JSON every time.
The alias is stored in the table's own SQLite database under _aliases. Alias names are unique per table; calling alias_create again with the same name returns ALIAS_ALREADY_EXISTS.
Parameterized aliases use a MiniJinja template string instead of a fixed filter. At run time the caller supplies parameter values that are rendered into the template before execution.
filter_template and filter are mutually exclusive — exactly one must be supplied. params_schema is an optional array of parameter names; supply it to document which keys alias_run expects in its params object.
Static alias (no parameters):
Parameterized alias (with params):
alias_run resolves the stored filter or renders the template and passes the result to Store::list. If limit is supplied at call time it overrides default_limit; if omitted, default_limit from the alias is used. offset is always a runtime-only argument (not stored).
Error cases for parameterized aliases:
| Situation | Error code |
|---|---|
params_schema is set but params is omitted | ALIAS_PARAMS_REQUIRED |
| MiniJinja render fails (bad syntax or missing variable) | ALIAS_TEMPLATE_ERROR |
Rendered output is not valid JSON or not a valid ListFilter | VALIDATION_ERROR |
Each table's _aliases storage is physically separate: aliases for notes live in notes.db, aliases for issues live in issues.db. There is no global alias namespace and no way for an alias operation to read or write aliases belonging to a different table.
query_aggregate runs COUNT / SUM / AVG / MIN / MAX / GROUP BY over one or many tables in a single tool call. Multi-table sources are joined with literal UNION ALL via SQLite ATTACH DATABASE, eliminating the N+1 round trips that result when callers fetch per-table rows and reduce client-side. The tool is read-only and idempotent.
Result is externally-tagged so callers can dispatch on kind:
Multi mounts every backing .db file via SQLite ATTACH DATABASE (limit 10) and composes a UNION ALL between per-table sub-queries before applying the outer aggregate.
Caller is responsible for ensuring all Multi sources share a compatible schema; per-table field validation is a Phase 2 carry. Aggregator-specific errors (empty sources, ATTACH-limit exceeded, nested GroupBy, non-UTF-8 db path) return AGGREGATOR_ERROR (data.code); unknown table names return TABLE_NOT_FOUND; field / identifier rejections return VALIDATION_ERROR.
Phase 2 unifies aliases across tables in a single global storage
(<project_dir>/_global.db + <user_dir>/_global.db, with lookup
precedence Project → User). The alias_create MCP tool accepts new
optional sources and aggregator arguments so one alias can span
multiple tables and stored aggregate logic:
The legacy table argument is still accepted and is silently
normalised to sources = { "kind": "single", "value": "<table>" };
specifying both table and sources is an error.
Migration: existing per-table _aliases rows are copied into the
project-scope _global_aliases automatically on every
TableRegistry::mount_from_dirs call. The migration is lossless
(all five legacy fields preserved + sources = Single(<table>) filled
in) and idempotent (INSERT OR IGNORE skips collisions), so it is safe
to run on every server restart. Per-table _aliases tables are not
deleted, preserving a rollback path until a future minor release.
Phase 2 limitations
Multi / Pattern source aliases require an aggregator; running
them without one returns a structured error (the per-table list
path cannot serve cross-table rows).* only (one or more); ? / [] are reserved
for a future revision.AGGREGATOR_ERROR at alias_run time (early surface — does not
defer to ATTACH DATABASE).query_aggregate).MINI_APP_USER_DIR / MINI_APP_PROJECT_DIR)
falls back to the per-table Store::alias_* path; Pattern sources
are rejected in this mode.Every create, update, and delete call automatically writes a full-JSON snapshot of the affected row into a _row_history table inside the same SQLite database. The snapshot is written atomically inside the same transaction as the data change — either both the data DML and the history record commit, or neither does.
| Event | op value | data_json |
|---|---|---|
create | "create" | new row JSON |
update | "update" | merged result JSON |
delete | "delete" | deleted row JSON |
Every history record also carries a monotonically increasing version counter (scoped per table + row id) and a recorded_at Unix seconds timestamp.
The pre-operation state of any entry is simply the previous entry's data_json, so it is not stored again (the legacy prev_data_json column remains readable in databases written by older versions, but new entries leave it null — this halves history write volume).
History is never discarded, but it must not eat the disk either (a single 178KB row updated 949 times used to leave 222MB of full-copy history). The raw _row_history table only keeps the newest entries per row; older entries are automatically compacted — inside the same write transaction — into zstd-compressed JSONL chunks in _row_history_archive. Near-duplicate JSON versions compress at roughly three orders of magnitude, so long histories stay cheap while remaining fully restorable: row_restore and version listings read through the archive transparently.
| Env var | Default | Meaning |
|---|---|---|
MINI_APP_HISTORY_KEEP_RECENT | 16 | raw (uncompressed) entries kept per row — the undo hot set |
MINI_APP_HISTORY_CHUNK_MIN | 48 | minimum entries rolled into one archive chunk (roll triggers past KEEP_RECENT + CHUNK_MIN) |
history: off)Tables written at high frequency by automated jobs (heartbeat stamps, log-cache style rows) can disable history entirely in schema.yaml:
With history: off no _row_history entry is written for any mutation of that table (and row_restore has nothing to restore from — use it only where per-write history has no recovery value).
row_restorerow_restore fetches the latest snapshot at or before a given Unix timestamp and writes it back as the live row. If the row was deleted it is re-inserted with the same id; if the row still exists it is replaced with the snapshot data.
The response is the same shape as get — a full row object with id, data, created_at, and updated_at.
History records are not purged on every update. Purge is a separate operation performed by calling purge_old_history in application code with the desired retention policy:
Purge is intentionally not wired to any automatic hook so that history accumulation does not add latency to normal create / update / delete calls.
Three tools let agents view and surgically edit individual string fields without fetching or replacing the entire row. Non-string fields (arrays, objects, numbers, booleans) are rejected with TYPE_ERROR.
Return the contents of a string field with line numbers (cat -n style). Pass view_range to limit output to a contiguous slice (1-indexed, inclusive on both ends).
Replace a unique occurrence of old_str with new_str inside a string field.
If old_str does not appear the tool returns STRING_NOT_FOUND. If it appears more than once and replace_all is not set, the tool returns AMBIGUOUS with a candidates list.
Insert one or more lines into a string field at a specific position.
line values greater than total_lines + 1 return OUT_OF_RANGE. All three tools record changes through the normal row_history hook, so every edit is fully auditable and restorable via row_restore.
SQLite databases are opened in WAL journal mode for safe concurrent access during reload. Sidecar files <db>.db-wal and <db>.db-shm are created next to each .db file — these are managed by SQLite and should not be deleted manually.
mini-app-mcp is listed on the MCP Registry. The OCI image is published to GitHub Container Registry on every tagged release.
MIT OR Apache-2.0