1. Quick start: hand it to an agent

The fastest way to use AtomHouse is not to learn the console first. Install the skill, describe the outcome, and let the agent do the work.

  1. Install the AtomHouse skill. It teaches the agent how to operate your account.
  2. Describe the app you want. The agent handles the rest.
Your first message can be the requirement itself. You do not need to manually register, create a workspace or create an app first. The agent checks the account and permissions, then works through the steps. If you have no account, the authorization page can guide you through registration.

Step 1: install the skill

The easiest path is to give the agent this one sentence:

Download https://atomhouse.cloud/api/v1/skill.zip, unzip it into your skills directory, and follow INSTALL.md to install or update. When done, reply briefly: whether you are connected and what I can do next.

With Node.js, you can also install and authorize from the command line:

npx atomhouse-skill add
npx atomhouse-skill login

The three methods — one sentence, npx (optionally with an API base URL), and downloading the package — are documented in full in Install the skill.

If login asks for device approval: open verification_uri_complete in your own browser and approve it. Do not “auto-open” it on a server. No account yet? Register from that page.

Step 2: describe the outcome

Do not ask “how do I create a table?” Describe the finished app, who uses it, and what must stay private:

Build a reading-club app for my team:
- members can add a book, author and private note
- each member can only see their own notes
- I can see everything and approve new members
- it should work in a browser, and give me a shareable link

Check my account and workspace first; do not guess a slug.
If needed, set up the workspace, app, tables and permissions for me.

What the agent does behind that one request

You see one request and one link. Underneath, the agent performs a sequence of correct steps:

What you seeWhat the agent does
“Check my account”Calls bootstrap; confirms the account, workspaces, workspace role and available apps. If there is no account, guides authorization or sign-up.
“Build a reading app”Confirms the workspace; creates it or the app if needed; calls create_app to build the schema, tables, primary keys and seed data in one step.
“Each person sees only their own notes”Designs an owner_id column, calls set_app_role to narrow member, and writes the filter as owner_id = {user_id} instead of leaving the default full access.
“Admins approve members”Configures App Roles, access requests and the review flow; creates a function or trigger when server-side work is needed.
“It opens in a browser”Writes the frontend, calls REST with the right cookies/CSRF, and handles the capability: null ask-for-access state instead of shipping a blank page.
“Give me a link”Uploads the site, calls publish_site, runs site_status to catch missing assets or bad API calls, and returns the URL.
It feels simple because the hard parts are tooled: the database, accounts, permissions, CSRF, function runtime and publishing checks are not done by the prompt itself. The agent connects them. You can still open the console and inspect every step.

Or do it manually

You can skip the agent entirely: register in the console → create a workspace → create an app → add tables → configure access → publish a site. The Concepts, REST and Console sections below cover that path. The agent is faster, not the only entrance.

2. Concepts

Workspace

The account, membership and data boundary. One account can join several workspaces. Members have workspace roles.

App

An isolated schema named app_<slug>: tables, views, functions, triggers and App Roles. An app is not a page.

Site

Static files published to AtomHouse and served at /site/<workspace>/<site>/. An app can have several sites.

App Role

The identity inside an app: admin, member, reader, plus custom roles. It controls tables, rows and columns.

Three kinds of credential

CredentialBelongs toUse it forNot for
Personal token atomhouse_pat_…A personAgents, scripts, attended automationBypassing that person's App Role
App credential atomhouse_app_…An appUnattended backends, triggers, external servicesManaging the account, workspace, roles or sites
Browser session cookieThe signed-in personThe console and a published site's pageAgent scripts; it also needs CSRF
Never put an app credential in HTML. It is a permanent key that bypasses row filters. A page uses the visitor's cookie; server-side logic belongs in a function or your own server.

3. Install the skill

AtomHouse does not just give an agent an API key. It gives it a skill document and a set of MCP tools. The agent starts with bootstrap, then creates apps, reads data, publishes sites and manages access.

Install the skill

The skill is the instruction set and tool catalogue an agent reads. There are three ways to install it; choose one, then authorize the machine once.

Option 1: give the agent one sentence

Paste this into Claude Code, Cursor, WorkBuddy, Codex or another capable agent:

