A Model Context Protocol (MCP) server that provides comprehensive Dropbox integration with AI-powered PDF analysis capabilities. Features high-performance parallel processing, multi-directory indexing, and OpenRouter structured outputs for reliable document analysis.
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.
- 📁 Complete Dropbox Integration - Upload, download, search, and manage files
- 🤖 AI-Powered PDF Analysis - Analyze PDFs with OpenRouter structured outputs using Gemini 2.5 Flash
- 📊 Document Classification - Automatically classify documents as contracts, invoices, proposals, or reports
- 🔍 Intelligent Document Search - Index and search documents by content and metadata
- ⚡ High-Performance Processing - Parallel PDF analysis with configurable batch sizes (10-30 documents)
- 📂 Multi-Directory Indexing - Index multiple directories simultaneously with targeted scoping
- 💼 Business Intelligence - Track contract expirations, overdue invoices, and document analytics
- 🏢 Dropbox Business Support - Full support for team accounts with user selection
- 🔐 Enterprise Security - OAuth 2.0 with PKCE, encrypted token storage, and audit logging
- Quick Start
- Claude Code Installation
- Manual Installation
- Authentication
- Available Tools
- PDF Analysis Features
- Configuration
- Usage Examples
- Testing
- Development
- License
The fastest way to get started is using Claude Code with our npm package:
# Install the MCP server with Claude Code
claude mcp add dbx-mcp-server -- npx -y dbx-mcp-server
That's it! The server is now available in Claude Code. Continue to Authentication to set up your Dropbox credentials.
For manual installation or development, see Manual Installation.
- Claude Code installed
- Node.js 18+ installed
- Dropbox App credentials (see Authentication)
Choose the installation scope that best fits your needs:
# Available across all your projects
claude mcp add dbx-mcp-server -s user -- npx -y dbx-mcp-server
# Shared with your team via version control
claude mcp add dbx-mcp-server -s project -- npx -y dbx-mcp-server
# Default - only for current project directory
claude mcp add dbx-mcp-server -- npx -y dbx-mcp-server
Add your Dropbox credentials as environment variables:
# Add with environment variables
claude mcp add dbx-mcp-server -s user \
-e DROPBOX_APP_KEY=your_app_key_here \
-e DROPBOX_APP_SECRET=your_app_secret_here \
-e DROPBOX_REDIRECT_URI=http://localhost:3000/callback \
-e TOKEN_ENCRYPTION_KEY=your_32_plus_character_encryption_key \
-e OPENROUTER_API_KEY=your_openrouter_api_key_here \
-- npx -y dbx-mcp-server
Check that the server is properly configured:
# List all MCP servers
claude mcp list
# Get specific server details
claude mcp get dbx-mcp-server
# Test server connectivity in Claude Code
/mcp
In Claude Code, ask Claude to help you authenticate:
"Help me set up authentication with Dropbox using the setup tool"
Claude will guide you through the OAuth process using the dbx_setup
tool.
Claude Code offers three scopes for MCP server configuration:
Scope | Storage | Use Case | Command Flag |
---|---|---|---|
Local | Project-specific settings | Personal dev, testing | (default) |
Project |
.mcp.json in repo |
Team collaboration | -s project |
User | Global user settings | Personal utilities | -s user |
Project scope is recommended for team environments as it creates a .mcp.json
file that can be version controlled.
Server not starting?
# Check Node.js version
node --version # Should be 18+
# Test server manually
npx dbx-mcp-server
Environment variables not loading?
# Verify your environment variables are set
claude mcp get dbx-mcp-server
Permission issues?
# Reset project choices if using project scope
claude mcp reset-project-choices
For development or custom deployments:
git clone https://github.com/olivierdebeuf/dbx-mcp-server.git
cd dbx-mcp-server
npm install
npm run build
Create app at Dropbox App Console:
- Choose "Scoped access" API
- Select required permissions:
files.metadata.read
,files.content.read
,files.content.write
,sharing.write
,account_info.read
- Add redirect URI:
http://localhost:3000/callback
- Note your App key and App secret
Sign up at OpenRouter for AI analysis
# Create .env file with:
DROPBOX_APP_KEY=your_app_key
DROPBOX_APP_SECRET=your_app_secret
DROPBOX_REDIRECT_URI=http://localhost:3000/callback
TOKEN_ENCRYPTION_KEY=your_32_plus_character_encryption_key
OPENROUTER_API_KEY=your_openrouter_api_key
npm run setup # Complete OAuth authentication
npm run inspector # Launch MCP inspector for testing
The server uses OAuth 2.0 with PKCE for secure authentication with Dropbox.
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 -
OPENROUTER_API_KEY
: API key for AI analysis (get from openrouter.ai)
Optional:
-
DROPBOX_BUSINESS_USER_ID
: Team member ID for Dropbox Business accounts (auto-detected) -
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)
-
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
-
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
-
get_account_info
: Get account information
-
dropbox_analyze_pdf
: Analyze PDF files with custom AI prompts -
dropbox_index_file
: Index a single PDF for structured document management -
dropbox_index_folder
: Batch index all PDFs in a folder -
dropbox_search_indexed
: Search indexed documents by content and metadata -
dropbox_document_stats
: Get business intelligence and document analytics
The AI system automatically classifies PDFs into four main categories:
-
📄 Contracts - Legal agreements, service contracts, employment contracts
- Extracts: parties, dates, values, terms, governing law
- Tracks: expiration dates, renewal clauses, notice periods
-
🧾 Invoices - Bills, invoices, receipts, payment requests
- Extracts: vendor details, amounts, due dates, line items
- Tracks: overdue payments, payment status, tax information
-
📋 Proposals - Business proposals, project proposals, quotes
- Extracts: client information, project details, timelines, deliverables
- Tracks: proposal validity, project scope, pricing
-
📊 Reports - Research reports, financial reports, analysis documents
- Extracts: findings, recommendations, data insights, conclusions
- Tracks: report types, time periods, key metrics
- Content-based search across all indexed documents
- Metadata filtering by document type, date ranges, confidence scores
- Business intelligence queries for expired contracts, overdue invoices
- Document statistics and collection analytics
- Dropbox Business support with automatic team member detection
- Batch processing with configurable rate limiting
- SQLite database for persistent document metadata storage
- Confidence scoring for AI analysis quality assessment
- Audit logging for compliance and tracking
Control exactly which files get indexed with flexible exclusion options:
- Global exclusions via environment variables for organization-wide rules
- Per-operation exclusions for specific indexing tasks
- Path-based exclusions for exact folder matching
-
Pattern-based exclusions using glob patterns like
*/temp/*
,*.backup/
-
Built-in defaults exclude system folders (
.git
,node_modules
,.DS_Store
, etc.)
Configuration Options:
# Global exclusions (applied to all indexing operations)
DROPBOX_INDEX_EXCLUDED_PATHS=/private,/temp,/backup
Usage Examples:
// Exclude specific paths and patterns
await mcp.useTool("dbx-mcp-server", "dropbox_index_folder", {
path: "/documents",
excludePaths: ["/documents/confidential"],
excludePatterns: ["*/archive/*", "*/old_*"],
respectGlobalExclusions: true
});
// 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,
});
// Analyze a PDF with custom prompt
await mcp.useTool("dbx-mcp-server", "dropbox_analyze_pdf", {
path: "/contracts/service_agreement.pdf",
prompt: "Extract key contract terms, parties involved, and expiration date",
useThinking: true // Enable advanced reasoning mode
});
// Index a PDF for structured search
await mcp.useTool("dbx-mcp-server", "dropbox_index_file", {
path: "/invoices/invoice_2024_001.pdf"
});
// Batch index entire folder
await mcp.useTool("dbx-mcp-server", "dropbox_index_folder", {
path: "/documents",
recursive: true,
batchSize: 5 // Process 5 files at a time
});
// Index folder with exclusions
await mcp.useTool("dbx-mcp-server", "dropbox_index_folder", {
path: "/documents",
excludePaths: ["/documents/private", "/documents/temp"],
excludePatterns: ["*/backup/*", "*/.git/*", "*/draft/*"],
respectGlobalExclusions: true
});
// Search indexed documents
await mcp.useTool("dbx-mcp-server", "dropbox_search_indexed", {
query: "overdue payments",
docType: "invoice", // Filter by document type
limit: 10
});
// Get document analytics
await mcp.useTool("dbx-mcp-server", "dropbox_document_stats", {});
// Business Intelligence: Find expiring contracts
await mcp.useTool("dbx-mcp-server", "dropbox_search_indexed", {
query: "expiring",
docType: "contract"
});
// Financial Analysis: Track overdue invoices
await mcp.useTool("dbx-mcp-server", "dropbox_search_indexed", {
query: "overdue",
docType: "invoice"
});
// Document Management: Analyze proposal success rates
await mcp.useTool("dbx-mcp-server", "dropbox_document_stats", {});
Run the test suite:
npm test
Tests verify all operations including authentication, file operations, and error handling.
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
The tests use dynamically generated file and folder names based on timestamps to avoid conflicts. Test data is automatically cleaned up after test execution.
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
If tests fail with timing or authentication issues:
- Check that the mock implementations in
tests/setup.ts
match your test expectations - Ensure test helpers are correctly configured
- For Jest scope errors, avoid referencing imported variables in mock factory functions
Built with:
- TypeScript
- Model Context Protocol SDK
- Dropbox SDK v10.34.0
- Dropbox API v2
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.