Dropbox MCP Server

Dropbox MCP Server

MCP Server for Dropbox. Contribute to amgadabdelhafez/dbx-mcp-server development by creating an account on GitHub.

文件系统
云存储
TypeScript
访问服务器

README

A Model Context Protocol (MCP) server that provides integration with Dropbox, allowing MCP-compatible clients to interact with Dropbox through a set of powerful tools.

Important Disclaimer: This project is not affiliated with, endorsed by, or sponsored by Dropbox. It is an independent integration that works with Dropbox's public API.

Table of Contents

Quick Start

  1. Clone the repository
  2. Run npm install to install dependencies
  3. Run npm run build to build the project
  4. Register a Dropbox app at Dropbox App Console:
    • Choose "Scoped access" API
    • Choose the access type your app needs
    • Name your app and click "Create app"
    • Under "Permissions", select the required permissions:
      • files.metadata.read
      • files.content.read
      • files.content.write
      • sharing.write
      • account_info.read
    • Add http://localhost:3000/callback as your redirect URI
    • Note your App key and App secret
  5. Run the setup script:
  6. Configure your MCP client to use the server

Installation

  1. Clone the repository

    git clone https://github.com/your-username/dbx-mcp-server.git cd dbx-mcp-server

  2. Install dependencies and build

    npm install npm run build

  3. Run the setup script

  4. Add to MCP settings

    Add the following to your MCP settings file:

    { "mcpServers": { "dbx": { "command": "node", "args": ["/path/to/dbx-mcp-server/build/index.js"] } } }

Authentication

The server uses OAuth 2.0 with PKCE for secure authentication with Dropbox.

Environment Variables

Required:

  • DROPBOX_APP_KEY: Your Dropbox app's key
  • DROPBOX_APP_SECRET: Your Dropbox app's secret
  • DROPBOX_REDIRECT_URI: OAuth redirect URI
  • TOKEN_ENCRYPTION_KEY: 32+ character key for token encryption

Optional:

  • TOKEN_REFRESH_THRESHOLD_MINUTES: Minutes before expiration to refresh token (default: 5)
  • MAX_TOKEN_REFRESH_RETRIES: Maximum number of refresh attempts (default: 3)
  • TOKEN_REFRESH_RETRY_DELAY_MS: Delay between refresh attempts in ms (default: 1000)

Available Tools

File Operations

  • list_files: List files in a directory
  • upload_file: Upload a file
  • download_file: Download a file
  • safe_delete_item: Safely delete with recycle bin support
  • create_folder: Create a new folder
  • copy_item: Copy a file or folder
  • move_item: Move or rename a file/folder

Metadata and Search

  • get_file_metadata: Get file/folder metadata
  • search_file_db: Search files and folders
  • get_sharing_link: Create sharing links
  • get_file_content: Get file contents

Account Operations

  • get_account_info: Get account information

Usage Examples

// List files in root directory await mcp.useTool("dbx-mcp-server", "list_files", { path: "" });

// Upload a file await mcp.useTool("dbx-mcp-server", "upload_file", { path: "/test.txt", content: Buffer.from("Hello World").toString("base64"), });

// Search for files await mcp.useTool("dbx-mcp-server", "search_file_db", { query: "report", path: "/Documents", max_results: 10, });

Testing

Run the test suite:

Tests verify all operations including authentication, file operations, and error handling.

Test Structure

The test suite is organized into several modules:

  • Dropbox Operations: Tests for basic file operations (upload, download, list, etc.)
  • Account Operations: Tests for accessing account information
  • Search and Delete: Tests for search functionality and safe deletion with recycle bin support
  • Resource System: Tests for the MCP resource system integration

Handling Test Data

The tests use dynamically generated file and folder names based on timestamps to avoid conflicts. Test data is automatically cleaned up after test execution.

Running Specific Tests

To run a specific test file or test group:

npm test -- tests/dropbox/search-delete.test.ts # Run specific test file npm test -- -t "should search for files" # Run tests matching description

Troubleshooting Tests

If tests fail with timing or authentication issues:

  1. Check that the mock implementations in tests/setup.ts match your test expectations
  2. Ensure test helpers are correctly configured
  3. For Jest scope errors, avoid referencing imported variables in mock factory functions

Development

Built with:

  • TypeScript
  • Model Context Protocol SDK
  • Dropbox SDK v10.34.0
  • Dropbox API v2

License

MIT License

Copyright (c) 2025 MCP Server Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

推荐服务器

Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Claude Code MCP

Claude Code MCP

一个实现了 Claude Code 作为模型上下文协议(Model Context Protocol, MCP)服务器的方案,它可以通过标准化的 MCP 接口来使用 Claude 的软件工程能力(代码生成、编辑、审查和文件操作)。

精选
本地
JavaScript
Apple MCP Server

Apple MCP Server

通过 MCP 协议与 Apple 应用(如“信息”、“备忘录”和“通讯录”)进行交互,从而使用自然语言发送消息、搜索和打开应用内容。

精选
本地
TypeScript
Excel MCP Server

Excel MCP Server

一个模型上下文协议服务器,使 AI 助手能够读取和写入 Microsoft Excel 文件,支持诸如 xlsx、xlsm、xltx 和 xltm 等格式。

精选
本地
Go
Playwright MCP Server

Playwright MCP Server

提供一个利用模型上下文协议的服务器,以实现类人浏览器的自动化,该服务器使用 Playwright,允许控制浏览器行为,例如导航、元素交互和滚动。

精选
本地
TypeScript
serper-search-scrape-mcp-server

serper-search-scrape-mcp-server

这个 Serper MCP 服务器支持搜索和网页抓取,并且支持 Serper API 引入的所有最新参数,例如位置信息。

精选
TypeScript
The Verge News MCP Server

The Verge News MCP Server

提供从The Verge的RSS feed获取和搜索新闻的工具,允许用户获取今日新闻、检索过去一周的随机文章,以及在最近的Verge内容中搜索特定关键词。

精选
TypeScript
MCP Server Trello

MCP Server Trello

通过 Trello API 促进与 Trello 看板的交互,提供速率限制、类型安全、输入验证和错误处理等功能,以实现对卡片、列表和看板活动的无缝管理。

精选
TypeScript
MCP DuckDB Knowledge Graph Memory Server

MCP DuckDB Knowledge Graph Memory Server

一个为 Claude 设计的记忆服务器,它使用 DuckDB 存储和检索知识图谱数据,从而增强了对话的性能和查询能力,并能持久保存用户信息。

精选
TypeScript