Download https://atomhouse.cloud/api/v1/skill.zip, unzip it into your skills directory, and follow INSTALL.md to install or update. When done, reply briefly: whether you are connected and what I can do next.

For the China service, use https://atomhouse.cn/api/v1/skill.zip. The agent downloads, extracts and reads the install guide; it should then tell you whether it is connected.

Option 2: install with npx, optionally pointing at an API

With Node.js installed, use the npm installer. It defaults to Claude Code; use --target for another runtime:

npx atomhouse-skill add

# Another runtime
npx atomhouse-skill add --target cursor
npx atomhouse-skill add --target codex
npx atomhouse-skill add --target dsh

# Point at a specific API / deployment (Cloud)
npx atomhouse-skill add --base-url https://atomhouse.cloud
npx atomhouse-skill login --base-url https://atomhouse.cloud
--base-url is how npx targets an API. Use the same URL for install and login. Without it, the bundled default is the China service (https://atomhouse.cn); use https://atomhouse.cloud for the international service, or your own HTTPS origin for a self-hosted instance.

Option 3: download the package and install it yourself

# International service
curl -fsSL https://atomhouse.cloud/api/v1/skill.zip -o atomhouse-skill.zip
unzip atomhouse-skill.zip

# China service
curl -fsSL https://atomhouse.cn/api/v1/skill.zip -o atomhouse-skill.zip
unzip atomhouse-skill.zip

Put the extracted atomhouse/ folder in your runtime's skills directory and read INSTALL.md. The archive includes SKILL.md, the reference documents and the MCP client; no extra install script is required.

MethodBest forRequires
One sentence to the agentFirst use, no command lineAn agent that can download files and write its skills directory
npx atomhouse-skill addNode.js users who want repeatable installsNode.js 18+; optional --base-url
Download and unzipManaged distribution, offline, custom directoriesAbility to extract files into a skills directory

4. MCP service

4.1 Configure MCP manually

SettingValue
Endpointhttps://atomhouse.cloud/api/v1/mcp
AuthAuthorization: Bearer <personal token>
ProtocolJSON-RPC 2.0 over Streamable HTTP
WorkspaceThe workspace argument on each tools/call
{
  "mcpServers": {
    "atomhouse": {
      "type": "http",
      "url": "https://atomhouse.cloud/api/v1/mcp",
      "headers": {
        "Authorization": "Bearer <token>"
      }
    }
  }
}
Never put the token in SKILL.md, frontend code, Git, or a chat message. Revoke and reissue it in the console if it leaks.

4.2 Device approval when there is no token

An agent should never ask for your password. It requests a device code, you approve it in your own browser, and it polls for the result.

# Ask for a code
curl -s -X POST https://atomhouse.cloud/api/v1/auth/device \
  -H 'content-type: application/json' \
  -d '{"client_name":"my-agent"}'

# Open verification_uri_complete in your browser, then the agent polls:
curl -s -X POST https://atomhouse.cloud/api/v1/auth/device/token \
  -H 'content-type: application/json' \
  -d '{"device_code":"<device_code>","wait_seconds":25}'

The access token is shown once. Call GET /api/v1/auth/me and confirm user.email belongs to the person before doing real work.

4.3 Tools and examples

The first call is bootstrap, with no arguments:

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{
  "name": "bootstrap",
  "arguments": {}
}}

Every later call names a workspace. A typical create call:

{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{
  "name": "create_app",
  "arguments": {
    "workspace": "acme",
    "slug": "reading",
    "name": "Reading Club",
    "tables": [{
      "name": "notes",
      "columns": [
        {"name":"id","type":"BIGINT","nullable":false,"auto_increment":true},
        {"name":"owner_id","type":"VARCHAR","nullable":false},
        {"name":"title","type":"VARCHAR","nullable":false},
        {"name":"body","type":"VARCHAR","nullable":true}
      ],
      "primary_key": ["id"]
    }]
  }
}}
ToolPurposeImportant detail
bootstrapAccount, workspaces, roles and app summariesNo arguments
create_appCreate a schema, tables and seed rows in one callWorkspace owner/admin only
list_tables / describe_tableInspect tables and columnsFiltered by the App Role; describe before writing SQL
queryDuckDB SQL inside one appWrites need the app admin role; no cross-app JOIN
read_rows / insert_rows / update_rowsRow-level reads and writesCheck access before rendering
create_modelSave a SELECT as a read-only viewBelongs to the current app
deploy_function / create_triggerServer-side JavaScript and triggersApp admin required; use a task for long work
publish_site / upload_site_filePublish static filesPublishing makes the page public; confirm first
query_workspaceRead-only SQL across appsWorkspace owner/admin only

