input
folder, which contains the files to process. This input
folder must contain at least one file to process.
If you do not have any files available to upload into the input
folder, you can get some from the example-docs folder in the Unstructured open source library repository on GitHub.output
folder, which will contain the processed files’ data from Unstructured after CrewAI runs the workflow.
This output
folder should be empty for now.uv
is not required to use CrewAI or the Unstructured Workflow Endpoint MCP Server).
Install uv
uv
, run one of the following commands, depending on your operating system:curl
with sh
:wget
with sh
instead:uv
by using other approaches such as PyPI, Homebrew, or WinGet,
see Installing uv.Install CrewAI open source
uv
to install the CrewAI open-source toolchain, by running the following command:Install Python
uv
will detect and use Python if you already have it installed.
To view a list of installed Python versions, run the following command:uv
by running the following command. For example, this command installs Python 3.12 for use with uv
:Create the project directory
crewai_unstructured_demo
within your current working directory and then
switches to this new project directory:Intiialize the project
uv
to initialize the project by running the following command:Create a venv virtual environment
venv
is not required to use CrewAI or the Unstructured Workflow Endpoint MCP Server).
From the root of your project directory, use uv
to create a virtual environment with venv
by running the following command:Activate the virtual environment
venv
virtual environment, run one of the following commands from the root of your project directory:bash
or zsh
, run source .venv/bin/activate
fish
, run source .venv/bin/activate.fish
csh
or tcsh
, run source .venv/bin/activate.csh
pwsh
, run .venv/bin/Activate.ps1
Get the Unstructured Workflow Endpoint MCP Server's source code
Install the Unstructured Workflow Endpoint MCP Server's code dependencies
uv
to install the MCP server’s code dependencies, by running the following commands:Install the CrewAI project's code dependencies
uv
to install the CrewAI project’s dependencies, by running the following commands:Add the CrewAI project's source code
main.py
file in the CrewAI project’s root directory, replace that file’s contents with the following Python code. This code defines a set of
CrewAI-compatible agents and tasks that make up a
multi-agent crew. This code then uses the crew’s agents to run the tasks in order to build an Unstructured ETL+ workflows
from connector creation all the way through to workflow job completion:.env
file, which you will create in the next step.Create the .env file
.env
file in the root of your CrewAI project directory, and then add the following environment variables to the file:UNSTRUCTURED_API_KEY
- Your Unstructured API key.ANTHROPIC_API_KEY
- Your Anthropic API key.FIRECRAWL_API_KEY
- Your Firecrawl API key.AWS_KEY
- The AWS access key ID for the AWS IAM user that has access to the S3 bucket.AWS_SECRET
- The IAM user’s AWS secret access key.S3_SOURCE_CONNECTOR_NAME
- Some display name for the S3 source connector.S3_SOURCE_URI
- The URI of the input
folder in the S3 bucket.S3_DESTINATION_CONNECTOR_NAME
- The name of the S3 destination connector.S3_DESTINATION_URI
- The URI of the output
folder in the S3 bucket.WORKFLOW_NAME
- Some display name for the workflow..env
file might look like this:Unstructured Workflow Endpoint MCP Server
make
to run the MCP server locally, by running the following commands:make
available, see your operating system’s documentation for installation instructions.http://127.0.0.1:8080/sse
.You must leave the MCP server running in your terminal or command prompt window while you run the CrewAI project.Run the CrewAI project
uv run main.py
command.
Ctrl+C
in the terminal or command prompt window where you ran the make sse-server
command.