Publish artifacts from a local agent
A coding agent running on your own machine can publish an HTML page (a screenshot
gallery, a report) as an artifact document of one project and add new versions to
it later. It does so with a project credential: a token bound to exactly one
project, limited to the artifact tools and always expiring. The local package
supacloud-artifact-mcp gives the agent the two tools artifact.publish and
artifact.update and streams the files to SupaCloud itself.


-
Mint a project credential. Open Settings → Credentials → API tokens (owner or admin of the workspace), choose New access, then Local agent. Enter a label, choose the project and keep the five permissions selected:
project:readandartifacts:read— read the project and its artifacts;artifacts:upload— move the file bytes;artifacts:publish— create a new document;artifacts:update— add a version to an existing document.
Three more permissions are offered but not selected:
artifacts:comment(reply to and resolve artifact comments),artifacts:form(create forms and acknowledge their responses) andartifacts:share(create share links). Select one only when the agent works on that door — the §29 gateway’s refusal names the exact permission a call needs (project_credential_required, e.g.artifacts:commentforartifact.comment.reply).Leave the expiry empty for the default of 30 days or pick a date up to 90 days ahead. The token (
scpj_…) is shown exactly once. Store it in your password manager or secret store right away; SupaCloud keeps only a digest. -
Install a verified release of the package. Releases of
@supacloud/artifact-mcpare taggedartifact-mcp-v<version>. Each one is published to the blockworx Forgejo npm registry and, as the Generic Packagesupacloud-artifact-mcp/<version>, together withSHA256SUMSand its cosign signature bundleSHA256SUMS.sigstore.json. Before you install, check the signature with the runner public key your operator gives you and the Blockworx trusted root, then the checksum:Terminal window curl -fsSL https://archive.blockworx.tech/pki/blockworx-trusted-root.json -o trusted-root.jsoncosign verify-blob --key cosign.pub --trusted-root trusted-root.json \--bundle SHA256SUMS.sigstore.json SHA256SUMSsha256sum -c SHA256SUMSThe package needs Node 22.19 or later.
-
Start the package with the credential in its environment. The package reads its credential descriptor from the environment at start, never from tool arguments, a file or the command line. Let your secret store or credential helper start it with:
SUPACLOUD_API_URL— your SupaCloud address;SUPACLOUD_ARTIFACT_PROJECT_TOKEN— thescpj_…token;SUPACLOUD_ARTIFACT_WORKSPACE_IDandSUPACLOUD_ARTIFACT_PROJECT_ID— the workspace and the project the token is bound to;SUPACLOUD_ARTIFACT_PRINCIPAL_ID— the token’s id (theidof the mint answer);SUPACLOUD_ARTIFACT_DEPLOYMENT_ID,SUPACLOUD_ARTIFACT_ENVIRONMENTandSUPACLOUD_ARTIFACT_ISSUER— the deployment facts the mint answer carries (deployment_id,environment,issuer); the “Copy for local agent” handoff includes them, so you never ask an operator for them. A deployment that names no claim omitsdeployment_id.SUPACLOUD_ARTIFACT_EPOCHrepeats the issuer;SUPACLOUD_ARTIFACT_CAPABILITIES— the capabilities of the token, comma-separated.
Register the package as a stdio MCP server in your agent (
supacloud-artifact-mcp). When a launcher starts it for you, the launcher checks the installed entry against the release it pins and refuses to start an unverified install. It passes the values only in the package’s environment, never on its command line. The descriptor values are labels for the client; the server checks the token’s project, capabilities, expiry and deployment on every request. -
Publish. Ask the agent to call
artifact.publishwith the path of the HTML entry in its working directory, a title, the asset files the page references and an idempotency key. The result names thedocument_id, theversionand theview_url. -
Update the same document. Call
artifact.updatewith thatdocument_id, the new files and a new idempotency key. The document keeps its id and gains version 2.
Hand the credential to a local launcher
Section titled “Hand the credential to a local launcher”Right after the mint, Copy for local agent copies one JSON document instead of the
bare token: the token plus the facts it is bound to: kind
(supacloud-project-credential/v1), api_url (the server that issued it),
workspace_id, project_id, principal_id, fingerprint, capabilities and
expires_at. A launcher that keeps credentials for you reads it once, refuses it when
any field differs from the project it serves, checks it live against the server and
then stores it in its own protected custody. The format is described by
docs/schemas/project-credential-handoff-v1.json.
How many files a project keeps
Section titled “How many files a project keeps”A project keeps a limited number of distinct files (entries and assets) from
publications. The limit comes from the plan of the workspace’s organisation, the
entitlement artifacts.project_files.max: 50 files per project on every plan except
enterprise, which has no limit. A publication that would go past the limit is refused
with 429 and publication upload budget is exhausted; files of other projects do not
count.
The local package keeps its own advisory budget of 50 files per process and counts what your credential already holds — the files stored in the project plus the files another running process of the same credential has in flight right now. That is advisory: the airtight bounds are the project entitlement above and the slots and bytes one publication is granted, both enforced by the server. Two processes that reserve at the same moment can therefore overshoot the advisory sum by one reservation each; neither can exceed the project entitlement.
Several local agents on one project credential
Section titled “Several local agents on one project credential”You can run several agents side by side on the same project credential — for example one
session on a gallery and another on a report. Each process takes its own journal slot:
its own local file under ~/.config/supacloud-mcp/artifact-journals-v3 with its own
operating-system lock, so a second process no longer waits for the first one to exit and
neither can rewrite the other’s retained debt.
- One credential has eight slots. The first process takes the single-file journal it always
used; the next seven take
<hash>-slot-<k>.json. A ninth concurrent process is refused withartifact journal slots exhaustedand the refusal names the slots that are held. That is not damage and needs no recovery — start the process later, or stop one of the others. - When a process dies, the next process that finds its slot free settles what that slot left behind (through the server, exactly as the dead process would have) and then removes the emptied file. Fewer processes running later therefore never strand an earlier process’s debt.
- A slot is a scope label between cooperating processes of one credential, not a password. A process that holds the same credential could name another slot on purpose; it is already fully authorized for the project, and that is exactly why the boundary against other people’s projects stays the credential itself — principal, deployment and audience — never the slot number.
- Recovery custody is still held once per credential. While a workspace runs with the recovery cutover gate open, one credential holds one recovery session even if it runs several journal slots. The gate is shut today; opening it requires keying custody per slot first, and a guard fails the build the day it opens.
What the credential cannot do
Section titled “What the credential cannot do”- It reaches only its own project: a document, publication or artifact of another project is not found.
- It cannot mint, widen or renew a credential, and it cannot call workspace tools.
- On the external MCP gateway (
POST /api/mcp) it sees the read tools its capabilities cover.artifact.publishandartifact.updateare not listed there: the bytes travel only through the local package. - It stops working when it expires, when an owner or admin revokes it on the API tokens tab, when the person who created it leaves the workspace, when the project is archived or when the operator closes project authority for the deployment.