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
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.
| Parameter | Type | Default | Notes |
|---|---|---|---|
path | string | "/" | Absolute folder path, e.g. / or /assets/images. |
recursive | boolean | false | |
limit | integer | 200 | |
cursor | string | From a previous call's nextCursor. |
drive_readRead file
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.
| Parameter | Type | Default | Notes |
|---|---|---|---|
pathRequired | string | ||
offset | integer | First line to return (1-based). | |
limit | integer | 2000 | Number of lines to return. |
byteOffset | integer | ||
byteLength | integer |
drive_searchSearch files
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.
| Parameter | Type | Default | Notes |
|---|---|---|---|
path | string | "/" | |
name | string | ||
content | string | ||
ignoreCase | boolean | false | |
type | "file" | "directory" | ||
modifiedAfter | string | ISO date-time. | |
limit | integer | 100 |
drive_writeWrite file
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.
| Parameter | Type | Default | Notes |
|---|---|---|---|
pathRequired | string | ||
contentRequired | string | ||
encoding | "utf8" | "base64" | "utf8" | |
ifMatch | string | ||
createOnly | boolean | false | |
contentType | string |
drive_editEdit file
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.
| Parameter | Type | Default | Notes |
|---|---|---|---|
pathRequired | string | ||
editsRequired | { oldText, newText, replaceAll }[] | ||
ifMatch | string |
drive_filesCopy, move, delete
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.
| Parameter | Type | Default | Notes |
|---|---|---|---|
actionRequired | "copy" | "move" | "delete" | "mkdir" | ||
pathRequired | string | ||
to | string | Destination for copy and move. | |
recursive | boolean | false | |
overwrite | boolean | true | Replace existing files at the destination (copy/move). |
drive_transferTransfer links
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.
| Parameter | Type | Default | Notes |
|---|---|---|---|
actionRequired | "download" | "upload" | "multipart" | "complete" | "abort" | ||
pathRequired | string | ||
expiresIn | integer | 900 | Link lifetime in seconds (capped by the drive's policy). |
filename | string | Download file name. | |
inline | boolean | false | Serve the download inline instead of as an attachment. |
size | integer | Total bytes, for multipart. | |
partSize | integer | ||
uploadId | string | ||
parts | { partNumber, etag }[] |
drive_shShell
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.
| Parameter | Type | Default | Notes |
|---|---|---|---|
commandRequired | string | ||
cwd | string | Working directory (default /). |
drive_codeRun code
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.
| Parameter | Type | Default | Notes |
|---|---|---|---|
codeRequired | string |
drive_jobsBackground jobs
List background jobs (large copies, moves and deletes that continue after a tool call returns), check one by `id`, or cancel it.
| Parameter | Type | Default | Notes |
|---|---|---|---|
id | string | ||
cancel | boolean | false |
drive_activityRecent activity
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.
| Parameter | Type | Default | Notes |
|---|---|---|---|
path | string | ||
limit | integer | 30 | |
since | string | ISO date-time. |
drive_manageManage drive
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.
| Parameter | Type | Default | Notes |
|---|---|---|---|
actionRequired | "list_storage" | "request_storage" | "add_mount" | "remove_mount" | "set_description" | ||
name | string | ||
provider | "r2" | "aws" | "minio" | "b2" | "wasabi" | "gcs" | "spaces" | "tigris" | "hetzner" | "scaleway" | "linode" | "vultr" | "supabase" | "storj" | "oracle" | "custom" | ||
accountId | string | ||
region | string | ||
endpoint | string | ||
connectionId | string | ||
bucket | string | ||
prefix | string | ||
path | string | ||
access | "read-only" | "contribute" | "read-write" | "full" | "drop-box" | ||
description | string |
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.