Documentation menu

Documentation

MCP tools

A drive offers up to 12 tools. This reference is generated from the server's own tool list, so names, descriptions and defaults match what your agent receives.

Paths are absolute, such as /r2-media/notes.md. Every tool that changes something records it in the drive's activity under the connection's name. Errors come back as tool results with a stable code, such as PERMISSION_DENIED, NOT_FOUND or PRECONDITION_FAILED, and a message the agent can act on.

drive_lsList folder

Every access levelRead onlySafe to repeat

List a folder. `/` lists the mounts (one per storage location) with what this connection may do in each. Returns names, sizes, modified times and ETags. Use `recursive` for every file below a folder, and `cursor` to page through large folders.

ParameterTypeDefaultNotes
pathstring"/"Absolute folder path, e.g. / or /assets/images.
recursivebooleanfalse
limitinteger200
cursorstringFrom a previous call's nextCursor.

drive_readRead file

Read onlyAdd filesRead and writeFull accessRead onlySafe to repeat

Read a file. Text comes back with line numbers; use `offset` (first line, 1-based) and `limit` (line count) for long files, or byteOffset/byteLength for exact bytes. Images up to 2 MiB come back as images. Other binary files return metadata; use drive_transfer to download them. The result includes the file's ETag for conditional writes.

ParameterTypeDefaultNotes
pathRequiredstring
offsetintegerFirst line to return (1-based).
limitinteger2000Number of lines to return.
byteOffsetinteger
byteLengthinteger
Read onlyAdd filesRead and writeFull accessRead onlySafe to repeat

Find files by name and/or search inside them. `name` is a glob on the file name (e.g. `*.md`, `report-??.csv`); `content` is a regular expression matched line by line in text files. Results are bounded; narrow `path` for large drives.

ParameterTypeDefaultNotes
pathstring"/"
namestring
contentstring
ignoreCasebooleanfalse
type"file" | "directory"
modifiedAfterstringISO date-time.
limitinteger100

drive_writeWrite file

Drop boxAdd filesRead and writeFull accessCan delete or replaceSafe to repeat

Create or replace a file. Pass `ifMatch` with the ETag from drive_read to replace only the version you read (if someone changed it since, the write is refused); pass `createOnly` to never replace an existing file. Use `encoding: base64` for binary. For files over a few MB, use drive_transfer upload links instead.

ParameterTypeDefaultNotes
pathRequiredstring
contentRequiredstring
encoding"utf8" | "base64""utf8"
ifMatchstring
createOnlybooleanfalse
contentTypestring

drive_editEdit file

Read and writeFull accessCan delete or replace

Replace exact text in a text file. Each `oldText` must match exactly once (include surrounding lines to make it unique) unless `replaceAll` is set. The edit applies only to the version it read, so concurrent changes are never lost; pass `ifMatch` to require a specific ETag.

ParameterTypeDefaultNotes
pathRequiredstring
editsRequired{ oldText, newText, replaceAll }[]
ifMatchstring

drive_filesCopy, move, delete

Drop boxAdd filesRead and writeFull accessCan delete or replace

Copy, move or delete files and folders, or make a folder, across any mounts, like cp/mv/rm/mkdir. Copies between locations on the same storage account happen server-side; across providers they stream directly between them. A destination ending in `/` or an existing folder receives the item inside it. Folders need `recursive`. Mount points themselves cannot be deleted. Big trees continue as a background job.

ParameterTypeDefaultNotes
actionRequired"copy" | "move" | "delete" | "mkdir"
pathRequiredstring
tostringDestination for copy and move.
recursivebooleanfalse
overwritebooleantrueReplace existing files at the destination (copy/move).

drive_transferTransfer links

Every access level

