Pydantic AI and Box MCP
- agent-framework
This project is a demo of how to use the Box MCP server with Pydantic AI agents. The use case is a policy analyzer.
About
What is Pydantic AI and Box MCP?
Pydantic AI and Box MCP is a demonstration project that shows how to use the Box MCP (Model Context Protocol) server to augment Pydantic AI agents with secure content stored in Box. It runs locally on a developer’s machine and is intended for developers exploring the integration of Box’s MCP server with AI agent frameworks.
How to use Pydantic AI and Box MCP?
First, set up a local copy of the Box MCP server and configure your Box platform app. Then update the MCPServerStdio command in the code to point to your local directory of the Box MCP server. After that, navigate to the project directory, create a virtual environment with uv venv, install the required libraries with uv pip install -r pyproject.toml, and finally run the demo with uv run policy_analyzer.py.
Key features of Pydantic AI and Box MCP
- Demonstrates integration of Box MCP with Pydantic AI agents
- Uses Box MCP server for secure content access
- Showcases augmenting AI agents with enterprise content
- Simple local setup with uv and virtual environments
- Example script policy_analyzer.py for a concrete use case
Use cases of Pydantic AI and Box MCP
- Analyzing policies or documents stored securely in Box using Pydantic AI agents
- Building AI-powered insights on content that remains inside Box’s secure environment
FAQ from Pydantic AI and Box MCP
What does this demo do?
It shows how to use the Box MCP server to augment Pydantic AI
Details
- Author
- box-community
- Category
- agent-framework
- Repository
- box-community/box-mcp-pydantic-ai
Pydantic AI and Box MCP
This project is a demo showing how to use the Box MCP server to augment Pydantic AI agents with secure content in Box.
To run this, you will need a local copy of our MCP server. Follow the instructions there to set up your Box platform app, register it with your Box instance, and configure the server.
The only thing you'll need to do in this project is update the following code to point to your local directory:
async with MCPServerStdio(
command='uv',
args=[
'--directory',
'/Users/shurrey/local/mcp-server-box',
'run',
'src/mcp_server_box.py'
]
) as local_server:
Once you have those steps done, navigate to this project at the commandline and set up your virtual environment:
uv venv
Then install the prerequisites libraries.
uv pip install -r pyproject.toml
Now you can run the demo.
uv run policy_analyzer.py
