ClicheFactory Document Intelligence

io.github.ClicheFactory由 GitHub 帳號 ClicheFactory 發布v0.1.8更新於 Oct 25, 2026

Extract structured JSON from PDFs, images, DOCX, XLSX, CSV, EML attachments, and DSPy pipelines.

已驗證STDIO僅桌面檔案與儲存資料與分析

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理從 PDF、圖片、Office 檔案與郵件附件擷取結構化 JSON,或轉換成 markdown。

可以做什麼
依 JSON schema 從文件中擷取結構化 JSON,支援多種擷取模式,包含訓練流程與兩階段驗證。將支援的文件轉換為 markdown 文字,方便檢視或分析。對設定、API 金鑰、相依套件與系統二進位檔執行診斷。支援的輸入包括 PDF、常見圖片格式、DOCX、DOC、ODT、XLSX、CSV、EML、TXT 與 MD。
適用情境
適合讓助理把發票號碼、總額等欄位從文件中擷取成 JSON,或先把文件讀成 markdown 再決定要擷取什麼。較適合一次處理一份文件的流程,而非批次作業。
執行需求
透過 uvx 或 pip 以 stdio 在本機執行;需要 Python 3.12 以上版本以及 uv 或 pip。服務模式需要 CLICHEFACTORY_API_KEY 中的 ClicheFactory API 金鑰,並能連線至 ClicheFactory 雲端服務。本機模式需要安裝 local 附加元件(約 2 GB 的解析與 OCR 相依套件)、tesseract 與 LibreOffice 等系統二進位檔,以及 LLM_API_KEY 和 LLM_MODEL_NAME;OCR_API_KEY 與 OCR_MODEL_NAME 為選用。
安裝前請注意
服務模式會把文件送到 ClicheFactory 雲端服務進行擷取,請留意文件敏感性。API 金鑰屬於機密,不要放進共用設定。本機模式會把文件內容送給你選擇的 LLM 供應商。擷取會消耗服務頁數,超出免費額度後可能收費。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 ClicheFactory Document Intelligence,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

clichefactory-mcp

MCP (Model Context Protocol) server for ClicheFactory — structured data extraction from documents.

This server exposes ClicheFactory's extraction and document conversion capabilities as MCP tools, allowing AI assistants in Cursor, Claude Desktop, OpenClaw, and other MCP-compatible clients to extract structured data from PDFs, images, DOCX, XLSX, CSV, EML, and more.

Quick start (recommended — service mode)

Service mode uses the ClicheFactory cloud for the best extraction quality. You only need one API key.

  1. Sign up at clichefactory.com — free pages included, no credit card required.

  2. Create an API key in Settings → API Keys (format: cliche-...).

  3. Install the MCP server:

    bash
    pip install clichefactory-mcp
  4. Configure — either paste the key into your MCP client (see below) or run once in a terminal:

    bash
    pip install clichefactory   # if you don't have the CLI yetclichefactory configure

    The interactive wizard saves credentials to ~/.clichefactory/config.toml, which the MCP server reads automatically.

That's it — one env var (CLICHEFACTORY_API_KEY) or a config file, and you're on hosted extraction.

Tools

ToolDescription
extractExtract structured JSON from a document using a schema
to_markdownConvert a document to markdown text
doctorCheck configuration, dependencies, and system binaries

extract

The main tool. Pass a document file and a JSON schema — get structured data back.

Supports all extraction modes:

ModeDescriptionRequires
(default)OCR + LLM extractionService API key (recommended)
fastFastest pipelineService API key
trainedTrained pipeline artifactService + artifact_id
robustTwo-stage extract + verifyService only
robust-trainedTrained extract + verificationService + artifact_id

The schema can be provided as:

  • File path: absolute path to a .json schema file
  • Inline dict: the LLM constructs a JSON schema from the conversation (e.g., the user says "extract the invoice number and total" and the LLM builds {"type": "object", "properties": {"invoice_number": {"type": "string"}, "total": {"type": "number"}}})

to_markdown

Converts any supported document to markdown. Useful for inspecting document contents or feeding them to the LLM for analysis before deciding on an extraction schema.

doctor

Runs diagnostics on the ClicheFactory setup — config file, API keys, Python dependencies, system binaries. Call this when things aren't working.

Execution Modes

