Skip to main content

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 as resource_id.
  • assets_search (assets.search): search assets in a space. Filter by prefix, or by checksum (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 through operation_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, and assets.model.process: processing jobs.
  • assets.generate: AI image generation. Generated images start private.
  • assets.migration.start and assets.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, and assets.publication.publish.

Upload files from an agent

Propose assets.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 name and optional mime_type, size_bytes, folder, key, visibility, checksum_sha256, and idempotency_key.
  • Each result has status, mode, upload_url, method (PUT), expires_at, max_bytes, part_size, upload_session_id, and idempotency_key.
  • status is ready, or already_present when the file is already in the space. Skip those; running the same upload again is safe.
  • mode is single, or chunked for files of 64 MiB or more. For chunked files, PUT each part_size piece to <upload_url>/parts/{n}, starting at 1, with the piece’s SHA-256 hex in the X-Content-SHA256 header. Then propose assets.upload.complete with the session_id values (up to 100 at a time).
  • Confirm the upload with assets_search and the file’s checksum.
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_inspect and the destination with assets_buckets_inspect.
  • Propose assets.migration.start with dry_run: true and review what it would import.
  • Propose assets.migration.start again without dry_run to run the import.
  • Check progress with assets_migration_inspect, then pass include_items: true for the per-file report.
  • Propose assets.migration.cancel to stop an import that should not finish.

Deleting assets

  • assets.delete removes 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

  • The agent cannot see a space because it was not picked at consent. Add it from Agent connections; existing connections do not gain spaces on their own.
  • An agent tries to configure a separate Assets MCP or a personal access token. There is only one agent MCP, at /api/v1/agents/mcp.
  • An upload URL expired before the agent sent the file. Prepare the upload again; each URL is short-lived.
  • An agent asks you for Cloudinary or S3 keys. Never paste source secrets into an agent. Add the source yourself in the dashboard; the agent only sees its name and ID.

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.