Use the Mysql CLI from KosmoKrator to call Mysql tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
Mysql can be configured headlessly with `kosmokrator integrations:configure mysql`.
# Install KosmoKrator first if it is not available on PATH.curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash# Configure and verify this integration.kosmokrator integrations:configure mysql --set api_key="$MYSQL_API_KEY" --set host="$MYSQL_HOST" --enable --read allow --write ask --jsonkosmokrator integrations:doctor mysql --jsonkosmokrator integrations:status --json
Credentials
Authentication type: API keyapi_key. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
api_key
MYSQL_API_KEY
Secret secret
yes
API Key
host
MYSQL_HOST
URL url
yes
Host URL
Call Mysql Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Mysql.
mysql.mysql_query
Read read
Execute a raw SQL query on the MySQL database. Supports SELECT, INSERT, UPDATE, DELETE, and other SQL statements. Use for custom queries, joins, aggregations, and complex data retrieval.
Get the column structure of a MySQL table. Returns column names, types, nullable status, keys, defaults, and extra info. Use this before inserting or updating data to understand the schema.
Insert a new row into a MySQL table. Provide column names and values as key-value pairs. Use mysql_describe_table first to understand the schema if needed.
Update rows in a MySQL table that match a filter. Provide a filter to identify which rows to update and a data object with the new column values. Use mysql_describe_table first to understand the schema if needed.
Delete rows from a MySQL table that match a filter. Provide a filter with column-value pairs to identify which rows to delete. This action is irreversible — use with caution.
Use these parameter tables when building CLI payloads without calling integrations:schema first.
mysql.mysql_query
Execute a raw SQL query on the MySQL database. Supports SELECT, INSERT, UPDATE, DELETE, and other SQL statements. Use for custom queries, joins, aggregations, and complex data retrieval.
Get the column structure of a MySQL table. Returns column names, types, nullable status, keys, defaults, and extra info. Use this before inserting or updating data to understand the schema.
Insert a new row into a MySQL table. Provide column names and values as key-value pairs. Use mysql_describe_table first to understand the schema if needed.
Column-value pairs to insert (e.g., {"name": "Alice", "email": "[email protected]"}).
mysql.mysql_update
Update rows in a MySQL table that match a filter. Provide a filter to identify which rows to update and a data object with the new column values. Use mysql_describe_table first to understand the schema if needed.
Column-value pairs to match rows for update (e.g., {"id": 42}).
data
object
yes
Column-value pairs to update (e.g., {"name": "Bob", "status": "active"}).
mysql.mysql_delete
Delete rows from a MySQL table that match a filter. Provide a filter with column-value pairs to identify which rows to delete. This action is irreversible — use with caution.
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.