Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .agent/aidevops/mcp-integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ tools:
- Perplexity MCP: `PERPLEXITY_API_KEY` required
- Google Search Console: `GOOGLE_APPLICATION_CREDENTIALS` (service account JSON)

**Document Processing**:
- Unstract MCP: `UNSTRACT_API_KEY` + `UNSTRACT_API_BASE_URL` required (Docker-based)

**Development**:
- Claude Code MCP: Claude Code automation (forked server)
- Next.js DevTools MCP
Expand Down Expand Up @@ -60,6 +63,10 @@ This document provides comprehensive setup and usage instructions for advanced M
- **Claude Code MCP**: Run Claude Code as an MCP server for automation
- **Next.js DevTools MCP**: Next.js development and debugging assistance

### **📄 Document Processing**

- **Unstract MCP**: LLM-powered structured data extraction from unstructured documents (PDF, images, DOCX)

### **📧 CRM & Marketing**

- **FluentCRM MCP**: WordPress CRM with contacts, campaigns, automations, and email marketing
Expand Down Expand Up @@ -202,6 +209,57 @@ export FLUENTCRM_API_PASSWORD="your_application_password"

See `services/crm/fluentcrm.md` for detailed documentation.

### **Unstract MCP**

```bash
# 1. Sign up at https://unstract.com/start-for-free/ (14-day free trial)
# 2. Create a Prompt Studio project, define schema, deploy as API
# 3. Store credentials in ~/.config/aidevops/mcp-env.sh:
export UNSTRACT_API_KEY="your_api_key_here"
export UNSTRACT_API_BASE_URL="https://us-central.unstract.com/deployment/api/your-deployment-id/"
```

**For OpenCode** - Docker-based, disabled globally, enabled on-demand:

```json
{
"unstract": {
"type": "local",
"command": ["/bin/bash", "-c", "source ~/.config/aidevops/mcp-env.sh && docker run -i --rm -v /tmp:/tmp -e UNSTRACT_API_KEY -e API_BASE_URL=\"$UNSTRACT_API_BASE_URL\" unstract/mcp-server unstract"],
"enabled": false
}
}
```

**For Claude Desktop** (Docker):

```json
{
"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": "your_api_key",
"API_BASE_URL": "https://us-central.unstract.com/deployment/api/.../"
}
}
}
}
```

**Per-Agent Enablement**: The `services/document-processing/unstract.md` subagent has `unstract_tool: true` in its tools section. Agents needing document extraction reference this subagent.

**Available Tools**: `unstract_tool` - submits files, polls for completion, returns structured JSON. Supports optional metadata and metrics.

See `services/document-processing/unstract.md` for detailed documentation.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

## 🔧 **Configuration Examples**

### **Advanced Chrome DevTools Configuration**
Expand Down
130 changes: 130 additions & 0 deletions .agent/services/document-processing/unstract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
description: Unstract - LLM-powered document data extraction via MCP
mode: subagent
tools:
read: true
write: false
edit: false
bash: true
glob: false
grep: false
webfetch: true
unstract_tool: true
mcp:
unstract: true
---

# Unstract - Document Processing

<!-- AI-CONTEXT-START -->

## Quick Reference

- **Purpose**: Extract structured data from unstructured documents (PDFs, images, DOCX, etc.)
- **MCP Server**: `unstract/mcp-server` (Docker) or `@unstract/mcp-server` (npx)
- **Tool**: `unstract_tool` - submits files to Unstract API, polls for completion, returns structured JSON
- **Credentials**: `UNSTRACT_API_KEY` + `API_BASE_URL` in `~/.config/aidevops/mcp-env.sh`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's an inconsistency in the environment variable name for the Unstract API base URL. This line mentions API_BASE_URL, but the configuration example in lines 78-79 and the PR description specify UNSTRACT_API_BASE_URL. To avoid confusion for users, it's best to consistently use UNSTRACT_API_BASE_URL in the user-facing documentation. The OpenCode configuration correctly handles mapping this to API_BASE_URL for the container, but the documentation should be consistent.

Suggested change
- **Credentials**: `UNSTRACT_API_KEY` + `API_BASE_URL` in `~/.config/aidevops/mcp-env.sh`
- **Credentials**: UNSTRACT_API_KEY + UNSTRACT_API_BASE_URL in ~/.config/aidevops/mcp-env.sh

- **Docs**: https://docs.unstract.com/unstract/unstract_platform/mcp/unstract_platform_mcp_server/
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- **GitHub**: https://github.com/Zipstack/unstract

**On-demand loading**: This MCP is disabled globally and enabled per-agent when document extraction is needed.

<!-- AI-CONTEXT-END -->

## What is Unstract?

Unstract is a no-code LLM platform that structures unstructured documents. It provides:

- **Prompt Studio**: Visual environment to define extraction schemas
- **API Deployments**: Turn any document into JSON via REST API
- **ETL Pipelines**: Batch process documents into databases
- **MCP Server**: Integrate extraction into AI agent workflows

## Supported File Types

| Category | Formats |
|----------|---------|
| Documents | PDF, DOCX, DOC, ODT, TXT, CSV, JSON |
| Spreadsheets | XLSX, XLS, ODS |
| Presentations | PPTX, PPT, ODP |
| Images | PNG, JPG, JPEG, TIFF, BMP, GIF, WEBP |

## MCP Tool

### `unstract_tool`

Submits a file to the Unstract API, polls for completion, and returns structured extraction results.

**Parameters**:
- `file_path` (required): Path to the document to process
- `include_metadata` (optional): Include extraction metadata in response
- `include_metrics` (optional): Include processing metrics (tokens, cost)

**Example prompt**: "Process the document /tmp/invoice.pdf"

## Setup

### 1. Get API Credentials

1. Sign up at https://unstract.com/start-for-free/ (14-day free trial)
2. Create a Prompt Studio project and define your extraction schema
3. Deploy as an API endpoint
4. Copy the API key and deployment URL

### 2. Store Credentials

```bash
# Add to ~/.config/aidevops/mcp-env.sh:
export UNSTRACT_API_KEY="your_api_key_here"
export UNSTRACT_API_BASE_URL="https://us-central.unstract.com/deployment/api/your-deployment-id/"
```

### 3. OpenCode Configuration (On-Demand)

The MCP is configured in OpenCode but disabled globally. It loads on-demand when this subagent is invoked.

See `configs/mcp-templates/unstract.json` for the configuration template.

### 4. Claude Desktop Configuration (Docker)

```json
{
"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": "",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The placeholder for UNSTRACT_API_KEY is an empty string, which could be confusing as it's not immediately obvious that it requires a value. Using a more descriptive placeholder like your_api_key_here would make it clearer for the user that they need to replace it with their actual key. This aligns with the placeholder style used elsewhere in the documentation (e.g., line 78).

Suggested change
"UNSTRACT_API_KEY": "",
"UNSTRACT_API_KEY": "your_api_key_here",

"API_BASE_URL": "https://us-central.unstract.com/deployment/api/.../"
}
}
}
}
```

## Use Cases

- **Invoice processing**: Extract line items, totals, vendor info from invoices
- **Bank statement parsing**: Structure transaction data from varied bank formats
- **Insurance claims**: Extract claim details from forms and supporting documents
- **KYC/onboarding**: Parse identity documents and application forms
- **Contract analysis**: Extract key terms, dates, parties from legal documents

## Integration with aidevops

This subagent is referenced by agents that need document extraction capabilities. The MCP loads only when document processing tasks are detected.

**Trigger keywords**: document, extract, parse, invoice, statement, PDF, OCR, unstructured

## Related

- `tools/context/mcp-discovery.md` - On-demand MCP loading pattern
- `.agent/aidevops/mcp-integrations.md` - All MCP integrations
- `configs/mcp-templates/unstract.json` - OpenCode config template
3 changes: 2 additions & 1 deletion .agent/subagent-index.toon
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ flash,gemini-2.5-flash,Fast cheap large context
pro,gemini-2.5-pro,Capable large context
-->

<!--TOON:subagents[31]{folder,purpose,key_files}:
<!--TOON:subagents[32]{folder,purpose,key_files}:
aidevops/,Framework internals - extending aidevops and architecture,setup|architecture|troubleshooting
memory/,Cross-session memory - SQLite FTS5 storage,README
seo/,Search optimization - keywords and rankings,dataforseo|serper|google-search-console|gsc-sitemaps|site-crawler|eeat-score
Expand Down Expand Up @@ -54,6 +54,7 @@ services/communications/,Communications - SMS and voice,twilio|telfon
services/crm/,CRM integration - contact management,fluentcrm
services/analytics/,Website analytics - GA4 reporting,google-analytics
services/accounting/,Accounting integration - invoicing,quickfile
services/document-processing/,Document processing - LLM-powered extraction,unstract
-->

<!--TOON:workflows[12]{name,file,purpose}:
Expand Down
12 changes: 12 additions & 0 deletions configs/mcp-templates/unstract.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"unstract": {
"type": "local",
"command": [
"/bin/bash",
"-c",
"source ~/.config/aidevops/mcp-env.sh && docker run -i --rm -v /tmp:/tmp -e UNSTRACT_API_KEY -e API_BASE_URL=\"$UNSTRACT_API_BASE_URL\" unstract/mcp-server unstract"
],
"enabled": false,
"_comment": "Disabled globally. Enabled on-demand via services/document-processing/unstract.md subagent. Requires UNSTRACT_API_KEY and UNSTRACT_API_BASE_URL in ~/.config/aidevops/mcp-env.sh"
}
}
Loading