Generate sample code
After you connect your AI tool to the Transform MCP server and have Transform parse your source files to produce the kind of output you want, you can ask the Unstructured Transform MCP server to generate sample curl or Python code based on the parsing process that Transform just ran. You can then use this code to run Transform in your production environment at scale. To get this code, ask your AI tool the following, depending on whether you want curl or Python code:- curl
- Python
To generate the curl code as downloadable shell script (To write the curl code to your associated project as shell script (
.sh) files, ask your AI tool the following:.sh) files , ask your AI tool the following:Run sample code
Before you can run the generated example curl or Python code, you must set up your local development environment. This includes installing curl or Python locally, installing the Unstructured Python SDK locally if you’re using Python, and defining and setting two unique local environment variables, which the example code refers to and relies upon.Install curl
curl installation instructions vary by operating system and download manager utility. See the curl Download page or the documentation for your operating system or download manager utility.Install Python and the SDK
Python installation instructions vary by operating system and download manager utility. See the Download Python page or the documentation for your operating system or download manager utility. Unstructured recommends that you install the Python SDK into a Python virtual environment, such as uv. This enables you to isolate and manage various Python package dependencies for your Python projects. Learn more about Python virtual environments. To download and install the Unstructured Python SDK by usinguv, run a command such as the following from within
a uv virtual environment:
uv, see your package manager provider’s documentation.
Define environment variables
Your local development environment must have access to the following two environment variables:UNSTRUCTURED_API_KEY, which represents the programmatic access identifier for your user account in the Transform service. Each call to the Transform service requires this identifier so that the correct user account is billed (or any remaining free page counts are reduced) accordingly.UNSTRUCTURED_API_URL, which represents the programmatic API endpoint for the Unstructured Transform service. This service contains the file parsing logic and orchestrates all file processing jobs.
export or setx command or equivalent), see your environment’s documentation.
To set these environment variables to the appropriate values, see the following sections.
Get your Unstructured API key and URL
- Sign in to Unstructured Transform, if you have not already done so, at https://transform.unstructured.io
- If the Get started page is not visible, on the sidebar, click Get started.
- In the Get your API key area, get the value of your Unstructured API key. Click the pages icon (Copy) to copy this value to your system’s clipboard.
- Set your
UNSTRUCTURED_API_KEYenvironment variable to this value. - Next to your API key, get the value of your Unstructured API URL, which should be
https://platform-api.transform.unstructured.io/api/v1 - Set your
UNSTRUCTURED_API_URLenvironment variable to this value.
View Transform API documentation
Unstructured Transform uses the Unstructured API. To view the related API reference documentation, see the following:- Step 1: Create a file parsing job in Transform
- Step 2: Get the job’s details
- Step 3: Download the completed job’s output
- View the OpenAPI specification
Next steps
- Transform quickstart: Install the Unstructured Transform MCP server, drag and drop files, and have Transform start producing partitioned and enriched data based on your files in minutes.
- Control Transform file parsing output: Control how the Unstructured Transform MCP server instructs Transform to partition, enrich, chunk, and embed the data based on your files.

