Prerequisites
- Python 3.13 or higher
- Box API credentials (Client ID, Client Secret, etc.)
- UV package manager
Clone the Repository
git clone https://github.com/box-community/mcp-server-box.git
cd mcp-server-box
Install UV
MacOS+Linux
curl -Ls https://astral.sh/uv/install.sh | sh
Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Create and Setup Your Project
macOS / Linux
# Create and activate the virtual environment
uv venv
source .venv/bin/activate
# Lock the dependencies
uv lock
Windows
# Create and activate the virtual environment
uv venv
.venv\Scripts\activate
# Lock the dependencies
uv lock
PowerShell Execution Policy Error: If you encounter an error about scripts being disabled when trying to activate the virtual environment, you need to change the PowerShell execution policy. Run PowerShell as Administrator and execute:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
This allows local scripts to run while maintaining security for remote scripts.
Set Up Environment Variables
Create a Custom Box App
Before setting up environment variables, you need to create a custom Box application to obtain your API credentials:
-
Access Box Developer Console
- Go to app.box.com/developers/console
- Login to your Box account
-
Create Custom App
- Select “Custom App” or “Create New App” then “Custom App”
- Fill in the popup for creating a custom app:
- Name: Write in “Delve”
- Description: Write in “AI data analysis”
- Purpose: Choose “Integration”
- Category: Choose “AI”
-
Configure Authentication
- On the next screen, select “User Authentication (OAuth 2.0)”
- Click “Create App”
-
Set Redirect URI
- In the Configuration Window, scroll down to “OAuth 2.0 redirect URIs”
- Add
http://localhost:8000/callback
- Click “Save” in the top right corner
-
Get Your Credentials
- Find the “OAuth 2.0 credentials” section
- These are the
BOX_CLIENT_ID
andBOX_CLIENT_SECRET
that you will use in the.env
file
Create Environment File
Create a .env
file in the root directory and add your Box API credentials:
BOX_CLIENT_ID=your_client_id
BOX_CLIENT_SECRET=your_client_secret
Security Note: Never commit your .env
file to version control. Add it to your .gitignore
file to prevent accidental exposure of your credentials.
Box Auth Test Instructions
Important: Test your Box authentication before proceeding with the MCP server setup. This will verify your credentials and complete the OAuth flow.
- Open
tests/test_box_auth.py
- Comment out the
@pytest.mark.skip
lines (add#
before them) - Save the file
- Run:
pytest tests/test_box_auth.py -v
When you run the test:
- A browser window will automatically open asking you to log in to your Box account
- Sign in with your Box credentials
- Grant access to the application when prompted
- The browser will redirect to
http://localhost:8000/callback
- The test will complete successfully if authentication works
Note: If the browser doesn’t open automatically, check your browser settings or manually navigate to the URL shown in the terminal output.
Adding the MCP Server to Delve
To integrate the Box MCP Server with Delve, follow these steps:
-
Open Delve Settings
- Launch Delve
- Navigate to Settings (gear icon)
-
Add MCP Connector
- Click the ”+” icon to the right of “MCP Connectors”
- This will open the connector configuration dialog
-
Configure the Connector
- Connector Name: Enter
Box
- Connection Type: Select
Command
- Command: Enter
uv
- Arguments: Enter the following (one per line):
--directory /path/to/mcp-server-box run src/mcp_server_box.py
Note: Replace
/path/to/mcp-server-box
with the actual path to your clonedmcp-server-box
repository.Troubleshooting: If you get a “uv not in path” error, you may need to use the absolute path to UV instead of just
uv
. - Connector Name: Enter
-
Save Configuration
- Click “Save” to store the connector settings
Troubleshooting
- If you receive
Error: spawn uv ENOENT
on macOS, try reinstalling UV with Homebrew:brew install uv
or provide the full path to the UV executable in your configuration. - Ensure your Box API credentials in
.env
are correct. - For PowerShell execution policy issues, see the note above in the Delve configuration section.
For more details, see the official Box MCP Server documentation.