Skip to content

[Integration]: Dropbox #3552

@Siddharth2624

Description

@Siddharth2624

Reason

Dropbox is a widely-used cloud storage platform. Adding Dropbox integration will enable Hive agents to upload, download, and manage files in cloud storage - essential for workflows that generate reports, process documents, or need persistent file storage.

Use Case

  • File uploads: Agent saves generated reports/exports to Dropbox
  • File downloads: Agent retrieves documents for processing
  • File sharing: Generate shareable links for reports
  • Backup: Store agent outputs in cloud storage

Example workflow:

Data Processing → Generate Report → [Dropbox: Upload PDF] → [Slack: Share link]

Scope

MVP Endpoints:

  • dropbox_upload_file - Upload a file to Dropbox
  • dropbox_download_file - Download a file from Dropbox
  • dropbox_list_folder - List files in a folder
  • dropbox_create_shared_link - Create a shareable link

Proposed Implementation

1. Folder Structure:

tools/src/aden_tools/tools/dropbox_tool/
├── __init__.py
├── dropbox_tool.py
└── README.md

2. Credential Spec (tools/src/aden_tools/credentials/integrations.py):

"dropbox": CredentialSpec(
    env_var="DROPBOX_ACCESS_TOKEN",
    tools=["dropbox_upload_file", "dropbox_download_file", "dropbox_list_folder", "dropbox_create_shared_link"],
    required=True,
    startup_required=False,
    help_url="https://www.dropbox.com/developers/apps",
    description="Dropbox API access token",
    api_key_instructions="""To get a Dropbox access token:
1. Go to https://www.dropbox.com/developers/apps
2. Click "Create app"
3. Choose "Scoped access" and "Full Dropbox" or "App folder"
4. Name your app and click "Create"
5. Under "Permissions", enable files.content.read and files.content.write
6. Generate an access token in the "Settings" tab""",
    health_check_endpoint="https://api.dropboxapi.com/2/users/get_current_account",
    health_check_method="POST",
),

3. Tool Implementation (dropbox_tool.py):

"""Dropbox Tool - Upload, download, and manage files via Dropbox API."""

from __future__ import annotations

import os
from typing import TYPE_CHECKING, Any

import httpx
from fastmcp import FastMCP

if TYPE_CHECKING:
    from aden_tools.credentials import CredentialStoreAdapter

DROPBOX_API_BASE = "https://api.dropboxapi.com/2"
DROPBOX_CONTENT_BASE = "https://content.dropboxapi.com/2"


def register_tools(
    mcp: FastMCP,
    credentials: CredentialStoreAdapter | None = None,
) -> None:
    """Register Dropbox tools with the MCP server."""

    def _get_token() -> str | None:
        if credentials is not None:
            return credentials.get("dropbox")
        return os.getenv("DROPBOX_ACCESS_TOKEN")

    @mcp.tool()
    def dropbox_list_folder(path: str = "") -> dict[str, Any]:
        """
        List files and folders in a Dropbox directory.

        Args:
            path: Folder path (empty string for root)

        Returns:
            Dict with file/folder entries or error
        """
        token = _get_token()
        if not token:
            return {"error": "Dropbox access token not configured"}

        response = httpx.post(
            f"{DROPBOX_API_BASE}/files/list_folder",
            headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
            json={"path": path if path else ""},
            timeout=30.0,
        )
        return response.json()

4. Register in tools/src/aden_tools/tools/__init__.py:

from .dropbox_tool import register_tools as register_dropbox

Link

Related to parent integration tracker: #2805

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions