Skip to main content
Use this workflow when an agent needs to discover what is in a user’s TinyCloud. Agents that can run the CLI sign in once with tinycloud onboard (start at agents.tinycloud.xyz/onboarding) and use the CLI path. Other agents need a compatible hosted MCP connection; check client setup and support. Approval codes and delegations are credentials. Return them only to the requesting agent’s trusted conversation when that flow requires it; never publish them or send an owner private key.

MCP path

In a client that supports Streamable HTTP MCP and OAuth (for example Claude app or a ChatGPT custom connection), add https://mcp.tinycloud.xyz/mcp. Call tinycloud_connect, approve its one-time OpenKey link, and call it again before continuing with account discovery below. Hosted mode creates and maintains the agent’s profile for you and exposes 24 tools. For personal records, just ask “Log my weight: 80.5 kg today.” Approve connect and the separate records request once, then Claude uses tinycloud_apps_context, tinycloud_apps_read, tinycloud_apps_write and tinycloud_apps_query. These hosted-only tools share the coding-agent records under xyz.tinycloud.agent-data/ in default, using one prefix grant for get, list, put and delete. Generic KV tools still request their exact input scope. Supply an IANA timezone once, not your city or precise location. Fresh reads return ETags for conditional edits; stale edits return CHANGED. Ordered write batches can partially succeed: inspect each outcome and move steps before retrying, and report only what was saved. For larger questions, Claude can offer an optional fast, searchable copy of your records, with its own approval. KV remains the truth. COPY_PARTIAL resumes on the next query; nonretryable copy_unavailable needs the node team, so answer from KV. See TinyCloud MCP for the complete contract and approval settings. Hosted MCP and the AI client receive plaintext results. Read the privacy boundaries before approving access. Production grants last 30 days and approval links last 15 minutes. An expired session returns a fresh link in error.details; an expired grant returns an authority_required approval link. Approve the new link before retrying. Hosted results include readable canonical JSON in text except successful secret values. Read-only results have a 100,000-character cap; write results are never truncated by it. For a local MCP client, install the CLI and MCP packages with Node.js 22.20 or later and sign in once with tinycloud onboard. The local stdio surface has 21 tools and needs a TinyCloud node running 1.6.0 or newer.
Onboarding already allows account registry reads. Configure MCP with that profile as described in TinyCloud MCP. The data surface is: Seven more local tools manage the selected session and protected secret flow: The last four read at a wider scope or read an app’s own description of its data: Call tinycloud_account_spaces_list first. Compare its space IDs with tinycloud_account_applications_list, then choose a space and call tinycloud_kv_list. Read individual keys with tinycloud_kv_get only after their names and app context are known. Account registry discovery is capped at 1,000 records, 1 MiB per record, and 4 MiB total serialized output. It fails closed instead of returning a partial registry. Do not treat an application name as permission to read every key in its space. Use its manifest and any linked knowledge bundle to identify relevant prefixes and data shapes. See Agent-readable Apps.

Store a file safely

TinyCloud KV values can hold arbitrary bytes. After selecting the target space and key, call tinycloud_kv_put with tagged content. For a Markdown file the tool input can be:
If that returns authority_required, follow Approving more access and retry the same input. create cannot overwrite an existing key. To update a known value safely, call tinycloud_kv_head, copy its strong quoted etag, and use mode: "replace" with that ETag. Use mode: "upsert" only when overwriting without a concurrency check is intentional. For binary files, base64-encode the bytes and use { "encoding": "base64", "value": "..." }. KV reads and writes are capped at 1 MiB. tinycloud_kv_get defaults to base64 and also supports explicit text and json representations. It returns the representation tag, byte length, ETag, and available content metadata. Delete only a selected key. Passing the ETag from tinycloud_kv_head to tinycloud_kv_delete prevents deleting a value that changed after inspection. If a conditional mutation reports a retryable database serialization conflict, re-read the key state, which may still be absent. If it exists, compare its current ETag before deciding whether to retry. Deletion removes the key from reads and listings immediately; retained content-addressed blob bytes, including historical versions, continue to count toward storage quota unless a future garbage collector safely reclaims them. Generic KV tools cannot access the protected account or secrets spaces.

Inspect SQLite

Call tinycloud_sql_schema_inspect with an exact space and database first. Then call tinycloud_sql_query with the same target, exactly one SQLite SELECT, and optional bind params. These MCP tools do not execute writes, DDL, pragmas, attachments, or multiple statements. Queries default to 100 rows and 1 MiB and allow explicit limits up to 1,000 rows and 4 MiB. Oversized results fail instead of being silently truncated. SQLite BLOB parameters use { "type": "blob", "base64": "..." }; BLOB results use the same tag and include byteLength. Each SQL read tool requests read capability for the exact database, not the entire space.

Mutate SQLite data

tinycloud_sql_execute is destructive and non-idempotent. It accepts exactly one INSERT, UPDATE, or DELETE with at least one positional ? placeholder and one params value per placeholder. The input must explicitly include acknowledgeDatabaseWideAuthority: true:
The tool rejects literal-only mutations, CTEs, DDL, pragmas, attachments, and multiple statements. Its result reports the statement type, changed-row count, and last inserted row ID when available.
The requested tinycloud.sql/write capability is broader than this tool. Approving it grants full read, write, and schema-mutation authority over the exact database, including when the delegation is used outside MCP. It is not scoped to a table, row, SQL statement, or the three mutation types enforced by tinycloud_sql_execute. Approve only when database-wide authority is intended.
Execution failures are never marked automatically retryable. Because the tool is non-idempotent, inspect database state before deciding whether another write is safe.

Approving more access

When a tool returns authority_required, send the owner its approval link and one line saying what it allows. On local stdio the owner sends back the short code and you pass it to tinycloud_auth_import exactly as sent; on hosted MCP the owner approves, says continue, and you retry the same tool unchanged. Imports persist in the selected profile, so approval and retry may happen in different MCP process sessions. Don’t edit the request, and don’t replace an exact request with a broad space-wide one. For tinycloud.sql/write, tell the owner it covers the whole database.

CLI path

After tinycloud onboard, the agent can read the account registry and the applications space directly. Use machine-readable output and canonical live account reads:
--live matters for read-only discovery. The default indexed spaces path may refresh and register accessible spaces when its index is empty. After selecting a space, list keys and read only the chosen key:
If a command needs more than onboarding granted, ask once:
Send the owner the link it prints and one line saying what it allows. The owner approves and sends back a short code; pass it to the CLI exactly as sent.

Stop conditions

Stop and return the structured result instead of widening authority when:
  • the owner rejects or changes the request
  • a space or app is absent from the canonical account registry
  • the app manifest does not explain a prefix or value shape
  • a write or delete was not explicitly requested, or its exact target is unclear
  • a SQL read request is not one bounded read-only SELECT
  • a SQL mutation lacks the explicit database-wide-authority acknowledgment
  • the owner does not accept database-wide SQL write and schema authority
  • the next step needs a secret value that the user did not request
Secret tools have an additional transcript boundary: the MCP server keeps secret values out of text results and TinyCloud logs, but the MCP client may retain structured results. See TinyCloud MCP before reading secrets.