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 分