AOZUMI DB from a coding agent
AOZUMI DB is our SQLite-compatible Rust server: apps connect with @libsql/client or Drizzle. A coding agent can manage it for you over MCP or the aozumi CLI, with one API key and nobody opening the console.
Create a key
- Open Profile → AgentsGo to your profile in the workspace that has AOZUMI DB.
- Pick ManageManage lets the agent create and delete databases, show tokens and write with SQL; your role must be owner or admin for that. Pick Read for an agent that should only look. Add an expiry if you like.
- Store it as
AOZUMI_TOKENThe key starts withslt_and is shown once. The same key works for MCP and the CLI. Keys fromaozumi logindo not reach databases.
Connect over MCP
The database tools live on the same MCP server as the deploy tools, at https://aozumi.dev/mcp.
Claude Code
claude mcp add --transport http aozumi https://aozumi.dev/mcp \
--header "X-API-Key: $AOZUMI_TOKEN"
Cursor
{
"mcpServers": {
"aozumi": {
"url": "https://aozumi.dev/mcp",
"headers": { "X-API-Key": "${env:AOZUMI_TOKEN}" }
}
}
}
Codex
[mcp_servers.aozumi]
url = "https://aozumi.dev/mcp"
bearer_token_env_var = "AOZUMI_TOKEN"
Clients that start a local command
For Claude Desktop and other clients without remote servers, aozumi mcp serves the same tools over stdio and forwards each call to the endpoint above (CLI 0.2.0 or later).
{
"mcpServers": {
"aozumi": {
"command": "npx",
"args": ["-y", "@aozumi/aozumi", "mcp"],
"env": { "AOZUMI_TOKEN": "slt_your_agent_key" }
}
}
}
Then ask, for example: Create an AOZUMI DB database called notes, put its .env lines in .env, add a todos table, and show me the schema.
Or use the CLI
Agents that run shell commands can use the CLI instead (0.2.0 or later). <db> is a database's name, or its id from aozumi db ls.
npm install --global @aozumi/aozumi
export AOZUMI_TOKEN=slt_your_manage_key
aozumi db create notes # a standalone database
aozumi db env notes >> .env # AOZUMI_DB_URL and AOZUMI_DB_TOKEN
aozumi db sql notes "create table todos (id integer primary key, title text)" --write
aozumi db sql notes "select * from todos" # read-only unless --write
aozumi db schema notes
aozumi db rotate notes --yes # revoke every token shown so far
aozumi db rm notes --yes
ls, create, token, sql and schema take --json.
Connect your code
The two .env lines are all an app needs. Keep that file out of Git.
import { createClient } from "@libsql/client";
const db = createClient({
url: process.env.AOZUMI_DB_URL,
authToken: process.env.AOZUMI_DB_TOKEN,
});
await db.execute("insert into todos (title) values (?)", ["Ship it"]);
What an agent can do
| Action | MCP tool | CLI | Key |
|---|---|---|---|
| List databases | databases | aozumi db ls | Read |
| Create a standalone database | database_create | aozumi db create <name> | Manage |
| Show the URL, token and .env lines | database_token | aozumi db env <db> / token <db> | Manage |
| Rotate the token | database_rotate_token | aozumi db rotate <db> | Manage |
| Run read-only SQL | database_sql | aozumi db sql <db> "…" | Read |
| Run SQL that writes | database_sql with write | aozumi db sql <db> "…" --write | Manage |
| Read the schema | database_schema | aozumi db schema <db> | Read |
| Delete a database | database_delete | aozumi db rm <db> | Manage |
Each action is also a REST call under /api/db/databases; see the REST API.
Limits and safety
- One workspace. A key reaches only the databases of the workspace it was made in, never more than its access level or your role allows.
- Tokens are audited. A token has no expiry. Every reveal is in the workspace's audit log with the key's prefix; rotate to revoke every token shown so far, read-only ones too.
- Destructive SQL waits. A script with a
DROP, or aDELETEorUPDATEwithoutWHERE, comes back withconfirm_destructiveand the statements until it is sent again confirmed. Deleting a database needs its name typed again. - Limits. 3 databases per workspace, and 60 database requests a minute per key; over that is a 429 with
Retry-After. Connect with the token for app traffic. - Errors are machine-readable. Every refusal is
{"error": "…", "code": "…"}, for examplename_taken,workspace_limit,not_enabled,forbiddenorrate_limited.
Questions
- Can a coding agent create an AOZUMI DB database?
- Yes. Give it a Manage API key from Profile → Agents, held by a workspace owner or admin, through MCP or the aozumi CLI. It can list, create and delete databases, show a token, rotate it, and run SQL.
- Does the agent see my database token?
- Only when it asks for one with a Manage key, and every reveal goes in the workspace's audit log with the key's prefix. The token has no expiry; rotate it to revoke every token shown so far.
- Can a read-only key change a database?
- No. Read and Deploy keys list databases, read schemas and run read-only SQL. Creating, deleting, tokens and SQL with writes need a Manage key.
Checked against the product on .