Unstructured Transform integration
This guide provides a quick overview for getting started with the Unstructured Transform
tools. The Unstructured Transform
MCP server ingests and transforms files (PDF, DOCX, images, and 70+ file types) into partitioned,
enriched, chunked, and embedded data for RAG and AI pipelines. The langchain-unstructured-transform
package loads those tools as native LangChain tools.
Overview
Details
| Class | Package | Serializable | JS support | Downloads | Version |
|---|---|---|---|---|---|
UnstructuredTransformToolkit | langchain-unstructured-transform | ❌ | ❌ |
Features
- Loads the hosted Transform MCP server's tools as native LangChain tools.
- Drives the full parsing lifecycle: request an upload URL, transform files, poll status, and fetch results.
- Works with any LangChain or LangGraph agent.
- Remote and hosted: no local server or bridge to run.
Setup
To access the Unstructured Transform tools, you'll need an Unstructured account and an API key, and
you'll need to install the langchain-unstructured-transform package.
Credentials
Get an API key from the Unstructured docs, then set it as an environment variable:
import getpass
import os
if "UNSTRUCTURED_API_KEY" not in os.environ:
os.environ["UNSTRUCTURED_API_KEY"] = getpass.getpass("Enter your Unstructured API key: ")It's also helpful (but not needed) to set up LangSmith for best-in-class observability/tracing of your tool calls. To enable automated tracing, set your LangSmith API key:
os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")
os.environ["LANGSMITH_TRACING"] = "true"Installation
The Unstructured Transform tools live in the langchain-unstructured-transform package:
pipuv
pip install -U langchain-unstructured-transformuv add langchain-unstructured-transformInstantiation
The Transform tools are loaded over MCP, which is an asynchronous operation. Use the toolkit's
aget_tools() method (or the aget_transform_tools() helper) to load them:
from langchain_unstructured_transform import UnstructuredTransformToolkit
toolkit = UnstructuredTransformToolkit() # reads UNSTRUCTURED_API_KEY
tools = await toolkit.aget_tools()The loaded tools include request_file_upload_url, transform_files, check_transform_status,
and get_transform_results.
Invocation
Within an agent
The tools are designed to be orchestrated by an agent, which chains them to run a full parsing job.
# pip install -qU "langchain[anthropic]" to call the model
from langchain.agents import create_agent
from langchain_unstructured_transform import aget_transform_tools
tools = await aget_transform_tools()
agent = create_agent(
model="claude-sonnet-4-6",
tools=tools,
)
response = await agent.ainvoke(
{
"messages": [
{
"role": "user",
"content": (
"Use the Unstructured Transform tools to parse ./report.pdf. "
"Provide the results as JSON."
),
}
]
}
)
print(response["messages"][-1].content)The agent requests an upload URL, uploads each file, starts the transform, polls for status, and returns the results — one output per input file.
Limits
Parsing requests have the following limits:
- Each file must be a supported file type.
- Each file must be 50 MB or less in size.
- Each request must have 10 files or fewer.
- Only 5 requests can run at a time.
The Transform MCP server reports these limits back to the agent through its tool responses, so you can instruct your agent to batch files and back off accordingly in its system prompt.
API reference
For detailed documentation of the Unstructured Transform MCP server, its tools, and how to control its output, head to the Unstructured Transform documentation.