Move bytes without passing them through this conversation. `download` returns a time-limited GET link for a file; `upload` returns a PUT link that accepts one upload (create-only connections get links that cannot replace files); `multipart` starts a large upload (one PUT link per part, then call `complete` with each part's ETag header). Fetch the links with curl or any HTTP client in your environment.

ParameterTypeDefaultNotes
actionRequired"download" | "upload" | "multipart" | "complete" | "abort"
pathRequiredstring
expiresIninteger900Link lifetime in seconds (capped by the drive's policy).
filenamestringDownload file name.
inlinebooleanfalseServe the download inline instead of as an attachment.
sizeintegerTotal bytes, for multipart.
partSizeinteger
uploadIdstring
parts{ partNumber, etag }[]

drive_shShell

Every access levelDrive shell settingCan delete or replace

Run bash over this drive. Each mount is a top-level folder, so `cp -r /aws-bucket/folder /r2-bucket/somefolder` copies across providers. Supports pipes, redirection, globbing, loops and common tools: ls, cat, head, tail, grep, rg, find, sed, awk, jq, sort, uniq, wc, cut, tr, xargs, diff, gzip, base64, sha256sum and more. Drive commands: `mounts`, `url PATH` (download link), `upload-url PATH`, `info PATH`. /tmp is scratch for this command only. No network access and no programs beyond these. Writes are saved when the command finishes.

ParameterTypeDefaultNotes
commandRequiredstring
cwdstringWorking directory (default /).

drive_codeRun code

Every access levelDrive Code Mode settingCan delete or replace

Run an async JavaScript function next to the data, for multi-step work: loops, filtering, transforming files, bulk edits, decisions based on earlier results. It runs isolated with no network; the only capability is this drive API (also available as bare globals like ls(), cat(), cp(), write(), sh()). Return a JSON-serializable value (at most 64,000 characters); console.log output is returned too. Up to 45 seconds and 1,000 drive calls per run. Copies, moves and deletes that need longer continue as background jobs (see drive_jobs).

The full API it can call is on the Code Mode page.

ParameterTypeDefaultNotes
codeRequiredstring

drive_jobsBackground jobs

Every access levelSafe to repeat

List background jobs (large copies, moves and deletes that continue after a tool call returns), check one by `id`, or cancel it.

ParameterTypeDefaultNotes
idstring
cancelbooleanfalse

drive_activityRecent activity

Every access levelRead onlySafe to repeat

Recent changes in this drive: who wrote, copied, moved or deleted what, and when. Use it to pick up where another agent or person left off. Filter by `path` prefix.

ParameterTypeDefaultNotes
pathstring
limitinteger30
sincestringISO date-time.

drive_manageManage drive

Every access levelManagement allowedCan delete or replace

Configure this drive (allowed because the owner granted management). Actions: `list_storage` (saved storage connections); `request_storage` (create a one-time link where a person, or you with curl and environment variables, enters an access key and secret for a new S3-compatible bucket; the secret never passes through this conversation; give name, provider, bucket and optionally prefix, region/accountId/endpoint, path and access); `add_mount` (mount a bucket folder from an existing connection at a path); `remove_mount` (by path); `set_description` (the instructions agents see). Providers: r2, aws, minio, b2, wasabi, gcs, spaces, tigris, hetzner, scaleway, linode, vultr, supabase, storj, oracle, custom. Access presets: read-only, contribute, read-write, full, drop-box.

ParameterTypeDefaultNotes
actionRequired"list_storage" | "request_storage" | "add_mount" | "remove_mount" | "set_description"
namestring
provider"r2" | "aws" | "minio" | "b2" | "wasabi" | "gcs" | "spaces" | "tigris" | "hetzner" | "scaleway" | "linode" | "vultr" | "supabase" | "storj" | "oracle" | "custom"
accountIdstring
regionstring
endpointstring
connectionIdstring
bucketstring
prefixstring
pathstring
access"read-only" | "contribute" | "read-write" | "full" | "drop-box"
descriptionstring

Protocol

Each drive is a Streamable HTTP endpoint at /mcp/<drive id> that answers without a session, so any request can reach any server instance. Clients on the 2026-07-28 protocol and earlier 2025 clients are both supported. Requests carry a bearer token from the OAuth flow or an access key; an unauthenticated request gets a 401 with a WWW-Authenticate header that points to the drive's protected resource metadata.