Box
official
content
Interact with the Intelligent Content Management platform through Box AI.
MCP Server Box
Description
MCP Server Box is a Python project that integrates with the Box API to perform various operations such as file search, text extraction, AI-based querying, and data extraction. It leverages the
box-sdk-gen
library and provides a set of tools to interact with Box files and folders.The Model Context Protocol (MCP) is a framework designed to standardize the way models interact with various data sources and services. In this project, MCP is used to facilitate seamless integration with the Box API, enabling efficient and scalable operations on Box files and folders. The MCP Server Box project aims to provide a robust and flexible solution for managing and processing Box data using advanced AI and machine learning techniques.
Tools implemented
Box Tools
box_who_am_i
box_who_am_i
Get your current user information and check connection status.
Returns: User information string
box_authorize_app_tool
box_authorize_app_tool
Start the Box application authorization process.
Returns: Authorization status message
box_search_tool
box_search_tool
Search for files in Box.
Parameters:
(str): Search queryquery
(List[str], optional): File extensions to filter byfile_extensions
(List[str], optional): Where to search (NAME, DESCRIPTION, FILE_CONTENT, COMMENTS, TAG)where_to_look_for_query
(List[str], optional): Folder IDs to search withinancestor_folder_ids
Returns: Search results
box_read_tool
box_read_tool
Read the text content of a Box file.
Parameters:
(str): ID of the file to readfile_id
Returns: File content
box_ask_ai_tool
box_ask_ai_tool
Ask Box AI about a file.
Parameters:
(str): ID of the filefile_id
(str): Question for the AIprompt
Returns: AI response
box_search_folder_by_name
box_search_folder_by_name
Locate a folder by name.
Parameters:
(str): Name of the folderfolder_name
Returns: Folder ID
box_ai_extract_data
box_ai_extract_data
Extract data from a file using AI.
Parameters:
(str): ID of the filefile_id
(str): Fields to extractfields
Returns: Extracted data in JSON format
box_list_folder_content_by_folder_id
box_list_folder_content_by_folder_id
List folder contents.
Parameters:
(str): ID of the folderfolder_id
(bool): Whether to list recursivelyis_recursive
Returns: Folder content in JSON format with id, name, type, and description
box_manage_folder_tool
box_manage_folder_tool
Create, update, or delete folders in Box.
Parameters:
(str): Action to perform: "create", "delete", or "update"action
(str, optional): ID of the folder (required for delete/update)folder_id
(str, optional): Folder name (required for create, optional for update)name
(str, optional): Parent folder ID (required for create, optional for update)parent_id
(str, optional): Folder description (optional for update)description
(bool, optional): Whether to delete recursively (optional for delete)recursive
Returns: Status message with folder details
box_upload_file_tool
box_upload_file_tool
Upload content as a file to Box.
Parameters:
(str): The content to upload as a filecontent
(str): The name to give the file in Boxfile_name
(Any, optional): The ID of the folder to upload tofolder_id
Returns: Upload status with file ID and name
box_download_file_tool
box_download_file_tool
Download a file from Box and return its content.
Parameters:
(Any): The ID of the file to downloadfile_id
(bool, optional): Whether to save the file locallysave_file
(str, optional): Path where to save the filesave_path
Returns: File content as text, base64-encoded image, or save status message
Requirements
- Python 3.13 or higher
- Box API credentials (Client ID, Client Secret, etc.)
Installation
-
Clone the repository:
git clone https://github.com/box-community/mcp-server-box.git cd mcp-server-box
-
Install
if not installed yet:uv
2.1 MacOS+Linuxcurl -LsSf https://astral.sh/uv/install.sh | sh
2.2 Windowspowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
-
Create and set up our project:3.1 MacOS+Linux
# Create virtual environment and activate it uv venv source .venv/bin/activate # Lock the dependencies uv lock
3.1 Windows# Create virtual environment and activate it uv venv .venv\Scripts\activate # Lock the dependencies uv lock
-
Create a
file in the root directory and add your Box API credentials:.env
BOX_CLIENT_ID=your_client_id BOX_CLIENT_SECRET=your_client_secret
Usage
Running the MCP Server
To start the MCP server, run the following command:
uv --directory /Users/anovotny/Desktop/mcp-server-box run src/mcp_server_box.py
Using Claude as the client
- Edit your
.jsonclaude_desktop_config
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
- And add the following:
{ "mcpServers": { "mcp-server-box": { "command": "uv", "args": [ "--directory", "/Users/anovotny/Desktop/mcp-server-box", "run", "src/mcp_server_box.py" ] } } }
[!NOTE] If using MacOS, you will want to install uv with brew:or provide the full path to the uv executable:brew install uv
/Users/shurrey/.local/bin/uv --directory /Users/shurrey/local/mcp-server-box run src/mcp_server_box.py
- If Claude is running restart it
Using Cursor as the client
-
Open your IDE with Cursor
-
In settings, select
.Cursor settings
-
In the left nav, select
.MCP
-
In the top-left, select
.Add new global MCP server
-
Past the following json, being sure to update for your local values:
{ "mcpServers": { "box": { "command": "uv", "args": [ "--directory", "/Users/shurrey/local/mcp-server-box", "run", "src/mcp_server_box.py" ] } } }
- Save and close the mcp.json file, and ensure the MCP server is enabled. You may have to restart.
Running Tests
The project includes a suite of tests to verify Box API functionality. Before running the tests, you'll need to update the file and folder IDs in the test files to match files in your Box account.
Setting Up Tests
-
Update File and Folder IDs:
- Each test file (in the
directory) contains hardcoded IDs for Box files and folderstests/
- You need to replace these IDs with IDs of files and folders in your Box account
- Example: In
, replacetest_box_api_read.py
with the ID of a file in your Box account"1728677291168"
- Each test file (in the
-
Test File ID References:
: Needs a valid document file ID (e.g., a Word document)test_box_api_read.py
: Update the search queries and file extensions to match your contenttest_box_api_search.py
: Needs a file ID for testing AI extraction capabilitiestest_box_api_ai.py
- Other test files may require specific folder IDs or file types
Running Tests
Once you've updated the file IDs, you can run tests using pytest:
# Run all tests pytest # Run a specific test file pytest tests/test_box_api_file_ops.py # Run tests with detailed output pytest -v # Run tests and show print statements pytest -v -s
Available Tests
: Tests authentication functionalitytest_box_auth.py
: Basic Box API teststest_box_api_basic.py
: Tests file reading capabilitiestest_box_api_read.py
: Tests search functionalitytest_box_api_search.py
: Tests AI-based featurestest_box_api_ai.py
: Tests file upload and download operationstest_box_api_file_ops.py
Creating New Tests
When creating new tests:
- Follow the pattern in existing test files
- Use the
fixture for authenticated API accessbox_client
- Clean up any test files or folders created during tests
- Add proper assertions to verify functionality
Troubleshooting
If you are on MacOS and running the MCP server with Claude Desktop and you see the following error:
Error: spawn uv ENOENT
you can either remove uv and re-install with brew:
brew install uv
or provide the full path to the uv executable:
/Users/shurrey/.local/bin/uv --directory /Users/shurrey/local/mcp-server-box run src/mcp_server_box.py
Related Servers

Audiense Insights
official
Marketing insights and audience analysis from [Audiense](https://www.audiense.com/products/audiense-insights) reports, covering demographic, cultural, influencer, and content engagement analysis.
View Details
DevHub
official
Manage and utilize website content within the [DevHub](https://www.devhub.com) CMS platform
View Details
EduBase
official
Interact with [EduBase](https://www.edubase.net), a comprehensive e-learning platform with advanced quizzing, exam management, and content organization capabilities
View Details
gotoHuman
official
Human-in-the-loop platform - Allow AI agents and automations to send requests for approval to your [gotoHuman](https://www.gotohuman.com) inbox.
View Details