4.4 Queries across apps

MCP query sees one app_<slug> schema. FROM app_other.table fails with there is no schema. A workspace owner/admin can use the read-only query_workspace tool:

{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{
  "name": "query_workspace",
  "arguments": {
    "workspace": "acme",
    "sql": "SELECT o.id, c.name FROM app_shop.orders o JOIN app_crm.customers c ON c.id = o.customer_id"
  }
}}
Limits: only a workspace owner/admin can call it, and it is read-only. Members, ordinary App Role holders and app credentials are refused. Use the ordinary app-scoped query for writes.

4.5 Getting better results

  • Confirm the workspace before creating an app; never let the agent guess a slug.
  • If rows are per-person, ask it to narrow member with set_app_role in the same session.
  • Ask it to run site_status before handing over a publish link.
  • When it says the app is done, verify the Access and Audit pages yourself.

5. REST API

The console and published pages ultimately use REST. The complete endpoint list for an app is its rest.md; this section covers authentication, CSRF and the common resources.

5.1 Authentication and CSRF

CallerAuthenticationExtra requirement
Script, agent, serverAuthorization: Bearer <token>The token belongs to the account
Browser consoleSession cookiex-csrf-token on every non-GET request
Published siteApp-scoped site sessionUse site SSO; never build a password form

The CSRF value can be in either atomhouse_csrf__<app> or atomhouse_csrf. Read the scoped cookie first and fall back to the plain one; do not hard-code either name.

function csrfToken() {
  const pairs = document.cookie.split('; ').map((c) => {
    const at = c.indexOf('=');
    return { name: at < 0 ? '' : c.slice(0, at), value: at < 0 ? '' : c.slice(at + 1) };
  });
  const scoped = pairs.find((c) => c.name.endsWith('atomhouse_csrf__shop'));
  const plain = pairs.find((c) => c.name.endsWith('atomhouse_csrf'));
  return (scoped || plain || { value: '' }).value;
}

async function api(path, options = {}) {
  const method = (options.method || 'GET').toUpperCase();
  const headers = { ...(options.headers || {}) };
  if (method !== 'GET' && method !== 'HEAD') headers['x-csrf-token'] = csrfToken();
  if (options.body) headers['content-type'] ||= 'application/json';
  const res = await fetch('/api/v1' + path, {
    ...options, method, headers, credentials: 'include'
  });
  if (!res.ok) throw new Error((await res.json().catch(() => ({}))).error?.message || res.status);
  return res.json();
}

5.2 Common endpoints

ActionMethod and path
Sign in for a tokenPOST /api/v1/auth/login
Current accountGET /api/v1/auth/me
WorkspacesGET /api/v1/workspaces
AppsGET|POST /api/v1/workspaces/{ws}/apps
SQL in one appPOST /api/v1/workspaces/{ws}/apps/{app}/query
Workspace-level SQLPOST /api/v1/workspaces/{ws}/query
RowsGET|POST /api/v1/workspaces/{ws}/apps/{app}/tables/{table}/rows
Current accessGET /api/v1/workspaces/{ws}/apps/{app}/access
Site statusGET /api/v1/workspaces/{ws}/apps/{app}/sites/{site}

5.3 Read and write examples

export ATOMHOUSE_URL=https://atomhouse.cloud
export ATOMHOUSE_TOKEN='atomhouse_pat_...'

curl -s "$ATOMHOUSE_URL/api/v1/auth/me" \
  -H "Authorization: Bearer $ATOMHOUSE_TOKEN"

curl -s "$ATOMHOUSE_URL/api/v1/workspaces" \
  -H "Authorization: Bearer $ATOMHOUSE_TOKEN"

curl -s -X POST \
  "$ATOMHOUSE_URL/api/v1/workspaces/acme/apps/shop/query" \
  -H "Authorization: Bearer $ATOMHOUSE_TOKEN" \
  -H 'content-type: application/json' \
  -d '{"sql":"SELECT * FROM app_shop.orders ORDER BY id DESC LIMIT 20"}'
