Documentación
Para agentes y desarrolladores
La referencia técnica: el endpoint MCP, sus herramientas y la forma de una propuesta.
Endpoint
- Dirección:
https://jilliondb.com/mcp(HTTP transmitible, JSON-RPC 2.0). - Autenticación:
Authorization: Bearer dbk_…con una clave de Ajustes. - Límites: 240 peticiones por minuto y clave, 50 propuestas pendientes por proyecto.
Herramientas
list_projectsLists the JillionDB projects this key can see, with their database engine and table count.
get_schemaReturns the current schema of a project as SQL for its database engine (default) or as JillionDB JSON.
list_issuesLists design problems in the current schema: missing keys, unindexed relationships, type mismatches and engine limits.
propose_changeProposes a schema change for the user to review in JillionDB.
get_proposalReturns a proposal’s status.
list_proposalsLists recent proposals for a project, newest first.
Proponer un cambio
Envía exactamente uno de operations o sql, con un summary de una frase para quien revisa. Mejor operations: dicen exactamente qué cambia, así que un cambio de nombre sigue siéndolo. sql es el esquema completo deseado, y JillionDB calcula la diferencia.
{
"project_id": "…",
"summary": "Add a timezone to users so reminders go out at local time",
"operations": [
{ "op": "add_column", "table": "users",
"column": { "name": "timezone", "type": "varchar(64)", "nullable": false, "default": "UTC" } }
]
}Operaciones
Each operation is an object with "op" and the fields below. Names are table and column names as they appear in get_schema.
- create_table: table, columns [{name, type, nullable?, default?, unique?, primary_key?, comment?, references?}], primary_key? [names], comment?
- drop_table: table
- rename_table: table, to
- add_column: table, column {name, type, nullable?, default?, unique?, comment?, references?}
- drop_column: table, column
- rename_column: table, column, to
- alter_column: table, column, type?, nullable?, default?, unique?, comment?
- add_index: table, columns [names], unique?, name?
- drop_index: table, name or columns
- add_foreign_key: table, columns [names], references {table, columns? (defaults to its primary key), on_delete?}
- drop_foreign_key: table, columns or name
- set_primary_key: table, columns
- add_check: table, expression, name?
- drop_check: table, name or expression
- set_comment: table, column?, comment
Types: uuid, text, varchar(n), char(n), smallint, integer, bigint, serial, bigserial, decimal(p,s), float, double, boolean, date, time, timestamp, timestamptz, json, binary, enum('a','b').
Defaults: a value (string, number, true/false), "now", "uuid", "autoincrement", {"value": ...} for literal text that looks like a keyword, or {"sql": "..."} for a raw expression.
references: {table, column?, on_delete?: cascade | restrict | set null | set default | no action}.Después de aprobar
get_proposal devuelve migration_up y migration_down para la base de datos del proyecto. Escribe el SQL up en las migraciones del proyecto tal cual, y el down como reversión si tu herramienta lo admite. Si quien revisó editó la propuesta, edited_by_reviewer es true.