MCP path
For Claude web/mobile and other remote clients, addhttps://mcp.tinycloud.xyz/mcp as a custom connector. 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
delegate profile for you and requires @tinycloud/mcp 0.3.0 or newer on the
hosted service.
For a local MCP client, continue with the CLI bootstrap in this section.
This 16-tool workflow requires @tinycloud/mcp 0.2.0 or newer and a deployed
TinyCloud node running 1.6.0 or newer. The node release is deployed first, the
stable MCP package is published second, and this guide is published last.
Install the CLI and MCP packages with Node.js 20 or newer, then create a
delegated agent profile once if one does not already exist:
The remaining six tools manage the selected session and protected secret flow:
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, calltinycloud_kv_put with tagged content. For a Markdown file the
tool input can be:
authority_required, complete the exact request flow below 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
Calltinycloud_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:
Two-agent approval
Use separate delegate and owner agents when a data tool returnsauthority_required.
- The delegate agent calls the data tool and saves the returned
tinycloud.auth.requestobject exactly asrequest.json. Do not edit its request ID, audience, host, or capabilities. - The owner agent reviews the artifact. It must contain only the exact
account-registry, KV key or prefix, or SQLite database capabilities expected
for this step. A write or delete request must match the user’s stated action.
For
tinycloud.sql/write, the owner must separately accept that the actual capability is database-wide rather than table- or row-scoped. - The owner agent grants that exact request with an explicit owner profile:
- The delegate agent passes the complete delegation object to
tinycloud_auth_import. - The delegate agent retries the same exploration tool. Imports persist in the selected profile, so approval and retry may happen in different MCP process sessions.
Owner CLI inspection
When MCP is unavailable, the owner can inspect the same registries locally and return a read-only summary to the agent. Use an explicit owner profile, 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:
tc account commands derive the account registry from the active
profile. Do not run these commands with a delegate profile and assume they
target the owner’s account. Use the MCP tools and their canonical per-operation
requests for delegated exploration.
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
