Dropbox文件管理服务

为MiddleGround Capital提供Dropbox文件操作的服务,包括文件列表、搜索、上传下载等核心功能。

  • by jstewartrr
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 jstewartrr/dropbox-mcp

使用说明

Dropbox MCP for Sovereign Mind

MCP服务器为MiddleGround Capital提供Dropbox文件操作。

工具(共14个)

工具 说明
list_folder 列出目录中的文件和文件夹
search_files 按名称或内容搜索文件
get_file_metadata 获取详细的文件/文件夹元数据
download_file 下载文件内容
read_text_file 读取文本文件内容
upload_file 上传文件(文本或二进制)
create_folder 创建新文件夹
move_file 移动或重命名文件/文件夹
copy_file 复制文件/文件夹
delete_file 删除文件/文件夹(到垃圾箱)
get_shared_link 获取或创建共享链接
list_revisions 列出文件版本历史记录
get_space_usage 获取存储配额信息
test_connection 测试API连接

设置

1.创建Dropbox应用程序

  1. 首选https://www.dropbox.com/developers/apps
  2. 创建新应用程序:
    • 选择“范围访问”
    • 选择“完整Dropbox”(或“应用程序文件夹”,如果受限制)
    • 名称:“中土主权思想”
  3. 在“权限”下,启用:
    • files.metadata.read
    • files.metadata.write
    • files.content.read
    • files.content.write
    • sharing.read
    • sharing.write
  4. 生成访问令牌(或使用OAuth2刷新流)

2.环境变量

# Option A: Long-lived refresh token (recommended)
DROPBOX_REFRESH_TOKEN=your_refresh_token
DROPBOX_APP_KEY=your_app_key
DROPBOX_APP_SECRET=your_app_secret

# Option B: Access token (expires in 4 hours)
DROPBOX_ACCESS_TOKEN=your_access_token

3.部署到Azure容器应用程序

# Build image
az acr build --registry sovereignmindacr --image dropbox-mcp:v1.0.0 .

# Create container app
az containerapp create \
  --name dropbox-mcp \
  --resource-group SovereignMind-RG \
  --environment SovereignMind-Env \
  --image sovereignmindacr.azurecr.io/dropbox-mcp:v1.0.0 \
  --target-port 8080 \
  --ingress external \
  --registry-server sovereignmindacr.azurecr.io \
  --env-vars \
    DROPBOX_REFRESH_TOKEN=secretref:dropbox-refresh-token \
    DROPBOX_APP_KEY=secretref:dropbox-app-key \
    DROPBOX_APP_SECRET=secretref:dropbox-app-secret

4.添加到SM网关

更新 app.py 在sm-mcp网关中:

"dropbox": {
    "url": "https://dropbox-mcp.lemoncoast-87756bcf.eastus.azurecontainerapps.io/mcp",
    "prefix": "dropbox",
    "description": "Dropbox file storage for MiddleGround",
    "enabled": True,
    "transport": "json",
    "priority": 1,
    "health_check": False
}

使用示例

# List root folder
{"name": "list_folder", "arguments": {"path": ""}}

# Search for Excel files
{"name": "search_files", "arguments": {"query": "budget", "file_extensions": ["xlsx", "xls"]}}

# Read a text file
{"name": "read_text_file", "arguments": {"path": "/Documents/notes.txt"}}

# Upload a file
{"name": "upload_file", "arguments": {"path": "/Reports/Q4.txt", "content": "Report content..."}}

# Get shared link
{"name": "get_shared_link", "arguments": {"path": "/Presentations/deck.pptx"}}

建筑

Claude.ai / API Claude
        │
        ▼
   SM MCP Gateway
        │
        ▼
   Dropbox MCP (this)
        │
        ▼
   Dropbox API
        │
        ▼
MiddleGround Dropbox

安全注意事项

  • 使用刷新令牌进行生产(自动续订)
  • 访问令牌将在4小时后过期
  • 将凭据存储在Azure密钥库或容器应用程序机密中
  • Dropbox审核日志跟踪所有API访问