Introducing Remote Filesystems for Mastra Workspaces

Your agents can now work with remote filesystems like S3, GCS, and Azure.

Paul ScanlonPaul Scanlon·

Apr 29, 2026

·

2 min read

Instead of relying only on local storage, your agents can now work directly with remote filesystems. Attach a provider to your agent's workspace and it can read, write, and manage remote files.

Mastra currently supports the following remote filesystems: S3, GCS, Azure Blob, and AgentFS, with Google Drive support in progress: #15756.

Remote filesystems work alongside workspace sandboxes, which give agents the ability to run scripts, install packages, and safely execute commands.

Get started

Install a remote filesystem provider:

npm install @mastra/s3
note

Requires @mastra/core@1.12.0 or later, added in PR #12605.

Create a workspace instance, configure a filesystem and assign it to an agent. This example uses S3Filesystem.

import { Agent } from "@mastra/core/agent";
import { Workspace } from "@mastra/core/workspace";
import { S3Filesystem } from "@mastra/s3";
 
const workspace = new Workspace({
  filesystem: new S3Filesystem({
    bucket: "mastra-agent-files",
    region: "us-east-1",
    accessKeyId: process.env.AWS_ACCESS_KEY_ID,
    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
  })
});
 
const fileAgent = new Agent({
  id: "file-agent",
  name: "File Agent",
  model: "anthropic/claude-opus-4-6",
  instructions: "You are a file management agent. Use the filesystem to read and write files.",
  workspace
});

Once configured, the agent can read and write files:

await agent.stream(`Read hn-weekly-report-2026-04-29.md.
Write a concise summary to hn-weekly-summary-2026-04-29.md.
List the files in the bucket.`);

For more information and full configuration options, see:

To see remote filesystems in action, watch the walkthrough below. At 07:50, Alex demonstrates mounting a remote filesystem into a sandbox.

Also, Shane demos the Google Drive provider (in progress) at 49:02 in this workshop.

Share:
Paul Scanlon
Paul ScanlonTechnical Product Marketing Manager

Paul Scanlon sits between Developer Education and Product Marketing at Mastra. Previously, he was a Technical Product Marketing Manager at Neon and worked in Developer Relations at Gatsby, where he created educational content and developer experiences.

All articles by Paul Scanlon