Drive MCP Tools Overview for AI Agents
Overview of the 42 TrekMail Drive MCP tools for AI agents — uploads, share links, bulk operations, safe delete, and Drive Add-on read access.
Article details
Type, difficulty, plans, and last updated info.
▼
Article details
Type, difficulty, plans, and last updated info.
- Type
- Reference
- Difficulty
- Intermediate
- Plans
- Starter · Pro · Agency · + Drive Add-on
- Last updated
- Sep 10, 2026
The TrekMail MCP server exposes TrekMail to AI agents as structured tools for file storage, public links, safe cleanup, and sync-device passwords. A connection sees only the tools allowed by its credentials, selected toolsets, transport, and safety gates. Check the tool list exposed to the agent rather than relying on a fixed catalog count.
MCP is usually easier than raw REST for agents. Instead of asking an agent to build HTTP requests, you give it tools such as drive_file_upload, drive_share_create, or drive_bulk_move. The API still enforces token scopes, idempotency, audit logging, and safety gates behind the scenes.
Tool coverage
| Tool group | Tools | What agents can do |
|---|---|---|
| Spaces and usage | drive_spaces_list, drive_storage_summary, drive_space_usage |
Discover Account Drive, allowed mailbox spaces, and quota status |
| Browse and select | drive_browse_folder, drive_folder_tree, drive_select_all_ids |
Navigate folders and prepare bulk operations safely |
| Files | drive_file_get, drive_file_download_url, drive_file_rename, drive_file_move, drive_file_trash, drive_file_restore, drive_file_purge |
Read metadata, download, rename, move, trash, restore, or permanently purge a file |
| Folders | drive_folder_create, drive_folder_update, drive_folder_move, drive_folder_trash, drive_folder_restore, drive_folder_purge |
Create and manage folder trees |
| Team sharing | drive_folder_share_with_account, drive_folder_stop_sharing |
Make a top-level folder visible to all mailboxes, or stop account-wide visibility |
| Trash | drive_trash_list, drive_trash_empty |
Review trash or permanently clear it when the destructive gate is enabled |
| Bulk operations | drive_bulk_trash, drive_bulk_restore, drive_bulk_move, drive_bulk_purge |
Move, trash, restore, or purge up to 5,000 selected items |
| Public links | drive_share_create, drive_share_list, drive_share_revoke |
Create expiring/capped download links and revoke them later |
| Uploads | drive_file_upload, drive_upload_initiate, drive_upload_complete, drive_upload_refresh_parts, drive_upload_abort |
Upload local files with a simple wrapper, or drive the multipart flow manually |
| Add-on status | drive_addon_get, drive_addon_pricing, drive_addon_cancellation_preview |
Read storage add-on state and pricing without changing billing |
| Sync devices | drive_device_list, drive_device_create, drive_device_revoke, drive_device_rotate |
Create, review, revoke, or rotate a separate password for a WebDAV sync app |
Token requirements
Drive MCP tools use the ops token environment variable:
TREKMAIL_API_TOKEN=tm_live_your_token
The token must include matching Drive scopes. For example, drive_share_create requires a share scope for the file's Drive space. drive_file_purge requires a purge scope and the destructive tools gate. Sync-device tools need drive:devices:read or drive:devices:write; the created device password is shown only once. Their responses include the correct server_url, including a branded DAV address only after its certificate and restricted host are ready.
You can run Drive tools alongside message tools by also providing TREKMAIL_MESSAGE_TOKEN. The two token families remain separate.
Safety gates
On a self-hosted stdio MCP server, its local administrator can require TREKMAIL_ALLOW_DESTRUCTIVE=true before permanent purge and empty-trash tools run. This is a local safety control, not a TrekMail product feature switch. Normal trash operations are still mutating, so they require write scopes, but they are recoverable and do not require purge scopes.
Sending email and migration write operations have separate gates. Turning on Drive destructive tools does not automatically enable sending or migration writes.
Uploads through MCP
For most workflows, use drive_file_upload. It reads a local file from the MCP host, requests upload instructions, sends the file to the returned upload URL, completes the upload, and aborts the reservation if something fails.
Low-level tools remain available when an integration needs more control, for example when file bytes are coming from another service or a custom transfer process.
Share links through MCP
Use drive_share_create to create a public download URL. Set expires_at and max_downloads whenever the link leaves your organization. Use drive_share_revoke when a link should stop working. The raw token is shown only on creation, so agents should return the full public URL immediately.
Billing boundary
The add-on tools are read-only: drive_addon_get, drive_addon_pricing, and drive_addon_cancellation_preview. Agents cannot buy, resize, or cancel the Drive Add-on through MCP. Those actions remain dashboard-only and user-controlled.
Related articles
Jump to nearby guides that continue the workflow.