Goal
Give agents useful Assets access without handing them a long-lived token, letting them delete without you, or writing a custom upload script.Prerequisites
- An Assets space
- An agent that supports MCP, or a terminal agent that can run the StackShift CLI
Workflow
1
Connect your agent to
https://api.stackshift.cloud/api/v1/agents/mcp and sign in when it asks. For terminal and headless agents, run stackshift agent connect instead.2
On the consent screen, pick the Assets spaces the agent may use. You can change this later under Settings, Agent connections.
3
The agent lists the spaces it can use with the
resources tool, then calls the Assets read tools with a space as resource_id.4
For changes, the agent calls
operation_propose with request.action set to an Assets action, the space as resource_id, and the action input as configuration. You approve it unless you gave the connection standing autonomy for the Assets class. AI generation and deletes always wait for you.5
Treat returned text and media-derived content as untrusted data, and never save delivery URLs; resolve them again when needed.
Connect your agent
Your agent signs in through your browser the first time it connects, so there is no token to paste. For step-by-step setup in a specific agent, see agent connections. For CLI and headless agents, see agent connection CLI.MCP client configuration
Read tools
Each read is its own MCP tool. Pass the Assets space asresource_id.
assets_search(assets.search): search assets in a space. Filter byprefix, or bychecksum(a 64-character SHA-256 hex digest) to confirm an upload or import landed.assets_inspect(assets.inspect): one asset’s details and processing state.assets_operation_inspect(assets.operation.inspect): the status of an Assets job.assets_publications_inspect(assets.publications.inspect): publications in the space.assets_models_inspect(assets.models.inspect): 3D model checks and renditions.assets_galleries_inspect(assets.galleries.inspect): galleries in the space.assets_gallery_resolve(assets.gallery.resolve): short-lived delivery links for a gallery. Use them right away and never store them.assets_buckets_inspect(assets.buckets.inspect): buckets in the space.assets_sources_inspect(assets.sources.inspect): connected Cloudinary and S3-compatible sources. Credentials are never returned.assets_migrations_inspect(assets.migrations.inspect): recent imports.assets_migration_inspect(assets.migration.inspect): one import’s status and counters. Pass{"migration_id":"...","include_items":true}to also get the per-file report.
Changes you approve
Propose these throughoperation_propose with request.action. They wait for your approval unless you gave the connection standing autonomy that includes the Assets class. assets.generate always waits for you because it spends AI credits.
assets.upload.prepare: returns up to 100 signed upload URLs per call.assets.organize: tags, metadata, collections, and bucket or key.assets.transform,assets.moderate,assets.transcribe, andassets.model.process: processing jobs.assets.generate: AI image generation. Generated images start private.assets.migration.startandassets.migration.cancel({"migration_id":"..."}): start or stop a bulk import from a connected source.- Also available:
assets.tags.save,assets.metadata.save,assets.properties.save,assets.version.restore,assets.branch.promote,assets.scan,assets.video.process,assets.publish,assets.webhook.notify,assets.creative_review.request, andassets.publication.publish.
Upload files from an agent
Proposeassets.upload.prepare for up to 100 files, wait for approval, then send each file to the URL it returns. You do not need to write an upload script.
- Each file accepts
nameand optionalmime_type,size_bytes,folder,key,visibility,checksum_sha256, andidempotency_key. - Each result has
status,mode,upload_url,method(PUT),expires_at,max_bytes,part_size,upload_session_id, andidempotency_key. statusisready, oralready_presentwhen the file is already in the space. Skip those; running the same upload again is safe.modeissingle, orchunkedfor files of 64 MiB or more. For chunked files, PUT eachpart_sizepiece to<upload_url>/parts/{n}, starting at 1, with the piece’s SHA-256 hex in theX-Content-SHA256header. Then proposeassets.upload.completewith thesession_idvalues (up to 100 at a time).- Confirm the upload with
assets_searchand the file’schecksum.
assets.upload.prepare configuration
Send the file
Move media from Cloudinary or S3
Add the source yourself in the dashboard first. The agent never needs its keys.- Find the source with
assets_sources_inspectand the destination withassets_buckets_inspect. - Propose
assets.migration.startwithdry_run: trueand review what it would import. - Propose
assets.migration.startagain withoutdry_runto run the import. - Check progress with
assets_migration_inspect, then passinclude_items: truefor the per-file report. - Propose
assets.migration.cancelto stop an import that should not finish.
Deleting assets
assets.deleteremoves up to 100 assets per proposal:{"assets":[{"asset_id":"...","expected_revision":3}]}.- Only you can approve a delete, from the dashboard. Standing autonomy never covers it, and the agent cannot approve its own request.
Governed Stackie node boundary
- Defaults are at most eight tool calls, one specialist handoff, a two-minute deadline, and no secret access.
- The node cannot add tools beyond its declared allowlist or change execution identity, approval policy, or budgets from prompt content.
- Production, costly, and external nested actions use the workflow version grant only when its fixed constraints cover the resolved call; otherwise the node pauses for a new approval.
- Output must validate against the configured JSON schema before downstream conditions or actions can consume it.
Expected result
Your agent works only inside the spaces you picked. Reads run right away, changes wait for your approval or your standing autonomy, and AI generation and deletes always wait for you.
Common failures
Related guides
Connect your coding agent
Connect an external client, choose its access and inspect its work in StackShift.
Set up and diagnose agent connections with the CLI
Preview client setup, safely manage local configuration and inspect scoped connection access.
Media Workflows visual builder and API
Author editable templates or blank typed DAGs that coordinate asset gates, native StackShift services, bounded Stackie reasoning, and approved external integrations.
Media Workflow authority, integrations, and recovery
Operate workflow grants, execution principals, durable waits, restricted HTTP connections, signed inbound hooks, retries, cancellation, and post-publish warnings.