Esta página só existe em inglês. O menu e os outros textos seguem em português.
Connecting an agent
Rapadura exposes the same operations in three ways. Choose the one that matches where the agent runs. For installation, sign-in, and MCP registration, follow setup.md.
This reference focuses on invited member capabilities (static hotsites on
rapadura.space, starter recipes, public profiles and Explore). Organization
staff and organizers with access to container apps or the community Laravel
site can sign in at /docs/staff/ for the staff guides and
/docs/staff/skill.md.
1. CLI (any agent that can run commands)
Install the CLI and have the person securely configure a dedicated agent
token as RAPADURA_TOKEN. Do not use their saved human login as an agent
fallback. The following commands run within that token's grant and support
--json:
rapadura publish ./dist --site meetup-sobral --create --json
rapadura sites list --json
rapadura rollback meetup-sobral 3 --json
Errors go to stderr as {"error":{"code":"…","message":"…","hint":"…"}} with
exit status 1. Codes are stable; see errors.md.
For CI or an agent without an interactive login, set RAPADURA_TOKEN (and
optionally RAPADURA_GATEWAY) in the environment instead of a credentials file.
2. Local MCP over stdio (Claude Code, Cursor, Codex, …)
The CLI is also an MCP server. It uses the saved human login to obtain a separate agent token, then acts under that token's grant. It can upload local directories:
claude mcp add rapadura -- rapadura mcp
Tools for invited members: whoami (who is signed in, and their own overview:
sites, tokens and connectors, recent actions and refusals, requests),
list_zones, list_sites, show_site, create_site, publish_site (with
path or inline files), list_versions, rollback_site, delete_site,
restore_site, site_logs; custom domains: request_domain (asks the owner
to map a custom domain to a static site), list_domains, remove_domain
(detaches one at once, no approval needed); approvals: list_approvals;
operations: get_operation, list_operations, cancel_operation; your
limits and usage: show_limits; and plan_change (preview the exact plan
and digest of a change before making it). Organization staff/organizers also
have container-app and community-Laravel tools documented in
/docs/staff/. Administrative views belong to the platform
owner only and are refused to agent tokens.
3. Hosted MCP (no install)
The gateway serves Streamable HTTP MCP at https://agents.rapadura.net/mcp
with a bearer token. Give the agent a token of its own, rapadura agent create --name my-agent (see "An agent has an identity of its own" below),
and not your login token: the hosted endpoint refuses a person's login token
(403 agent_token_required), because your login inside an MCP client would
be a broad operator credential handed to an agent. An agent's token, yours
from rapadura agent create or the one the OAuth sign-in gives, works.
claude mcp add --transport http rapadura https://agents.rapadura.net/mcp \
--header "Authorization: Bearer rpd_…"
On the hosted lane publish_site takes files inline (files: [{path, content}],
base64 for binaries) since the gateway cannot read your disk.
Clients that cannot send a header sign in with OAuth 2.1 instead: the gateway
is its own authorization server. A 401 on /mcp points at
/.well-known/oauth-protected-resource/mcp, which names the issuer
(https://agents.rapadura.net, metadata at
/.well-known/oauth-authorization-server); clients register themselves at
/oauth/register (RFC 7591), send the person to /oauth/authorize with PKCE
S256, and exchange the code at /oauth/token for a one-hour access token plus
a rotating refresh token good for 90 days. The person signs in with GitHub
under the same invite-only rule and approves on a consent page. In claude.ai:
Settings → Connectors → Add custom connector → URL
https://agents.rapadura.net/mcp → Connect → sign in → Approve. Claude Code:
claude mcp add --transport http rapadura https://agents.rapadura.net/mcp,
then /mcp to sign in. The access token is an ordinary rapadura token named
the oauth:<client> token is visible and revocable on /me.
An agent has an identity of its own
An agent is what its token says it is, not what it calls itself: the
gateway reads the token's kind, never the route (/v1 or /mcp), the
client's name or its User-Agent. Your own login token is you wherever it
goes; an agent holds a token of its own, with a grant: the apps it may
act on, the actions it may take (site.read, site.publish,
site.rollback, site.delete, site.restore, site.create, env.read,
env.write for variables, cron.write, caps.read, domain.request,
artisan.run, approval.request, operation.read) and when it expires, at
most 90 days. Managed PostgreSQL and one-off command actions (db.read,
db.request, app.run) and recipe permissions are excluded from default grants
and must be minted explicitly via --actions. Nothing else can be granted: an agent never sets or removes a
secret, decides a request, reviews code, changes who may do what, or mints,
lists or revokes a token. What the grant does not cover is 403 grant_denied, naming the action and the app.
rapadura agent create --name ci-bot --apps meetup.rapadura.space --actions site.read,site.publish --ttl 720h
rapadura agent list # your agents' tokens that still work
rapadura agent revoke 12 # new actions stop within a minute
rapadura agent grant # what the token in use may do
The secret is shown once. Give it to the agent as RAPADURA_TOKEN. A grant
never changes. To give an agent a wider grant, mint a new token with your own
login. rapadura mcp mints one for itself the first time it starts (named
mcp:<hostname>, all your apps, the default actions, 30 days), keeps it in the
credentials file beside your login and replaces it a day before it ends;
rapadura logout revokes both. The connector you add in claude.ai gets the
same kind of token with the same grant when you approve it. Recipe permissions
and managed database/command actions (db.read, db.request, app.run)
are excluded from these defaults; a person must mint them explicitly for exact
hosts. Every change an
agent makes is recorded in the audit log with you as the person and
actor_kind agent; what you approved is recorded as the agent's act with
you as the approver. A request is never decided by the token or the person
that filed it (an agent's request is decided by the person it works for),
and a request whose agent token was revoked, expired or lost the grant in
the meantime is closed instead of run.
A rapadura mcp older than 0.17 sent your login token and announced itself
in its User-Agent; the gateway answers it 426 client_outdated until you
upgrade. The owner of a gateway can turn off every change from agents,
leaving reads and people as they are, with RAPADURA_AGENT_MUTATIONS=off
and a restart; a request an agent filed that you approved meanwhile waits
(approved, nothing runs) until they are enabled again.
Operations and request keys
Every change is an operation, and a receipt that says queued or running
is not done. succeeded means the operation completed, but reason held
means the built image waits for human approval and is not live. Check the
result before reporting promotion. Follow a change with
get_operation (rapadura ops show|wait); list_operations and
cancel_operation (a stop at the next safe point, undoing nothing; an
operation that needs attention is the owner's to resolve, so a cancel of it is
refused) are the other two tools. Every write tool takes an optional
request_key (HTTP: Idempotency-Key; CLI: --request-key, a fresh one per command by default):
send the same key if you must send the same change again, and you get the
first attempt's operation and receipt back instead of a second change. The same
key with another archive or payload is 409 request_key_conflict; a key is
kept while its operation is active and 7 days after. A change of the same site
that is still running is 409 operation_conflict, naming it; an agent with limits.max_pending changes queued or running gets 429 capacity_exhausted. Request and response examples for each call, and the
same calls as MCP tools: API examples. Detailed
operations and plans documentation for staff/organizers lives in
/docs/staff/.
What an agent should know
- Confirm before mutating: ask for the person's explicit confirmation before publishing or updating a live site, rolling back a version, deleting a site, detaching a custom domain, or making permanent/public profile or Explore changes. Read-only inspection, dry-run plans, and explicitly requested restores of retained deleted sites do not require an extra confirmation pause (never recreate a purged site or publish new code).
- A site is
slug.zone. Slugs are lowercase letters, digits and single hyphens. A new site is created underrapadura.space(<slug>.rapadura.space, each retained version at<slug>--v<n>.rapadura.space); sites created earlier underrapadura.netorphpcomrapadura.orgkeep their address.rapadura zoneslists the zones and the person's limits. - Public profile (
https://<handle>.rapadura.net) and Explore (https://rapadura.net/explore) are the member's own opt-in choices:rapadura profileandrapadura listing, no MCP tools yet, revision required on every write, the handle permanent. Ask before claiming a handle or switching toallmode. Guide: en/profiles.md. - Live member limits: 5 retained sites (
+1on first publish, up to+3from inviting newcomers who join), 500 MB total storage, 100 MB max archive/upload size, 100 MB max file size, 20,000 files per site, 20 versions retained. Runshow_limitsorrapadura limits --jsonto read the caller's exact numbers. - Apps and the community Laravel site are for organization staff and
organizers only (
apps_allowed: falsefor members); staff guides live in /docs/staff/. - Nothing server-side runs on static hotsites. A site that needs PHP or a database cannot run as a static hotsite. rapadura has no WordPress lane (removed in 0.10.0).
- Worked examples with real output: en/recipes-static.md.
- Recipe catalog (docs built with
make docs):/docs/recipes/index.jsonis the machine entry point (id, revision, maturity, qualification summary, localized guides, limits, source files);/docs/en/recipes.htmland/docs/pt/receitas.htmlare the gallery for people. Maturity is not a promise: only asupportedrecord with aqualifiedsummary for the same revision is qualified,plannedis an idea, and "Request readiness: Not checked" means the page checked nothing about the person's account. Verify access, capabilities, limits and setup yourself before relying on a recipe.