mcpField
N
nutrient-document-processing

nutrient-document-processing

github.com/xu-xiangドキュメント2.0k39 回インストール34 週間前に更新
リポジトリ

nutrient-document-processing について

Nutrient DWS Processor APIで文書を処理する開発者向けのスキルです。形式変換や抽出、OCR、墨消し、透かし、署名、PDFフォーム入力に対応し、APIリクエストまたは記載のMCPサーバー連携を扱います。

主な機能

  1. 01複数の文書形式を変換
  2. 02テキスト・表・キーと値を抽出
  3. 03スキャン文書にOCRを実行
  4. 04プリセットや正規表現で情報を墨消し
  5. 05透かしとデジタル署名を追加
  6. 06PDFフォームに入力

活用シーン

  1. 01DOCXをPDFに変換
  2. 02PDFから表データを抽出
  3. 03スキャン文書を検索可能にする
  4. 04共有前に個人情報を除去

MCP 対応

READMEでは、curlの代わりに`@nutrient-sdk/dws-mcp-server`を使ったネイティブなツール連携を案内しています。設定例にはAPIキーと作業ディレクトリが含まれます。

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/xu-xiang/everything-claude-code-zh --skill nutrient-document-processing

インストール後、Claude Code で/nutrient-document-processingを入力して読み込まれたか確認します。

詳細

Nutrient ドキュメント処理(Nutrient Document Processing)

Nutrient DWS Processor API を使用してドキュメントを処理します。形式の変換、テキストや表の抽出、スキャンしたドキュメントの OCR(光学文字認識)、個人識別情報(PII)の墨消し、透かしの追加、デジタル署名、PDF フォームの入力ができます。

セットアップ(Setup)

nutrient.io で無料の API キーを取得します。

export NUTRIENT_API_KEY="pdf_live_..."

すべてのリクエストは、https://api.nutrient.io/build に multipart POST として送信し、instructions JSON フィールドを含めます。

操作(Operations)

ドキュメントを変換する(Convert Documents)
# DOCX 转 PDF
curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer $NUTRIENT_API_KEY" \
  -F "[email protected]" \
  -F 'instructions={"parts":[{"file":"document.docx"}]}' \
  -o output.pdf

# PDF 转 DOCX
curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer $NUTRIENT_API_KEY" \
  -F "[email protected]" \
  -F 'instructions={"parts":[{"file":"document.pdf"}],"output":{"type":"docx"}}' \
  -o output.docx

# HTML 转 PDF
curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer $NUTRIENT_API_KEY" \
  -F "[email protected]" \
  -F 'instructions={"parts":[{"html":"index.html"}]}' \
  -o output.pdf

対応している入力形式:PDF, DOCX, XLSX, PPTX, DOC, XLS, PPT, PPS, PPSX, ODT, RTF, HTML, JPG, PNG, TIFF, HEIC, GIF, WebP, SVG, TGA, EPS。

テキストとデータを抽出する(Extract Text and Data)
# 提取纯文本
curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer $NUTRIENT_API_KEY" \
  -F "[email protected]" \
  -F 'instructions={"parts":[{"file":"document.pdf"}],"output":{"type":"text"}}' \
  -o output.txt

# 将表格提取为 Excel
curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer $NUTRIENT_API_KEY" \
  -F "[email protected]" \
  -F 'instructions={"parts":[{"file":"document.pdf"}],"output":{"type":"xlsx"}}' \
  -o tables.xlsx
スキャンしたドキュメントを OCR 処理する(OCR Scanned Documents)
# OCR 转为可搜索的 PDF(支持 100 多种语言)
curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer $NUTRIENT_API_KEY" \
  -F "[email protected]" \
  -F 'instructions={"parts":[{"file":"scanned.pdf"}],"actions":[{"type":"ocr","language":"english"}]}' \
  -o searchable.pdf

言語:100 以上の言語に対応しており、ISO 639-2 コードで指定します(例:eng, deu, fra, spa, jpn, kor, chi_sim, chi_tra, ara, hin, rus)。english や german など、言語の正式名称も使用できます。対応しているすべてのコードについては、OCR 言語の完全な対応表をご覧ください。

機密情報を墨消しする(Redact Sensitive Information)
# 基于模式(SSN, 电子邮件)
curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer $NUTRIENT_API_KEY" \
  -F "[email protected]" \
  -F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"redaction","strategy":"preset","strategyOptions":{"preset":"social-security-number"}},{"type":"redaction","strategy":"preset","strategyOptions":{"preset":"email-address"}}]}' \
  -o redacted.pdf

# 基于正则表达式
curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer $NUTRIENT_API_KEY" \
  -F "[email protected]" \
  -F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"redaction","strategy":"regex","strategyOptions":{"regex":"\\b[A-Z]{2}\\d{6}\\b"}}]}' \
  -o redacted.pdf

プリセット(Presets):social-security-number, email-address, credit-card-number, international-phone-number, north-american-phone-number, date, time, url, ipv4, ipv6, mac-address, us-zip-code, vin。

透かしを追加する(Add Watermarks)
curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer $NUTRIENT_API_KEY" \
  -F "[email protected]" \
  -F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"watermark","text":"CONFIDENTIAL","fontSize":72,"opacity":0.3,"rotation":-45}]}' \
  -o watermarked.pdf
デジタル署名(Digital Signatures)
# 自签名 CMS 签名
curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer $NUTRIENT_API_KEY" \
  -F "[email protected]" \
  -F 'instructions={"parts":[{"file":"document.pdf"}],"actions":[{"type":"sign","signatureType":"cms"}]}' \
  -o signed.pdf
PDF フォームに入力する(Fill PDF Forms)
curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer $NUTRIENT_API_KEY" \
  -F "[email protected]" \
  -F 'instructions={"parts":[{"file":"form.pdf"}],"actions":[{"type":"fillForm","formFields":{"name":"Jane Smith","email":"[email protected]","date":"2026-02-06"}}]}' \
  -o filled.pdf

MCP サーバー(代替手段)

ネイティブなツール統合には、curl の代わりに MCP サーバーを使用できます。

{
  "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"
      }
    }
  }
}

使用する場面

  • 異なる形式間でドキュメントを変換する(PDF, DOCX, XLSX, PPTX, HTML, 画像)
  • PDF からテキスト、表、またはキーと値のペアを抽出する
  • スキャンしたドキュメントや画像に OCR を実行する
  • ドキュメントを共有する前に個人識別情報(PII)を墨消しする
  • 草案や機密文書に透かしを追加する
  • 契約書や合意書にデジタル署名する
  • プログラムから PDF フォームに入力する

リンク(Links)

コメント