curl -s -X POST \
  "$ATOMHOUSE_URL/api/v1/workspaces/acme/apps/shop/tables/orders/rows" \
  -H "Authorization: Bearer $ATOMHOUSE_TOKEN" \
  -H 'content-type: application/json' \
  -d '{"values":{"customer_id":"c_123","amount":99.5,"status":"open"}}'
SQL uses the schema, not the app name: app shop exposes app_shop.orders. The schema field returned by the app list is the name to use.

5.4 Using the API from a page

Check access before loading data. A signed-in visitor with no App Role gets HTTP 200 and capability: null, not a 403.

const res = await fetch(
  `/api/v1/workspaces/${ws}/apps/${app}/access`,
  { credentials: 'include' }
);
if (res.status === 401) return showSignIn();
const access = await res.json();
if (!access.capability) return showAskForAccess(access.error);
// now render the page and call data endpoints
Blank-page trap: treating res.ok as "has access" skips the ask-for-access state. Render that state first.

6. Console

Open /app/. The console and MCP/REST use the same data.

6.1 Navigation

  • Workspaces: switch or create one; data is isolated per workspace.
  • Apps: tables, views, functions and sites.
  • Data: browse rows, run SQL, inspect columns — subject to your App Role.
  • Members: invite people and assign workspace roles. A workspace role is not an App Role.
  • Access: review requests and choose the App Role for each approved person.
  • AI: configure the workspace model and see server-side AI tools.
  • Settings / Audit: workspace settings, audit history, backups and dangerous actions.

6.2 First app checklist

  1. Choose a workspace → Apps → New app. Use a meaningful slug such as reading.
  2. Create the tables with an agent or on the Data page.
  3. Open Access, confirm you are in admin, and invite collaborators as member or reader.
  4. Open the site tab, upload index.html and its assets, then publish and open the returned link.
  5. Test the path with a second account: no access → request → approve → visible.

6.3 Members, roles and invitation codes

Members controls workspace membership; Access controls app roles. A person must be a workspace member and hold an App Role before reading that app's data.

Invitations can address an email, phone number or account id, or create a single-use code with no recipient. Treat a code as a one-time secret.

6.4 Publishing a site

A site is static files served at /site/<workspace>/<site>/. Publishing the page does not publish the data: every request still runs as the visitor and their App Role. External CDNs are usually blocked by CSP; upload assets and reference them relatively.

7. AI in your app

There are two layers: an agent using MCP to operate your account, and your page or function calling a model configured for the workspace.

7.1 Configure the model connection

Model connections are workspace resources. Configure them once under Workspace settings → AI:

  1. Open Workspace settings → AI.
  2. Click Add a model.
  3. Enter a name, protocol (OpenAI-compatible or Anthropic), endpoint, API key and at least one model.
  4. The connection is shared by the workspace; the key is never returned to the browser.

Then open the app's AI tab and choose the connection/model for this app, plus its built-in tools, external MCP servers and agent step limit. The app references the workspace connection; it does not store another key.

An app admin can configure the same app layer over MCP: call get_app_ai_config for the current selection and the available connections/models (names and model ids only; never a key), then set_app_ai_config with provider, model, builtin_tools, external MCP settings and agent_max_steps. Workspace model connections themselves remain console-only; MCP cannot add, edit, test or delete a key.

The app AI usage card is app-scoped: it shows this app's tokens, calls today and recent calls, not the workspace total or the account quota.

External MCP services support both a static bearer token and OAuth 2.1. For OAuth, click Connect OAuth in the app AI tab; the browser handles approval and returns to the app. Tokens are encrypted for this app only, with Reconnect and Clear authorization controls. An expired grant is shown on the page, and a 401 says OAuth authorization is required. External tools share the builtin_tools allowlist with host tools and can be selected in the app AI tab.

Before building an AI feature, check workspace.ai_configured from bootstrap. If it is false, stop and ask the workspace owner or admin to configure a model.

7.2 Call /ai from a page

