Doku
Für Agenten und Entwickler
Die technische Referenz: der MCP-Endpunkt, seine Tools und der Aufbau eines Vorschlags.
Endpunkt
- Adresse:
https://jilliondb.com/mcp(Streamable HTTP, JSON-RPC 2.0). - Authentifizierung:
Authorization: Bearer dbk_…mit einem Schlüssel aus den Einstellungen. - Grenzen: 240 Anfragen pro Minute und Schlüssel, 50 offene Vorschläge pro Projekt.
Tools
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.
Eine Änderung vorschlagen
Sende genau eines von operations oder sql, mit einem einzeiligen summary für die prüfende Person. Operations sind besser: Sie sagen genau, was sich ändert, eine Umbenennung bleibt also eine Umbenennung. sql ist das komplette Zielschema, den Unterschied berechnet JillionDB.
{
"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" } }
]
}Operationen
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}.Nach dem Annehmen
get_proposal liefert migration_up und migration_down für die Datenbank des Projekts. Schreib das Up-SQL genau so in die Migrationen des Projekts und das Down-SQL als Rücknahme, falls dein Migrationstool das unterstützt. Hat die prüfende Person den Vorschlag bearbeitet, ist edited_by_reviewer true.