Skip to main content
App mounts let your agent or backend work with Mesa repositories without needing cloning, FUSE, or a sandbox. MesaFS app mount is available in both the TypeScript and Python SDKs. There are two main ways of interacting the with app mount:
  • Basic Filesystem API: call methods like readFile and writeFile to directly access files
  • Emulated Bash: Execute shell commands using tools like ls, cp, grep. Runs against your Mesa repositories, entirely in-process.
Both read and write operations are supported.
MesaFS can be run as either a POSIX mount or app mount. If you aren’t sure which to use, see Filesystem for an overview and comparison.

Quick Start

Prerequisites

  • A Mesa account. If you haven’t signed up yet, you can do so here.
  • An API key with admin scope. You can create one at https://app.mesa.dev/<your-org>/tokens.
  • A repository to access. You can create one at https://app.mesa.dev/<your-org>/repositories.
Running in Docker with a slim base image? See Docker for required system packages.

Install the SDK

Create a Mesa Filesystem

Initialize a Mesa client and a filesystem handle scoped to the repos you want to access. You can create as many filesystem handles as you need.

Run Bash commands or directly read/write files

Managing Changes and Bookmarks

Beyond file operations, the Mesa filesystem exposes APIs to create/switch changes and manage bookmarks (analogous to branches in git) directly from TypeScript.
fs.change.new(...) always creates a new change. fs.change.edit(...) never creates a new change, it only switches to an existing one.

How It Works

Mesa’s app mount mode uses the same core read, write, caching, and version control logic as the POSIX mount — just running in-process. To provide an emulated bash shell, Mesa uses just-bash (TypeScript) or Bashkit (Python) with MesaFS as the backing filesystem.

Integrating with Agents

Mesa’s app mount is designed to be used with any agent framework. By providing the app mount’s bash function as a tool, you can easily bring MesaFS into an agent’s workflow. For end-to-end examples, see the Mesa examples repo.

Vercel AI SDK

To define a tool in the Vercel AI SDK, you can use the tool function.

Langchain

To define a tool in Langchain, you can use the tool function.

Mastra

To define a tool in Mastra, you can use the createTool function.

Configuring the Shell

The .bash() method accepts options to configure the shell environment. Mesa’s Bash implementation is is a thin wrapper over the underlying just-bash library, so all of the exposed options are pure passthrough to the underlying just-bash Bash instance. We omit some options that are not relevant to a typical Mesa bash() setup. For more details, you can refer to the just-bash documentation.
Options like fs and files from BashOptions are intentionally omitted — the filesystem is always the MesaFileSystem instance, and files are populated from your Mesa repositories.
If you need to use advanced just-bash features such as overlay filesystems, you should separately install the just-bash package and use the MesaFileSystem instance directly to construct a Bash instance.
For convenience, here is a summary of the options exposed by Mesa’s Bash instance.

cwd (Current Working Directory)

The cwd option sets the starting directory for the shell. The default is /home/user, and Mesa mounts your repos at /<org>/<repo>. In most cases, you will want to set cwd to either /<org>/<repo> or, for multi-repo filesystems, /<org>.

env (Environment Variables)

The env option sets the environment variables available to commands. For compatibility, the defaults simulate a typical Linux/GNU environment, ex. PATH, HOME, PWD, and OLDPWD.

executionLimits (Resource Limits)

The executionLimits option sets iteration limits for commands, which protects against infinite loops and deep recursion. All of these limits are optional and have reasonable defaults. You can override them to suit your needs.

fetch (Custom Fetch)

The fetch option allows you to use a custom fetch implementation for network access. This is useful if you want to use a different HTTP client or proxy.

network (Network Access)

Network access is disabled by default. You can enable it with the network option.

python (Python Runtime)

Python (CPython compiled to WASM) is opt-in due to additional security surface. Enable with python: true:

javascript (JavaScript Runtime)

JavaScript and TypeScript execution via QuickJS is opt-in due to additional security surface. Enable with javascript: true:

commands (Built-in Commands)

The commands option allows you restrict the built-in commands that are available. This is useful if you want to limit what your agents can do. By default, all 90+ built-in commands are enabled.

customCommands (User-Defined Commands)

The customCommands option allows you to provide your own custom commands to the shell.

logger (Logging Hooks)

The logger option allows you to hook into the internal logging of the shell. This is useful if you want to trace the execution of commands for debugging or monitoring.

Available options

Direct Filesystem Operations

You can also use the Mesa filesystem directly without going through bash. The filesystem implements the full just-bash IFileSystem interface:
The filesystem supports symlinks, permissions (chmod), timestamps (utimes), and recursive directory operations. Hard links are not supported and will return ENOTSUP.

Caching

For better performance on repeated reads, configure a disk cache:

Limitations

  • By default, just-bash does not support installing dependencies (ex. running npm install) or executing arbitrary code (although you can enable Python and JavaScript execution via the python and javascript options).
  • Mesa just-bash is not currently supported in the browser or browser-like runtimes like Cloudflare Workers or Vercel Edge Functions. NOTE: this limitation is due to the use of NAPI — we will likely support a browser-runtime version in the future via a WASM build.
  • Bun support is experimental and may not work in all cases. This is due to Bun’s incomplete support for NAPI.