The server defaults to service mode (ClicheFactory cloud). Local mode is available for BYOK / air-gapped use.

  • service (recommended) — Uses the ClicheFactory cloud service. Requires a ClicheFactory API key. Supports all extraction modes including trained pipelines and robust verification. Best extraction quality out of the box.

  • local (advanced) — Runs extraction on your machine. You bring your own LLM key (BYOK). Requires pip install "clichefactory-mcp[local]" (~2 GB of parsing/OCR dependencies) plus system binaries (tesseract, LibreOffice). Quality depends on your local setup.

Installation

Prerequisites

  • Python ≥ 3.12
  • uv (recommended) or pip

From PyPI

bash
pip install clichefactory-mcp

For local-mode extraction (BYOK, runs on your machine), install with the local extras:

bash
pip install "clichefactory-mcp[local]"

Configuration

Environment Variables

Set these in your MCP client configuration (see below) or in ~/.clichefactory/config.toml via clichefactory configure.

VariableRequiredDescription
CLICHEFACTORY_API_KEYYes (service mode)ClicheFactory API key from Settings → API Keys (cliche-...)
CLICHEFACTORY_API_URLNoOverride the default service URL (https://api.clichefactory.com); useful for local development against a self-hosted ClicheFactory backend
LLM_MODEL_NAMELocal mode onlyModel name, e.g. gemini/gemini-3-flash-preview
LLM_API_KEYLocal mode onlyAPI key for the LLM provider
OCR_MODEL_NAMENoSeparate OCR/VLM model (defaults to main model)
OCR_API_KEYNoAPI key for OCR model (defaults to main key)

Environment variables take precedence over the config file at ~/.clichefactory/config.toml.

Cursor

Add to .cursor/mcp.json in your project (or global Cursor settings):

json
{  "mcpServers": {    "clichefactory": {      "command": "uvx",      "args": ["clichefactory-mcp"],      "env": {        "CLICHEFACTORY_API_KEY": "cliche-your-key-here"      }    }  }}

For local development from a git checkout, replace uvx with:

json
"command": "uv","args": ["--directory", "/absolute/path/to/cliche-mcp", "run", "clichefactory-mcp"]

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "clichefactory": {      "command": "uvx",      "args": ["clichefactory-mcp"],      "env": {        "CLICHEFACTORY_API_KEY": "cliche-your-key-here"      }    }  }}

OpenClaw

Register the MCP server with your OpenClaw agent:

bash
openclaw mcp set clichefactory '{"command":"uvx","args":["clichefactory-mcp"],"env":{"CLICHEFACTORY_API_KEY":"cliche-your-key-here"}}'

Verify with openclaw mcp list. The agent can now use extract, to_markdown, and doctor tools in any conversation.

An OpenClaw skill with agent instructions is also available in integrations/openclaw/. To install it into your workspace:

bash
cp -r /path/to/cliche-mcp/integrations/openclaw ~/.openclaw/skills/clichefactory

Or, once published to ClawHub:

bash
openclaw skills install clichefactory

Local mode (advanced)

If you prefer BYOK extraction on your machine, install the local extras and set LLM credentials:

json
{  "mcpServers": {    "clichefactory": {      "command": "uvx",      "args": ["clichefactory-mcp"],      "env": {        "LLM_MODEL_NAME": "gemini/gemini-3-flash-preview",        "LLM_API_KEY": "your-gemini-api-key"      }    }  }}

Pass mode="local" explicitly in tool calls, or run clichefactory configure --local to set local as the default in ~/.clichefactory/config.toml.

Supported File Types

PDF, PNG, JPG, JPEG, WebP, GIF, BMP, DOCX, DOC, ODT, XLSX, CSV, EML, TXT, MD.

Differences from the CLI

This MCP server covers the core extraction and conversion workflows. The following CLI features are not included in v1:

FeatureReason
Batch operations (extract-batch, to-markdown-batch)MCP tools are typically called one-at-a-time by the LLM. For multiple documents, the LLM calls extract in sequence. Batch support may be added in a future version.
configureInteractive prompts don't work in MCP. Use env vars or run clichefactory configure in a terminal.
--output / -o flagMCP tools return results directly to the LLM rather than writing to files.
allow_partialNot exposed as a tool parameter in v1.
OCR engine selectionUses the SDK defaults (RapidOCR). Configure via ~/.clichefactory/config.toml or pass parsing options through the SDK if needed.

Development

bash
# Install in development modeuv sync
# Run the server directly (stdio transport, for testing with MCP clients)uv run clichefactory-mcp
# Inspect available tools (requires mcp CLI)uv run mcp dev cliche_mcp/server.py

License

MIT — Copyright (c) 2026 Urban Susnik s.p.

來源:README.md,提交 c53d822

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.8最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分