Skip to main content

Unstract Platform MCP server

Unstract has support for MCP server which can be used to integrate the functionality of connecting to an API deployment with a MCP host.

Features

Connects to a deployed Unstract API to process files and extract structured data. Handles asynchronous processing and polling for completion.

Tools

unstract_tool: Submits a file to the Unstract API, polls for completion, and returns structured extraction results. Handles errors, timeouts, and environment-based configuration. The tool also supports optional paramters to include metadata and metrics.

Configuration

Getting an API Key

To use the tool, one needs to set the UNSTRACT_API_KEY and API_BASE_URL environment variables. For obtaining these, please check the details under Getting Started

Usage with Claude Desktop

One can integrate the Unstract tool with Claude Desktop by adding the following configuration to the claude_desktop_config.json replacing the values of UNSTRACT_API_KEY and API_BASE_URL with the right values. Also, since the tool will need a file to be processed, the file needs to be mounted in the container. The sample below uses /tmp as the mount point. This can be changed to any other location.

Docker

{
"mcpServers": {
"unstract_tool":{
"command": "/usr/local/bin/docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/tmp:/tmp",
"-e",
"UNSTRACT_API_KEY",
"-e",
"API_BASE_URL",
"unstract/mcp-server",
"unstract"
],
"env": {
"UNSTRACT_API_KEY": "",
"API_BASE_URL": "https://us-central.unstract.com/deployment/api/...../"
}
}
}
}

Once the configuration is added, user can use extract_text as a tool to extract text from the supported documents.

Sample prompt

Process the document /tmp/sample-bank_statement.pdf

This should invoke the tool and get the response from the API deployed at the mentioned location. Optionally, one can request for includeing metadata and metrics also.