Define the schema
Add ordered SQL migrations underopencomputer/database/migrations:
001_initial.sql
002_monitor_runs.sql
Prefer additive, backward-compatible migrations. Existing sessions stay on the
deployment they started with and can overlap a newer deployment.
Use the database from an agent
Every project session receives adatabase MCP server automatically. Its
tools run at the OpenComputer edge and do not start or enter a sandbox:
Both tools accept
sql and an optional parameters array. Use placeholders
instead of interpolating model-generated values:
truncated flag. Results are bounded to 200 rows and 256 KiB, so add a LIMIT
and paginate large reads.
No hook is required. Describe when the agent should use the database in its
instructions and create the tables it needs with migrations.
Query from the CLI
Run a read-only query against the linked project’s Development database:--parameter is a JSON scalar: a quoted JSON string, finite number,
boolean, or null. Add --json for the complete machine-readable result.
Inspect data in the dashboard
Open the project and choose Database. The page uses the project’s global Development or Production selector and provides:- application tables, their schema, and paginated row previews;
- applied migration history; and
- a read-only SQL query box.
database_execute; schema remains source-controlled in the migrations folder.
Limits
- 100 migrations per deployment manifest
- 256 KiB per migration and 1 MiB across all migrations
- 32 KiB per tool SQL statement
- 100 parameters totaling at most 64 KiB
- 200 returned rows and 256 KiB per result