Skip to main content

Running a CrewAI Agent with Barndoor

This guide walks you through how to run a CrewAI task using the Barndoor SDK to connect to an MCP server (like Notion), fetch connection parameters, and use the MCP tools within a CrewAI agent. Feel free to checkout the repo here and also run the app with Streamlit for a browser UI demo

πŸ“Ή Demo: Running CrewAI with Barndoor MCP

Prerequisites

  • Python 3.10+
  • A Barndoor account
  • An MCP server registered with Barndoor (connected/authenticated)
  • AI agent registered with Barndoor

Source

1. Install Dependencies

2. Create a .env File

This script expects a .env file in the same directory as main.py. Add the following environment variables:
Replace the placeholders with real values from your Barndoor project.

3. Run either Crew CLI or UI (browser) version:

πŸ› οΈ Troubleshooting
  • Missing .env values: Make sure all required keys are present. -using a stale token. try rm ~/.barndoor/token.json from root of project
  • Invalid server slug: Double-check SERVER_SLUG = β€œnotion” matches your Barndoor dashboard.
  • OAuth login doesn’t open: Manually open the URL shown in the terminal.