dropbox-mcp
dropbox-mcp
LLM エージェントに Dropbox アカウント(個人用、または Business/Team)への読み書きアクセスを Dropbox API v2 経由で提供する Model Context Protocol サーバーです。
問題
Dropbox 純正のデスクトップクライアントは、ファイルの同期を解決します。しかし、AI エージェントに、ローカルコピーを持たないアカウントへの制御されたアクセスを提供するものではありません。同期済みフォルダしか見えないエージェントは、2 TB のチームアーカイブを検索できず、共有リンクを作成できず、渡されていないファイルを読むこともできません。
このサーバーはそのギャップを埋めます。Dropbox HTTP API に直接通信するため、1 バイトもディスクに同期せずにアカウント全体を扱えます。さらに、そのアクセスは生の HTTP クライアントではなく、固定の MCP ツール群として公開されます。エージェントが取得するのは fetch ではなく dropbox_search です。
Related MCP server: Dropbox MCP Server
アーキテクチャ
files、search、sharing、account の 4 つのツールモジュールが、stdio 上で MCP を話す単一の McpServer に自身を登録します。すべてのモジュールは、Dropbox API が面倒にしている 2 つの要素、つまり OAuth トークンのライフサイクルと team-space 名前空間を管理する 1 つの HTTP クライアントを経由します。モジュールは起動時に DROPBOX_DISABLED_MODULES で個別に無効化できるため、公開共有リンクを作るべきでないデプロイ構成では、そのモジュールは「推奨されない」だけでなく、そもそも登録されません。
MCP host (Claude, etc.)
| stdio (JSON-RPC)
+-------v--------------------------------------+
| index.ts module registry / stdio transport|
+-------+--------------------------------------+
|
+-------v-------+ +--------+ +---------+ +---------+
| tools/files | | search | | sharing | | account |
+-------+-------+ +---+----+ +----+----+ +----+----+
| | | |
+------+------+-----------+-----------+
|
+--------v-----------------------------------+
| client.ts |
| - refresh-token -> access-token cache |
| - 401 retry with a forced refresh |
| - Dropbox-API-Path-Root resolution |
| - ASCII-safe Dropbox-API-Arg encoding |
+--------+-----------------------------------+
|
RPC api.dropboxapi.com Content content.dropboxapi.comエンドポイントは 2 つのグループに分け、意図的に別々の関数として維持しています。RPC エンドポイントは JSON 入力/JSON 出力である一方、Content エンドポイントは引数を HTTP ヘッダに入れ、ボディをファイルのバイト列に使います。これらを 1 つの汎用 request() にまとめると、引数の格納先が暗黙に変わるパラメータになってしまうため、分離したままにしています。
実際に難しい部分
Dropbox Business/Team では、API はデフォルトでメンバーのホーム名前空間を参照します。実際の共有作業が置かれているチームフォルダはすべて、チームのルート名前空間側にあり、単に見えません。"" に対して list_folder を呼ぶと、メンバーのプライベートファイルだけが返り、エラーも、アカウントの大半が欠けているという手がかりもありません。権限の問題に見えますが、実際には権限の問題ではありません。
対策は、チームのルート名前空間を指す Dropbox-API-Path-Root ヘッダーを送ることです。そのルート名前空間の ID は users/get_current_account から取得できます。ここに再帰の罠があります。汎用 RPC ヘルパーはすべての呼び出しに path-root ヘッダーを付けるため、そのヘルパー自身が get_current_account を経由して名前空間を解決しようとすると、ヘッダー解決が自分自身を永遠に呼び続けることになります。そこで resolveRootNamespaceId() は、ヘルパーを迂回した意図的に素の fetch を発行し、結果をメモ化することで、余計な往復がプロセスごとに 1 回で済むようにしています(src/client.ts)。
同じ類のバグの小さな版もあります。Content エンドポイントは引数を Dropbox-API-Arg に渡しますが、HTTP ヘッダーは ASCII です。ファイル名にアクセント記号や絵文字が含まれると、API エラーを返すのではなく、fetch 内部で例外を投げます。apiArg() はヘッダーを構築する前に、非 ASCII のコードポイントをすべて \uXXXX へエスケープします。
やり直すなら変えたい点
テストなし。 実際のアカウントを相手に手作業で構築・検証しました。トークンリフレッシュの経路、401 リトライ、チャンク分割アップロードの境界条件こそ、モックしたトランスポートを使うテストで駆動すべきコードです。これらはまれにしか失敗せず、失敗すると講償コストが高いからです。
path-root キャッシュはプロセスローカルで、無効化されない。 ホストが自由に再起動してくれる stdio サーバーでは十分ですが、ユーザーがチーム間を移動し得る長期間動くプロセスには適していません。
dropbox_deleteが確認の仕組みなしで公開されている。 Dropbox 自身の保持機能によって復旧できますが、破壊的なツールはホストに確認してもらうのに頼るどではなく、その旨をスキーマで示すべきです。エラーが文字列に整形されている。 メッセージとあわせて構造化されたエラーコードを返せば、エージェントは文面を解析しなくても
"rate limited"と"not found"を分岐できます。
セットアップ
Node.js 20+(開発時は 24)と Dropbox アカウントが必要です。
1. Dropbox アプリを作成する
Create app を選択 https://www.dropbox.com/developers/apps から。
Scoped access と Full Dropbox アクセスを選択します。
Permissions で
account_info.read、files.metadata.read、files.metadata.write、files.content.read、files.content.write、sharing.read、sharing.writeを有効にしてから、Submit を押します。Settings で App key と App secret をコピーします。
2. ビルドして認証する
git clone <this-repo>
cd dropbox-mcp
npm install
npm run build
cp .env.example .env # fill in DROPBOX_APP_KEY and DROPBOX_APP_SECRET
npm run auth # prints DROPBOX_REFRESH_TOKEN — paste it into .envnpm run auth は認証 URL を表示し、貼り付けられたコードを受け取って、それをリフレッシュトークンと交換します。その後はサーバー自身がそのリフレッシュトークンを短命のアクセストークンと交換するようになります。
3. MCP ホストに登録する
{
"mcpServers": {
"dropbox": {
"command": "node",
"args": ["/absolute/path/to/dropbox-mcp/dist/index.js"],
"env": {
"DROPBOX_APP_KEY": "your-app-key",
"DROPBOX_APP_SECRET": "your-app-secret",
"DROPBOX_REFRESH_TOKEN": "your-refresh-token"
}
}
}
}ホストを再起動して、「私の Dropbox の使用量は?」のように質問してみてください。
ホストなしでサーバーを試す場合は次のとおりです:
npm run inspect # @modelcontextprotocol/inspectorツール
files — dropbox_list_folder、dropbox_get_metadata、dropbox_create_folder、dropbox_move、dropbox_copy、dropbox_delete、dropbox_get_temporary_link、dropbox_read_file、dropbox_upload(アップロードセッションで大きなファイルを自動的にチャンク分割)。
search — ファイル名と内容を対象に、アカウント全体またはフォルダ範囲で dropbox_search。
sharing — dropbox_create_shared_link、dropbox_list_shared_links、dropbox_get_shared_link_metadata、dropbox_revoke_shared_link。
account — dropbox_get_current_account、dropbox_get_space_usage。
設定
設定はすべて環境変数で行います。名前空間のスコープ制御(DROPBOX_PATH_ROOT)、読み取りサイズの上限(DROPBOX_MAX_READ_BYTES)、アップロードのチャンクサイズ、team-app の代理ヘッダーを含む注釈付きの完全な一覧については .env.example を参照してください。
ライセンス
MIT — LICENSE を参照してください。
Available Tools
16 toolsdropbox_copyCopyB
Copy a file or folder to a new path.
Inputs: to_path (required), from_path (required), autorename.
dropbox_create_folderCreate folderB
Create a folder at the given path.
Inputs: path (required), autorename.
dropbox_deleteDeleteADestructive
Delete a file or folder (and its contents). Destructive — the item moves to deleted state and can be restored from Dropbox for the retention window.
Inputs: path (required).
dropbox_get_current_accountGet current accountARead-only
Return the authenticated account (name, email, account id, team). Good for confirming the server is connected to the right Dropbox.
Inputs: no named parameters.
dropbox_get_metadataGet metadataARead-only
Get metadata (size, modified time, id, etc.) for a single file or folder.
Inputs: path (required), include_deleted.
dropbox_get_space_usageGet space usageARead-only
Return storage usage and allocation for the account.
Inputs: no named parameters.
dropbox_get_temporary_linkGet temporary linkARead-only
Get a direct, time-limited (~4h) download/streaming URL for a file. Use this to reference or fetch file contents without creating a permanent shared link.
Inputs: path (required).
dropbox_list_folderList folderARead-only
List the contents of a folder. Pass "" for the root. Set recursive=true to walk subfolders. If the result is truncated, call again with the returned cursor.
Inputs: path, limit, cursor, recursive.
dropbox_moveMove / renameA
Move or rename a file or folder from one path to another.
Inputs: to_path (required), from_path (required), autorename.
dropbox_read_fileRead file (text)ARead-only
Download a file and return its contents as UTF-8 text — for referencing docs, notes, code, csv, etc. Guarded by DROPBOX_MAX_READ_BYTES (default 5 MB). For large or binary files use dropbox_get_temporary_link instead.
Inputs: path (required).
dropbox_searchSearch filesARead-only
Search the account for files and folders matching a query (filename and, where indexed, content). Optionally scope to a folder. If the result has_more, call again with the returned cursor.
Inputs: query (required), path, cursor, file_status, +2 more.
dropbox_uploadUpload fileA
Upload content to a path. Provide either text (inline UTF-8) or localPath (a file on this machine to read). Files at/under ~140 MB go in a single request; larger local files are streamed in chunks via an upload session automatically.
Inputs: path (required), mode, text, localPath, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool has a clear, non-overlapping purpose: folder operations (list, get metadata, create), file operations (move, copy, delete, upload, read, temporary link), search, shared link management (create, list, metadata, revoke), and account/space info. Even get_temporary_link vs read_file are distinct (URL vs content).
All tools follow a consistent verb_noun pattern prefixed with 'dropbox_' (e.g., list_folder, get_metadata, create_shared_link). The verbs (list, get, create, move, copy, delete, read, upload, search, revoke) and nouns are uniform and predictable.
16 tools is slightly above the ideal 3-15 range but appropriate given the comprehensive scope of Dropbox's API (folder, file, search, shared links, account). Each tool earns its place, and none seem redundant.
The surface covers core lifecycle operations for files and folders (create, read, update via upload/overwrite, delete, move/copy), search, and shared link management. Minor omissions like file version history or listing deleted items are acceptable gaps that agents can work around.
Maintenance
Related MCP Connectors
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
Your company's tools, memory and Automations for ChatGPT, Claude or any MCP agent. Open source.
Related MCP Servers
- FlicenseBqualityDmaintenanceProvides read access to Dropbox files with advanced search and content extraction capabilities. Supports browsing, reading, and searching within various file types including PDFs, DOCX, and text files.5-
- FlicenseAqualityNot gradedmaintenanceA local MCP server that enables Claude to manage Dropbox accounts through tools for file manipulation, searching, and sharing. It supports operations such as listing folders, moving files, creating shared links, and monitoring storage usage via natural language commands.10-
- AlicenseNot gradedqualityBmaintenanceEnables Dropbox file operations such as listing, searching, downloading, and creating folders via the Dropbox API v2 through MCP.77 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to manage Box files, folders, collaborations, and more via the Box API using tools for search, upload, and metadata operations.ISC