Mastra Workspace Development
Comprehensive guide for Mastra workspaces. Covers filesystem providers (LocalFilesystem, S3Filesystem, GCSFilesystem), sandbox execution (LocalSandbox, E2BSandbox), mounts for multi-provider composition, skills system (Agent Skills spec), BM25/vector/hybrid search, tool configuration with WORKSPACE_TOOLS, and containment security.
Usage
/mastra-workspace
Provides context for:
Workspaceclass from@mastra/core/workspacefilesystemvsmounts(mutually exclusive)LocalFilesystem({ basePath, contained, readOnly, allowedPaths })LocalSandbox({ workingDirectory })andE2BSandbox({ id })WORKSPACE_TOOLSfor per-tool config (enabled, requireApproval, requireReadBeforeWrite)- Skills with SKILL.md (Agent Skills spec)
- Search:
workspace.search(),workspace.index(), BM25/vector/hybrid - Global workspace via
Mastra({ workspace })or agent-scoped