Skip to content
Docs

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

  1. Open Profile → AgentsGo to your profile in the workspace that has AOZUMI DB.
  2. 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.
  3. Store it as AOZUMI_TOKENThe key starts with slt_ and is shown once. The same key works for MCP and the CLI. Keys from aozumi login do 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

Terminal
claude mcp add --transport http aozumi https://aozumi.dev/mcp \
  --header "X-API-Key: $AOZUMI_TOKEN"

Cursor

.cursor/mcp.json
{
  "mcpServers": {
    "aozumi": {
      "url": "https://aozumi.dev/mcp",
      "headers": { "X-API-Key": "${env:AOZUMI_TOKEN}" }
    }
  }
}

Codex

~/.codex/config.toml
[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).

MCP config
{
  "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.

Terminal
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.

db.mjs
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

ActionMCP toolCLIKey
List databasesdatabasesaozumi db lsRead
Create a standalone databasedatabase_createaozumi db create <name>Manage
Show the URL, token and .env linesdatabase_tokenaozumi db env <db> / token <db>Manage
Rotate the tokendatabase_rotate_tokenaozumi db rotate <db>Manage
Run read-only SQLdatabase_sqlaozumi db sql <db> "…"Read
Run SQL that writesdatabase_sql with writeaozumi db sql <db> "…" --writeManage
Read the schemadatabase_schemaaozumi db schema <db>Read
Delete a databasedatabase_deleteaozumi 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 a DELETE or UPDATE without WHERE, comes back with confirm_destructive and 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 example name_taken, workspace_limit, not_enabled, forbidden or rate_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 .