clichefactory-mcp
MCP server for ClicheFactory, enabling structured data extraction from documents such as PDFs, images, and office files via AI assistants.
README
clichefactory-mcp
<!-- mcp-name: io.github.ClicheFactory/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.
-
Sign up at clichefactory.com — free pages included, no credit card required.
-
Create an API key in Settings → API Keys (format:
cliche-...). -
Install the MCP server:
pip install clichefactory-mcp -
Configure — either paste the key into your MCP client (see below) or run once in a terminal:
pip install clichefactory # if you don't have the CLI yet clichefactory configureThe 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
| Tool | Description |
|---|---|
extract |
Extract structured JSON from a document using a schema |
to_markdown |
Convert a document to markdown text |
doctor |
Check 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:
| Mode | Description | Requires |
|---|---|---|
| (default) | OCR + LLM extraction | Service API key (recommended) |
fast |
Fastest pipeline | Service API key |
trained |
Trained pipeline artifact | Service + artifact_id |
robust |
Two-stage extract + verify | Service only |
robust-trained |
Trained extract + verification | Service + artifact_id |
The schema can be provided as:
- File path: absolute path to a
.jsonschema 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). Requirespip 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
pip install clichefactory-mcp
For local-mode extraction (BYOK, runs on your machine), install with the local extras:
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.
| Variable | Required | Description |
|---|---|---|
CLICHEFACTORY_API_KEY |
Yes (service mode) | ClicheFactory API key from Settings → API Keys (cliche-...) |
CLICHEFACTORY_API_URL |
No | Override the default service URL (https://api.clichefactory.com); useful for local development against a self-hosted ClicheFactory backend |
LLM_MODEL_NAME |
Local mode only | Model name, e.g. gemini/gemini-3-flash-preview |
LLM_API_KEY |
Local mode only | API key for the LLM provider |
OCR_MODEL_NAME |
No | Separate OCR/VLM model (defaults to main model) |
OCR_API_KEY |
No | API 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):
{
"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:
"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):
{
"mcpServers": {
"clichefactory": {
"command": "uvx",
"args": ["clichefactory-mcp"],
"env": {
"CLICHEFACTORY_API_KEY": "cliche-your-key-here"
}
}
}
}
OpenClaw
Register the MCP server with your OpenClaw agent:
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:
cp -r /path/to/cliche-mcp/integrations/openclaw ~/.openclaw/skills/clichefactory
Or, once published to ClawHub:
openclaw skills install clichefactory
Local mode (advanced)
If you prefer BYOK extraction on your machine, install the local extras and set LLM credentials:
{
"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:
| Feature | Reason |
|---|---|
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. |
configure |
Interactive prompts don't work in MCP. Use env vars or run clichefactory configure in a terminal. |
--output / -o flag |
MCP tools return results directly to the LLM rather than writing to files. |
allow_partial |
Not exposed as a tool parameter in v1. |
| OCR engine selection | Uses the SDK defaults (RapidOCR). Configure via ~/.clichefactory/config.toml or pass parsing options through the SDK if needed. |
Development
# Install in development mode
uv 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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。