企业级文档处理与合规引擎
简介
Nutrient 官方文档处理 API,支持 PDF/Office 格式转换、OCR、PII 脱敏、数字签名等全流程操作,适合 Claude/Codex/Cursor 等 Agent 环境。
原始描述
Universal (non-OpenClaw) Nutrient DWS document-processing skill for Agent Skills-compatible products. Best for Claude Code, Codex CLI, Gemini CLI, Cursor, Wi...
通过你的 Agent 添加
安装目录:nutrient-document-processing/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心功能
Nutrient Document Processing 是一款面向 Agent 环境的通用文档处理技能,基于 Nutrient DWS Processor API 构建,提供从格式转换、内容提取到安全合规的全链条文档处理能力。
核心用法:
- MCP 模式(推荐):通过
npx @nutrient-sdk/dws-mcp-server启动 MCP 服务器,Agent 可直接调用原生工具(convert_to_pdf、redact、sign等) - Direct API 模式:使用 curl 直接访问
https://api.nutrient.io/build,通过 multipart POST 提交instructionsJSON 指令
显著优点:
- 格式覆盖全面:支持 PDF ↔ DOCX/XLSX/PPTX/HTML/图片的双向转换,以及 20+ 种语言的 OCR
- AI 驱动的智能处理:自然语言描述的 AI 脱敏("All personally identifiable information"),自动识别复杂 PII
- 企业级安全能力:数字签名(CMS/CAdES-B-LT)、水印、细粒度页面操作(merge/split/reorder)
- Agent 原生设计:OpenClaw 兼容,支持 Claude Code、Codex CLI、Gemini CLI、Cursor、Windsurf 等主流环境
潜在局限:
- 网络依赖:所有处理需上传至 Nutrient 云端 API,无法离线使用
- 成本敏感:按 credits 计费,AI 脱敏耗时 60–120 秒,批量操作需监控额度
- 文件大小限制:单文件 ≤100MB
- 数据出境考量:文档需上传至
api.nutrient.io,需评估合规性
适合人群:
- 需在 Agent 工作流中自动化文档处理的开发者
- 有 PDF 合规处理(签名、脱敏、水印)需求的企业法务/财务团队
- 构建 RAG 或文档分析管道的 AI 应用开发者
常规风险:
- API key 泄露风险:需妥善保管
NUTRIENT_API_KEY/NUTRIENT_DWS_API_KEY - 敏感数据外泄:处理含 PII 文档前需确认 Nutrient 数据处理政策
- 服务可用性:依赖 Nutrient 云服务稳定性
技能正文
name: nutrient-document-processing description: >- Universal (non-OpenClaw) Nutrient DWS document-processing skill for Agent Skills-compatible products. Best for Claude Code, Codex CLI, Gemini CLI, Cursor, Windsurf, OpenCode, and Copilot environments. Supports full workflows: convert PDF/Office/images, OCR, extract text/tables/key-values, redact PII (pattern + AI), watermark, digitally sign, form fill, merge/split/reorder pages, and API usage/credit checks. Prefers MCP server mode, with direct API/curl fallback. Activates on keywords: PDF, document, convert, extract, OCR, redact, watermark, sign, merge, split, compress, form fill, document processing, MCP. homepage: https://www.nutrient.io/api/ repository: https://github.com/PSPDFKit-labs/nutrient-agent-skill license: Apache-2.0 compatibility: >- Requires Node.js 18+ and an internet connection. Works with Claude Code, Codex CLI, Gemini CLI, OpenCode, Cursor, Windsurf, GitHub Copilot, Amp, or any Agent Skills-compatible product. Alternatively, use curl for direct API access without Node.js. metadata: { "openclaw": { "emoji": "📄", "requires": { "anyBins": ["npx", "curl"], "env": ["NUTRIENT_API_KEY", "NUTRIENT_DWS_API_KEY"], }, "install": [ { "id": "node", "kind": "node", "package": "@nutrient-sdk/dws-mcp-server", "label": "Install Nutrient DWS MCP Server (optional)", }, ], }, }
Nutrient Document Processing (Universal Agent Skill)
Best for Claude Code/Codex/Gemini/Cursor/Windsurf and other non-OpenClaw agents. Process, convert, extract, OCR, redact, sign, and manipulate documents using the Nutrient DWS Processor API.
Setup
You need a Nutrient DWS API key. Get one free at https://dashboard.nutrient.io/sign_up/?product=processor.
Option 1: MCP Server (Recommended)
If your agent supports MCP (Model Context Protocol), use the Nutrient DWS MCP Server. It provides all operations as native tools.
Configure your MCP client (e.g., claude_desktop_config.json or .mcp.json):
{
"mcpServers": {
"nutrient-dws": {
"command": "npx",
"args": ["-y", "@nutrient-sdk/dws-mcp-server"],
"env": {
"NUTRIENT_DWS_API_KEY": "YOUR_API_KEY",
"SANDBOX_PATH": "/path/to/working/directory"
}
}
}
}
Then use the MCP tools directly (e.g., convert_to_pdf, extract_text, redact, etc.).
Option 2: Direct API (curl)
For agents without MCP support, call the API directly:
export NUTRIENT_API_KEY="your_api_key_here"
All requests go to https://api.nutrient.io/build as multipart POST with an instructions JSON field.
Safety Boundaries
- This skill sends documents to the Nutrient DWS API (
api.nutrient.io) for processing. Documents may contain sensitive data — ensure your Nutrient account's data handling policies are acceptable. - It does NOT access local files beyond those explicitly passed for processing.
- It does NOT store API keys or credentials beyond the current session.
- MCP server mode (
npx @nutrient-sdk/dws-mcp-server) downloads the official Nutrient MCP server package from npm at runtime. - All API calls require an explicit API key — no anonymous access is possible.
Operations
1. Convert Documents
Convert between PDF, DOCX, XLSX, PPTX, HTML, and image formats.
HTML to PDF:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "index.html=@index.html" \
-F 'instructions={"parts":[{"html":"index.html"}]}' \
-o output.pdf
DOCX to PDF:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.docx=@document.docx" \
-F 'instructions={"parts":[{"file":"document.docx"}]}' \
-o output.pdf
PDF to DOCX/XLSX/PPTX:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"output":{"type":"docx"}}' \
-o output.docx
Image to PDF:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "image.jpg=@image.jpg" \
-F 'instructions={"parts":[{"file":"image.jpg"}]}' \
-o output.pdf
2. Extract Text and Data
Extract plain text:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"output":{"type":"text"}}' \
-o output.txt
Extract tables (as JSON, CSV, or Excel):
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"output":{"type":"xlsx"}}' \
-o tables.xlsx
Extract key-value pairs:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"extraction","strategy":"key-values"}]}' \
-o result.json
3. OCR Scanned Documents
Apply OCR to scanned PDFs or images, producing searchable PDFs with selectable text.
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "scanned.pdf=@scanned.pdf" \
-F 'instructions={"parts":[{"file":"scanned.pdf"}],"actions":[{"type":"ocr","language":"english"}]}' \
-o searchable.pdf
Supported languages: english, german, french, spanish, italian, portuguese, dutch, swedish, danish, norwegian, finnish, polish, czech, turkish, japanese, korean, chinese-simplified, chinese-traditional, arabic, hebrew, thai, hindi, russian, and more.
4. Redact Sensitive Information
Pattern-based redaction (preset patterns):
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"redaction","strategy":"preset","preset":"social-security-number"}]}' \
-o redacted.pdf
Available presets: social-security-number, credit-card-number, email-address, north-american-phone-number, international-phone-number, date, url, ipv4, ipv6, mac-address, us-zip-code, vin, time.
Regex-based redaction:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"redaction","strategy":"regex","regex":"\\b[A-Z]{2}\\d{6}\\b"}]}' \
-o redacted.pdf
AI-powered PII redaction:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"ai_redaction","criteria":"All personally identifiable information"}]}' \
-o redacted.pdf
The criteria field accepts natural language (e.g., "Names and phone numbers", "Protected health information", "Financial account numbers").
5. Add Watermarks
Text watermark:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"watermark","text":"CONFIDENTIAL","fontSize":48,"fontColor":"#FF0000","opacity":0.5,"rotation":45,"width":"50%","height":"50%"}]}' \
-o watermarked.pdf
Image watermark:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F "logo.png=@logo.png" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"watermark","imagePath":"logo.png","width":"30%","height":"30%","opacity":0.3}]}' \
-o watermarked.pdf
6. Digital Signatures
Sign a PDF with CMS signature:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"sign","signatureType":"cms","signerName":"John Doe","reason":"Approval","location":"New York"}]}' \
-o signed.pdf
Sign with CAdES-B-LT (long-term validation):
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"sign","signatureType":"cades","cadesLevel":"b-lt","signerName":"Jane Smith"}]}' \
-o signed.pdf
7. Form Filling (Instant JSON)
Fill PDF form fields using Instant JSON format:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "form.pdf=@form.pdf" \
-F 'instructions={"parts":[{"file":"form.pdf"}],"actions":[{"type":"fillForm","fields":[{"name":"firstName","value":"John"},{"name":"lastName","value":"Doe"},{"name":"email","value":"john@example.com"}]}]}' \
-o filled.pdf
8. Merge and Split PDFs
Merge multiple PDFs:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "doc1.pdf=@doc1.pdf" \
-F "doc2.pdf=@doc2.pdf" \
-F 'instructions={"parts":[{"file":"doc1.pdf"},{"file":"doc2.pdf"}]}' \
-o merged.pdf
Extract specific pages:
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf","pages":{"start":0,"end":4}}]}' \
-o pages1-5.pdf
9. Render PDF Pages as Images
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer $NUTRIENT_API_KEY" \
-F "document.pdf=@document.pdf" \
-F 'instructions={"parts":[{"file":"document.pdf","pages":{"start":0,"end":0}}],"output":{"type":"png","dpi":300}}' \
-o page1.png
10. Check Credits
curl -X GET https://api.nutrient.io/credits \
-H "Authorization: Bearer $NUTRIENT_API_KEY"
Best Practices
- Use the MCP server when your agent supports it — it handles file I/O, error handling, and sandboxing automatically.
- Set
SANDBOX_PATHto restrict file access to a specific directory. - Check credit balance before batch operations to avoid interruptions.
- Use AI redaction for complex PII detection; use preset/regex redaction for known patterns (faster, cheaper).
- Chain operations — the API supports multiple actions in a single call (e.g., OCR then redact).
Troubleshooting
| Issue | Solution |
|---|---|
| 401 Unauthorized | Check your API key is valid and has credits |
| 413 Payload Too Large | Files must be under 100 MB |
| Slow AI redaction | AI analysis takes 60–120 seconds; this is normal |
| OCR quality poor | Try a different language parameter or improve scan quality |
| Missing text in extraction | Run OCR first on scanned documents |
More Information
- Full API reference — Detailed endpoints, parameters, and error codes
- API Playground — Interactive API testing
- API Documentation — Official guides
- MCP Server repo — Source code and issues
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。