const res = await fetch(
  `/api/v1/workspaces/${ws}/apps/${app}/ai`,
  {
    method: 'POST',
    credentials: 'include',
    headers: {
      'content-type': 'application/json',
      'x-csrf-token': csrfToken()
    },
    body: JSON.stringify({
      messages: [
        { role: 'system', content: 'You are a concise support assistant.' },
        { role: 'user', content: 'Summarise this feedback: the page is blank after login.' }
      ],
      max_tokens: 800
    })
  }
);
const data = await res.json();
// data.text, data.usage
No structured-output mode. /ai returns text, not a schema-constrained object. If you ask for JSON, parse and validate it, retry once on failure, and keep the raw text. Do not write parsed fields into a business table without user confirmation.

7.3 Long work belongs in a task

A normal function request has a 2-second default and 5-second maximum. A model can take longer. atomhouse.ai runs only inside a function task; a page waiting for a result should call /ai directly.

export default async function () {
  const reply = await atomhouse.ai.chat({
    messages: [{ role: 'user', content: 'Summarise this week in three themes.' }],
    max_tokens: 1200
  });
  atomhouse.insert('summaries', { body: reply.text });
}

7.4 AI failures

SymptomCauseAction
503 with a model connection messageNo model configured for the workspaceAsk a workspace owner/admin to add one in Workspace settings → AI; do not hide the error. An app admin can select it with MCP set_app_ai_config
Task-only error in a functionatomhouse.ai called from a normal requestUse /ai, or run the function as a task
Empty model replyA reasoning model was cut off by max_tokens: 1Give it a real token budget
JSON parse failureThere is no JSON modeValidate, retry once, keep the raw reply

8. Errors and limits

ErrorWhat it meansNext step
401No token, expired or revokedSign in or run the device flow; never use another person's token
403No App Role, or workspace role too lowAsk for access, or have an owner/admin grant it
409Slug exists, duplicate request, or conflicting stateChoose another slug; check whether the first request succeeded
413Upload or request body too largeCompress, split, or import in batches
422Invalid SQL, argument or column nameRead the message; call describe_table
503Owning node unavailable, or model not configuredRead the message; do not recreate the workspace on this node
504SQL timeout or busy workspaceAggregate/narrow the query and retry
missing x-csrf-token headerBrowser write without CSRFRead atomhouse_csrf__<app> or atomhouse_csrf

Limits

  • Uploads default to 64 MiB per request; compress large assets.
  • Row pages default to 500; use offset or SQL aggregation.
  • SQL defaults to a 15-second timeout; deployments may tune it.
  • Table capacity depends on the plan; writes are checked at the boundary.
  • Responses can be truncated; inspect truncated instead of assuming there are no more rows.

Troubleshooting order

  1. Read /healthz and the error message; do not infer from the status code alone.
  2. Call GET /auth/me to confirm the account.
  3. Call bootstrap or GET .../access to confirm permissions instead of retrying blindly.
  4. Call describe_table before guessing a column. Use app_<slug> as the schema.
  5. For cross-app work, split into per-app queries and merge; do not keep trying multi-schema SQL from a member account.

9. Security

  • Keep tokens in a secret store or environment variable, never in SKILL.md, Git, a page, chat or a temp file.
  • Never put a machine credential in a page. It bypasses row filters and is a permanent database key.
  • Do not give session cookies to an agent. Agents use bearer tokens; browsers use cookies.
  • Confirm what publishing makes public. A public page still runs as each visitor; data is not automatically public.
  • Use least privilege. Narrow member before approving requests; do not make everyone an admin.
  • Do not share accounts. Per-person accounts keep audit and revocation meaningful.

10. FAQ

The agent cannot find my workspace

Ask it to call bootstrap; do not let it guess a slug. Confirm the account has joined the workspace and the token belongs to that account.

The page opens but the data is empty

Call GET .../access. If capability is null, the account has no App Role; show the ask-for-access state.

there is no schema

You probably used the app slug instead of the schema. App shop is app_shop. For cross-app work use query_workspace (owner/admin, read-only) or merge per-app results.

Reads work but writes return 403

The App Role may allow reading but not writing, or a cross-origin request may have dropped the cookie. Check the role and use relative /api/v1/... paths.

How do I update a published site?

Upload the changed files again and run site_status, checking missing_files and invalid_api_calls. Hard-refresh the browser if it shows an older asset.

More detail: open /api/v1/skill.md and the skill's reference/ folder. Each app's full REST surface is linked from its rest.md.