Cloud for Bots docs
One key and one MCP server give your bot sandboxes, a logged-in browser, storage, secrets, queues, cron, locks and a human when it gets stuck. Bots get this guide automatically when they connect. Plain text: /bots.md
Quickstart
- Get a key. Enter your email on the homepage. Your key shows once and is copied for you. No card.
- Connect your bot. In Grok Bot (or any MCP client) add the server:
URL: https://cloudforbots.com/mcp Header: Authorization: Bearer <your key> - First win. Ask your bot: “Run python in my Cloud for Bots sandbox and add the numbers 1 to 100.” It should answer 5050. Or from a terminal:
curl -s https://cloudforbots.com/api/v1/sandbox \ -H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \ -d '{"action":"run","cmd":"python3 -c \"print(sum(range(101)))\""}'
Want to try first? The homepage has a live sandbox you can run without a key.
Connect your bot
| App | How |
|---|---|
| Grok Bot | Add a custom MCP server with the URL and header above. |
| Claude Code | curl -fsSL https://cloudforbots.com/install.sh | sh or claude mcp add with the URL and header. |
| Claude app | Settings → Connectors → add custom connector. |
| ChatGPT | Developer mode → add a custom MCP connector. |
| Any MCP client | Streamable HTTP at https://cloudforbots.com/mcp, bearer auth. |
Step-by-step with copy buttons: /start.
Which tool when
- sandbox: heavy or long work (code, installs, data jobs). It pauses instead of dying, so files survive. Each
runis up to 120 s; usebackground: truefor longer jobs and check back. - store: save progress and results (
set/get). Save after every step so you can resume after a crash or a new session. - inbox, queue, cron: wake up later.
inboxgives you a URL that webhooks and other bots can POST to; messages land in queueinbox.<name>.cronruns on a schedule or a one-offtimer. Read withqueuepull, thenackwhen done. - lock, rate: stop bots colliding.
lock= one writer at a time.rate= shared limits like "6/6h" across all your bots. - secrets + fetch: never paste API keys into chat or code. Store once with
secretsset(withallowed_hosts), then call APIs withfetchusing{{secret:NAME}}. - browser: sites that need a login. Sessions keep cookies between calls.
- handoff: when a human is needed (captcha, 2FA). Watch-only on free keys.
- ledger, replay, loop_*, budget_*: safety. Record runs in
ledger, check repeats withloop_check_step, cap spend withbudget_open_budgetandbudget_reserve, review withreplay.
Pattern 1: long job with resume
storeget nsjobs, key<job>-> last finished step (none = start at 0).- For each remaining step:
sandboxrun it, thenstoreset{"step": n, "result": ...}. - If you crash or the chat ends, start again at step 1. You skip finished steps.
Pattern 2: webhook-driven bot
inboxcreate nameorders-> give the URL to the other service.cronset (ortimer) with{queue: "wake.orders"}if you need a nudge, or just check on each run.queuepullinbox.orders, handle each message, thenackits id. Un-acked messages come back.
Pattern 3: safe posting with a rate limit
lockacquirepost(ttl_s 60). If you do not get it, another bot is posting: stop.ratetakepostslimit6/6h. If not allowed, waitretry_after_s.fetchthe posting API with{{secret:POST_TOKEN}}.ledgerrecord the run, thenlockrelease with the token.
Rules of thumb
- Save to
storebefore and after anything slow. - Ack queue messages only after the work is done.
- Ask your human before spending money or posting publicly.
- Full reference: https://cloudforbots.com/llms-full.txt
Custom instructions for your bot
Paste this once so your bot knows when to reach for each tool.
- Grok Bot: paste it into a chat, or wherever you keep its standing instructions.
- Claude: Claude app: project instructions. Claude Code: add it to
CLAUDE.md. - ChatGPT: Settings → Personalization → Custom instructions.
You have Cloud for Bots tools (MCP server "cloud-for-bots"). Use sandbox for heavy or long jobs. Save progress to store after each step and resume from it. Use inbox, queue and cron to wake up later. Take a lock and a rate slot before posting or other shared actions. Use secrets + fetch instead of pasting API keys. Use browser for logged-in sites and handoff when a human is needed. Ask me before spending money or posting publicly. Full guide: https://cloudforbots.com/bots.md
Tool reference
Every tool works three ways: as an MCP tool, as REST, and from the TypeScript SDK. All calls use Authorization: Bearer <key>.
Sandbox MCP: sandbox
Named Linux sandboxes that pause instead of dying. Files, packages and processes survive.
POST /api/v1/sandbox
| Action | Body |
|---|---|
run | {cmd, cwd?, timeout_s? (1-120), background?, secrets?} |
write_file | {path, content | content_base64} |
read_file | {path} |
sync_from_store / sync_to_store | {ns?, prefix?, dir?} |
pause · kill · status · list | {name?} |
curl -s https://cloudforbots.com/api/v1/sandbox \
-H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \
-d '{"action":"run","cmd":"python3 -c 'print(5050)'"}'Free: 3 sandboxes, 60 run-minutes a day. Auto-pauses 1 minute after the last call.
Browser MCP: browser
A real headless Chromium per named session. Logins and cookies stay between calls.
POST /api/v1/browser
| Action | Body |
|---|---|
open | {url} |
run | {steps:[{goto},{click},{fill},{type},{press},{extract},{screenshot},...]} |
handoff | {kind: 2fa|captcha|login, note?, fill?} |
screenshot · pause · kill · list | {session?} |
curl -s https://cloudforbots.com/api/v1/browser \
-H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \
-d '{"action":"open","url":"https://example.com"}'Store MCP: store
Key-value and files for your account. Any key on the account can read them.
POST /api/v1/store
| Action | Body |
|---|---|
get · set · incr · delete · list | {ns?, key, value?, ttl_seconds?, if_version?} |
file_put · file_get · file_list · file_delete | {ns?, name, content_base64?} |
usage | {} |
curl -s https://cloudforbots.com/api/v1/store \
-H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \
-d '{"action":"set","ns":"jobs","key":"daily","value":{"step":3}}'Free: 100 MB, 100,000 items, values up to 256 KB, files up to 4 MB. REST: /api/v1/store/kv/<ns>/<key>
Secrets + fetch MCP: secrets
Store an API key once. Call APIs with {{secret:NAME}} and the value is never shown to the bot.
POST /api/v1/secrets · POST /api/v1/fetch
| Action | Body |
|---|---|
secrets set | {name, value, allowed_hosts:["api.example.com"]} |
secrets list · delete | {name?} |
fetch | {url, method?, headers?, body?} with {{secret:NAME}} anywhere |
curl -s https://cloudforbots.com/api/v1/secrets \
-H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \
-d '{"url":"https://api.example.com/me","headers":{"Authorization":"Bearer {{secret:EX_TOKEN}}"}}'Free: 25 secrets. Only https, only allowed hosts, values redacted from replies.
Queue, inbox, topics MCP: queue
Wake up later and pass work between bots. At-least-once delivery.
POST /api/v1/queue · /api/v1/inbox · /api/v1/topic
| Action | Body |
|---|---|
push | {queue, message | messages, delay_s?} |
pull | {queue, max<=10, visibility_s} |
ack · nack | {queue, ids} |
inbox create | {name} returns a public URL; posts land in queue inbox.<name> |
topic publish · subscribe | {topic, queue?, message} |
curl -s https://cloudforbots.com/api/v1/queue \
-H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \
-d '{"action":"pull","queue":"inbox.orders","max":5}'Free: 10,000 pushes a day, 64 KB per message.
Cron and timers MCP: cron
Run a request or drop a message on a schedule (UTC), or once.
POST /api/v1/cron
| Action | Body |
|---|---|
set | {name, schedule:"*/5 * * * *", request | {queue, message}} |
timer | {at | delay_s, request | queue} |
list · history · pause · resume · delete · run_now | {name} |
curl -s https://cloudforbots.com/api/v1/cron \
-H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \
-d '{"action":"set","name":"daily","schedule":"@daily","request":{"queue":"wake.daily","message":"go"}}'Lock and rate MCP: lock
Stop bots colliding: one writer at a time, and shared limits across every bot.
POST /api/v1/lock · POST /api/v1/rate
| Action | Body |
|---|---|
lock acquire · renew · release · status | {name, ttl_s?, wait_s?, token} |
rate take · peek | {name, limit:"6/6h", n?} |
curl -s https://cloudforbots.com/api/v1/lock \
-H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \
-d '{"action":"take","name":"posts","limit":"6/6h"}'Free: 1,000 locks, 200 counters.
Human handoff MCP: handoff
When the bot hits a captcha, 2FA or a sign-in wall, a person gets a one-tap link.
POST /api/v1/handoff
| Action | Body |
|---|---|
create | {kind, url?, note?, notify_email?} |
status · cancel · list | {id} |
curl -s https://cloudforbots.com/api/v1/handoff \
-H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \
-d '{"action":"create","kind":"2fa","note":"Bank login code"}'All Access gets links. Free keys log the block only.
Login vault MCP: vault
The bot gets a signed-in session without seeing the password.
POST /api/v1/vault
| Action | Body |
|---|---|
put | {name, domain, username, password, totp_secret?} (from the dashboard) |
login | {name, url, form} |
fetch | {session, url} |
curl -s https://cloudforbots.com/api/v1/vault \
-H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \
-d '{"action":"login","name":"crm","url":"https://crm.example.com/login","form":{"email":"{{username}}","pw":"{{password}}"}}'Model gateway MCP: ai
Call Grok, Claude or GPT with your own provider keys stored in Secrets. No markup.
POST /api/v1/ai
| Action | Body |
|---|---|
call | {model, messages, system?, max_tokens?, provider?, key_secret?} |
curl -s https://cloudforbots.com/api/v1/ai \
-H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \
-d '{"model":"grok-4","messages":[{"role":"user","content":"hi"}]}'Default secret names: XAI_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY.
Ledger, replay, webhooks MCP: ledger
Record runs and costs, replay what happened, get signed events.
POST /api/v1/ledger · /api/v1/replay · /api/v1/webhooks
| Action | Body |
|---|---|
ledger record | {bot, status, usd?, tokens_in?, model?} |
ledger feed · rollup | {since?, days?} |
webhooks add · list · rotate · redeliver | {url, events?} |
curl -s https://cloudforbots.com/api/v1/ledger \
-H "Authorization: Bearer $CLOUDFORBOTS_API_KEY" \
-d '{"action":"rollup","days":7}'