Skip to main content
Glama

hwp-mcp

Claude · Cursor · ChatGPTなどのMCP互換AIで、韓国語ワープロ文書(.hwp / .hwpx) を読み込み、修正し、新規作成できるようにするサーバーです。

npm version npm downloads Built on rhwp License: MIT GitHub release

hwp-mcpは、AIエージェントが直接Hancom Office文書を扱えるようにするMCP(Model Context Protocol)サーバーです。読み込みだけでなく、テキストの修正、テンプレートの入力、新規文書の作成まで可能です。

どのようなプロジェクトですか?

このプロジェクトは2つの部分に分かれています。

  • 🔧 rhwpの役割(コアエンジン) — Edward Kim 氏の rhwp は、クローズドな韓国語フォーマット(HWP 5.0 binary, HWPX/OWPML)をすべてリバースエンジニアリングで解析し、Rust + WebAssemblyで実装したオープンソースエンジンです。パース、表・画像・数式・ヘッダーの抽出、SVGレンダリング、Hancom互換Field APIなど、すべての核心的な能力はrhwpが提供します。rhwpがなければ、このプロジェクトも存在しません。

  • 🤝 hwp-mcpの役割(エージェントアダプター) — @rhwp/coreの上に構築された軽量なMCPサーバーレイヤーです。私たちが追加したのは以下の通りです:

    • read_hwp, fill_hwp_template, replace_hwp_text のようなエージェントフレンドリーなツールシグネチャ — Claude/CursorのようなLLMが自然言語で呼び出せるようにするため

    • 本文・表・画像・ヘッダー・フッター・脚注・数式を一度にダンプするシナリオ中心のトラバーサルウォーカー

    • 表のセル結合の自動処理、脚注/数式の自動統合といった使いやすさ向上のレイヤー

    • rhwp 0.7.7の exportHwpx ラウンドトリップの限界を回避するための**.hwpx ZIPレベルのミューテーションレイヤー**(実際の書き込みを可能にする核心)

    • npm hwp-mcp パッケージ(ワンラインインストール) + Node.js WASMブートストラップ

要約:AIが韓国語文書を実際に読み書きできるようにするアダプターです。すべてのオープンな韓国語処理能力に対する感謝は、rhwpプロジェクトにお送りください 🙏


Related MCP server: HWP-MCP

インストール

Claude Code

claude mcp add hwp-mcp -- npx -y hwp-mcp

Claude Desktop / Cursor / VS Code (settings JSON)

{
  "mcpServers": {
    "hwp-mcp": {
      "command": "npx",
      "args": ["-y", "hwp-mcp"]
    }
  }
}

Node.js 20以上が必要です。


ツール一覧

hwp-mcp v0.2が公開する34個のMCPツールです。読み込み・レンダリングは.hwp/.hwpxの両方をサポートし、書き込みは.hwpx専用です。

読み込み (5)

ツール

.hwp

.hwpx

説明

read_hwp

✅

✅

本文 + 表(Markdown) + 画像リストを一括取得

read_hwp_text

✅

✅

本文 + ヘッダー + フッター + 脚注 + 数式の統合テキスト

read_hwp_tables

✅

✅

表をGitHub Markdown形式に変換(セル結合処理)

list_hwp_images

✅

✅

埋め込み画像リスト(mime, バイト)

extract_hwp_images

✅

✅

画像をディスクに抽出

メタ / 照会 (5)

ツール

.hwp

.hwpx

説明

get_hwp_info

✅

✅

バージョン・ページ・フォント・表/画像/脚注/数式の統計

get_hwp_page_def

✅

✅

セクション別の用紙サイズ・余白・段・ヘッダー/フッターマージン

list_hwp_fields

✅

✅

Hancomフィールドリスト

get_hwp_field_value

✅

✅

フィールド値の照会

list_hwp_bindata

–

✅

.hwpx BinData/ エントリリスト

視覚レンダリング (4)

ツール

.hwp

.hwpx

説明

render_hwp_page

✅

✅

特定ページ → SVG(インライン/ファイル)

render_hwp_all_pages

✅

✅

全ページSVG一括変換

render_hwp_html

✅

✅

ページ → HTML

render_hwp_equation_svg

–

–

OWPML数式スクリプト → SVG

書き込み — テキスト (5)

ツール

.hwpx

説明

replace_hwp_text

✅

特定文字列の検索・置換

fill_hwp_template

✅

{{名前}} などの複数プレースホルダーの埋め込み

set_hwp_paragraph_text

✅

N番目の段落テキストを丸ごと置換

set_hwp_cell_text

✅

表のセル(行, 列)テキストを直接設定

set_hwp_field_value

✅

フィールド値の設定

書き込み — 構造 (9)

ツール

.hwpx

説明

append_hwp_paragraph

✅

本文の最後に新しい段落を追加

delete_hwp_paragraph

✅

N番目の段落を削除

append_hwp_table_row

✅

表の最後に新しい行を追加

delete_hwp_table_row

✅

表の行を削除

append_hwp_table_column

✅

表の最後に新しい列を追加(全行に対して)

delete_hwp_table_column

✅

表の列を削除

merge_hwp_cells_horizontal

✅

横方向のセル結合 (colSpan)

merge_hwp_cells_vertical

✅

縦方向のセル結合 (rowSpan)

replace_hwp_image

✅

埋め込み画像の置換

書き込み — 書式 (2)

ツール

.hwpx

説明

apply_hwp_text_style

✅

文字色・太字・斜体・下線・サイズ (charPr追加)

apply_hwp_paragraph_style

✅

段落の配置・インデント・行間 (paraPr追加)

書き込み — 画像 / 表 / 新規 (4)

ツール

.hwpx

説明

insert_hwp_image

✅

新しい画像の追加 (BinData + manifest + <hp:pic>)

delete_hwp_image

✅

BinData/ エントリの削除

insert_hwp_table

⚠️

新しいOWPML表の挿入(実験的 — ファイルは有効だがrhwpの認識が不完全)

create_hwpx_document

✅

テキストから新しい .hwpx を作成

コンテンツ抽出マトリックス

コンテンツ

抽出

備考

本文段落テキスト

✅

read_hwp_text, read_hwp

表(セル結合含む)

✅

read_hwp_tables がMarkdown形式で出力

埋め込み画像

✅

PNG/JPG/BMPなどを抽出

ヘッダー / フッター

✅

read_hwp_text 結果に --- headers --- / --- footers --- ブロック

脚注(footnote)

✅

結果の最後に --- footnotes --- ブロック、[1] 本文… 形式

数式(equation)

✅

OWPMLスクリプト形式 (例: TIMES LEFT ( {a} over {b} RIGHT )), --- equations --- ブロック

ページSVGレンダリング

✅

render_hwp_page

テキストボックス本文

❌

rhwpの createShapeControl は作成するが getTextBoxControlIndex の返却パターンが非明示的 — v0.3でトレース

文末脚注(endnote)

–

rhwp自体が未サポート(脚注のみ)

チャート(chart)

❌

v0.3以降

作成マトリックス

作業

.hwp

.hwpx

備考

テキスト単一置換

❌

✅

replace_hwp_text

複数プレースホルダー埋め込み

❌

✅

fill_hwp_template

段落テキスト丸ごと置換

❌

✅

set_hwp_paragraph_text

表セル直接修正

❌

✅

set_hwp_cell_text (行・列指定)

フィールド値設定

❌

✅

set_hwp_field_value

新規段落追加 / 削除

❌

✅

append_hwp_paragraph / delete_hwp_paragraph

表行追加 / 削除

❌

✅

append_hwp_table_row / delete_hwp_table_row

画像置換 / 削除

❌

✅

replace_hwp_image / delete_hwp_image

新規文書作成 (テキスト)

–

✅

create_hwpx_document

新規文書作成 (表)

–

⚠️

テキスト行としてフラット化(v0.3で本格的なOWPML表)

新規画像挿入

❌

✅

insert_hwp_image

表列追加 / 削除

❌

✅

append_hwp_table_column / delete_hwp_table_column

セル結合 (横・縦)

❌

✅

merge_hwp_cells_horizontal / merge_hwp_cells_vertical

文字書式 (色・太字・斜体・下線・サイズ)

❌

✅

apply_hwp_text_style

段落書式 (配置・インデント・行間)

❌

✅

apply_hwp_paragraph_style

新規表挿入 (本格的なOWPML)

❌

⚠️

insert_hwp_table (実験的)

ヘッダー/フッター新規挿入

❌

❌

v0.3

チャート・ブックマーク・スタイル定義

❌

❌

v0.3

.hwp バイナリの書き込みは、rhwp 0.7.7の exportHwp ラウンドトリップの限界によりv0.2では未サポートです。Hancom Officeで .hwpx として名前を付けて保存してから書き込みツールを使用するか、v0.3のリリースをお待ちください。


使用例

政府の韓国語文書の読み込み

나: /Users/me/2026년_시행계획.hwpx 읽어줘

AI: # 2026년_시행계획.hwpx
    형식: .HWPX | 문단: 153개 | 표: 15개 | 이미지: 2개

    Ⅰ. 추진 배경
    □ (글로벌 현황) 전세계 AI 솔루션 시장 규모는 ...

    ### 표 9 (7행 x 4열)
    | 도메인 | 입력 데이터 | 학습 내용 | 산업AI 솔루션 적용 기능 예시 |
    | --- | --- | --- | --- |
    | 기계 | · 센서 데이터 로그 ... | ... | ... |

テンプレートの埋め込み

나: /path/to/form.hwpx 에서 {{이름}}=남대현, {{회사}}=포텐랩 으로 채워줘

AI: 저장 완료 (saved): form_filled.hwpx
    총 2건 치환 (2 replacements)
      '{{이름}}' → 1건
      '{{회사}}' → 1건

テキスト置換

나: /path/to/doc.hwpx 의 "산업AI" 를 "산업-AI" 로 바꿔줘

AI: '산업AI' → '산업-AI': 18건 교체 (replaced 18)
    저장 (saved): doc_modified.hwpx

新規 .hwpx の作成

나: employees.hwpx 에 "사원 명부" 와 "두 번째 줄" 두 줄을 가진 문서 만들어줘

AI: HWPX 문서 생성 완료 (created): employees.hwpx

画像抽出

나: /path/to/document.hwpx 에서 이미지 빼줘

AI: 이미지 2개를 추출했습니다 (extracted 2 images):
    저장 위치: /path/to/document_images
      - image_001.bmp
      - image_002.bmp

ページをSVGとしてレンダリング(視覚分析用)

나: /path/to/document.hwpx 의 첫 페이지를 SVG로 보여줘

AI: <svg xmlns="..." width="793" height="1122" viewBox="...">
    <defs>...</defs>
    ...
    </svg>

またはディスクに保存:

나: /path/to/document.hwpx 모든 페이지 SVG로 저장해줘

AI: 9/9 페이지 SVG 저장 (rendered 9/9 pages):
    저장 위치: /path/to/document_pages
      - page_001.svg
      - page_002.svg ...

制限事項

hwp-mcp v0.2の既知の制約事項です。

  • .hwp 書き込み未サポート — 読み込みは .hwp/.hwpx 両方可能です。書き込みは .hwpx のみです。.hwp 入力に対して書き込みツールを呼び出すと、明確なエラーメッセージを返します。Hancom Officeで .hwpx として名前を付けて保存してから使用するか、v0.3のリリースをお待ちください。

  • クロスフォーマット保存の拒否 — .hwpx 入力は .hwpx としてのみ保存されます。

  • ヘッダー/フッター/脚注は抽出可能、テキストボックス/文末脚注/数式はv0.3 — read_hwp_text の結果において、ヘッダーは --- headers ---、フッターは --- footers ---、脚注は --- footnotes --- ブロックとして表示されます。テキストボックス本文、文末脚注、数式の抽出はv0.3予定です。

  • 検索語が2つのテキストノードにまたがる場合はマッチング不可 — 例:1つの <hp:t> が「産業」で終わり、次が「AI」で始まる場合、「産業AI」はマッチングしません。これはHancomのhwpctlと同じ制限です。

  • create_hwpx_document の表はv0.2ではテキスト行としてフラット化 — 本格的なOWPML表はv0.3で対応予定です。


どのように動作しますか?

  • 読み込み: @rhwp/core (rhwpのRust+WASMパーサー) がセクション・段落・表(結合セル含む)・画像をトラバースします。

  • 書き込み (.hwpx): ZIPアーカイブ内の Contents/section*.xml を直接パースして <hp:t> テキストノードを検索/置換した後、再パッケージ化します(mimetypeは仕様通りstored)。rhwpの exportHwpx() ラウンドトリップ問題を回避するためのレイヤーです。

  • 新規文書: rhwpの createBlankDocument + insertText で作成した後、exportHwpx で保存します(テキストのラウンドトリップが安定しているため)。

クレジット

rhwp (@edwardkim) — 核心的なパーサー・レンダラー・Field API。クローズドな韓国語フォーマットをオープンにしたすべての作業が、このプロジェクトの土台です。可能であれば、そのプロジェクトも応援してください: https://github.com/edwardkim/rhwp

hwp-mcp — rhwpの上にAIエージェントが自然言語で呼び出せるようにツール化した軽量なMCPアダプター。核心的な能力はすべてrhwpのものであり、私たちはそれをLLMに接続する配線(wiring)を行っています。

カバレッジ

領域

カバー率

読み込み/抽出

~90%

レンダリング

~85% (SVG · HTML · 数式SVG · Canvasはブラウザ用のため除外)

書き込み — テキスト

~95%

書き込み — 構造

~90% (行・列・結合・画像4種)

書き込み — 書式

~70% (文字 + 段落)

メタ / フィールド

~85%

全体加重

~85%

残りのv0.3の大きな項目:.hwp バイナリ書き込み、チャート、スタイル定義・適用、テキストボックス本文抽出、hwpctl 30 Actions(意図的に除外)。

English

hwp-mcp is an MCP server for reading and writing Korean Hangul (.hwp / .hwpx) documents from Claude / Cursor / ChatGPT and any MCP-compatible client. Read works for both formats; write currently supports .hwpx (find/replace, template fill, create new doc) — .hwp write is planned for v0.3. Built on top of rhwp (Rust + WebAssembly HWP engine by Edward Kim, MIT). Install: claude mcp add hwp-mcp -- npx -y hwp-mcp.

License

MIT.

Available Tools

34 tools
append_hwp_paragraphA

Append a new paragraph to the end of an .hwpx document body. Clones the last paragraph's structure (paraPr/charPr/style refs) and replaces text. Args: file_path, text, output_path (optional).

Inputs: file_path (required), text (required), output_path.

append_hwp_table_columnB

Append a new column to the Nth table in an .hwpx. cells is a JSON string array of cell texts (one per row, top-to-bottom). Args: file_path, table_index, cells, output_path (optional).

Inputs: file_path (required), table_index (required), cells (required), output_path.

append_hwp_table_rowB

Append a new row to the Nth table (0-based) in an .hwpx. cells is a JSON string array of cell texts (length should match table column count). Args: file_path, table_index, cells, output_path (optional).

Inputs: file_path (required), table_index (required), cells (required), output_path.

apply_hwp_paragraph_styleA

Apply paragraph formatting (alignment·indent·line_spacing) to the Nth paragraph in an .hwpx. Adds a new paraPr to header.xml and retargets the paragraph's paraPrIDRef. align: LEFT|CENTER|RIGHT|JUSTIFY|DISTRIBUTE. Args: file_path, paragraph_index, align/indent/line_spacing (any subset), output_path (optional).

Inputs: file_path (required), paragraph_index (required), align, indent, +2 more.

apply_hwp_text_styleA

Apply formatting (color/bold/italic/underline/font_size) to the first run that contains target_text. Adds a new charPr to header.xml and retargets the matching hp:run. Color is a 6-digit hex (e.g. 'FF0000'). Args: file_path, target_text, color/bold/italic/underline/font_size (any subset), output_path (optional).

Inputs: file_path (required), target_text (required), color, bold, +4 more.

create_hwpx_documentA

Create a new .hwpx file from a JSON content list of {type:'text',text} items. Tables (type:'table',headers,rows) are rendered as flat text rows in v0.2. Args: output_path (must end with .hwpx), content (JSON string of items).

Inputs: output_path (required), content (required).

delete_hwp_imageB

Delete a BinData/ ZIP entry inside an .hwpx (effectively removes the embedded image bytes). Args: file_path, target (basename or full entry), output_path (optional).

Inputs: file_path (required), target (required), output_path.

delete_hwp_paragraphB

Delete the Nth paragraph (0-based) from an .hwpx body. Args: file_path, index, output_path (optional).

Inputs: file_path (required), index (required), output_path.

delete_hwp_table_columnB

Delete the Mth column (0-based) from the Nth table in an .hwpx (removes one hp:tc from every row). Args: file_path, table_index, col_index, output_path (optional).

Inputs: file_path (required), table_index (required), col_index (required), output_path.

delete_hwp_table_rowC

Delete the Mth row (0-based) from the Nth table (0-based) in an .hwpx. Args: file_path, table_index, row_index, output_path (optional).

Inputs: file_path (required), table_index (required), row_index (required), output_path.

extract_hwp_imagesA

Save every embedded image to disk. Args: file_path, output_dir (optional; defaults to _images/).

Inputs: file_path (required), output_dir.

fill_hwp_templateC

Fill multiple placeholders in an HWPX template. replacements is a JSON object string, e.g. {"{{name}}":"Kim","{{company}}":"Acme"}. v0.2: .hwpx only. Args: file_path, replacements, output_path (optional).

Inputs: file_path (required), replacements (required), output_path.

get_hwp_field_valueB

Get a Hancom field's current value by name. Args: file_path, name.

Inputs: file_path (required), name (required).

get_hwp_infoC

Get document metadata (version, page count, section count, fonts used, totals for tables/images/footnotes/equations/headers/footers). Args: file_path.

Inputs: file_path (required).

get_hwp_page_defB

Get per-section page definition (paper size, margins, columns) and section properties. Useful for understanding document layout. Args: file_path.

Inputs: file_path (required).

insert_hwp_imageA

Insert a new image into an .hwpx — adds the file to BinData/, registers it in content.hpf, and appends a paragraph with an inline hp:pic. Args: file_path, source_path, ext (png/jpg/bmp/gif; auto from source_path if omitted), output_path (optional).

Inputs: file_path (required), source_path (required), ext, output_path.

insert_hwp_tableB

Insert a real OWPML table at the end of an .hwpx body (proper hp:tbl/hp:tr/hp:tc). headers and rows are both JSON string arrays — headers is a single-row array of strings, rows is an array of row arrays. Args: file_path, headers, rows, output_path (optional).

Inputs: file_path (required), headers (required), rows (required), output_path.

list_hwp_bindataA

List ZIP entries under BinData/ inside an .hwpx (image and binary attachments). Useful before replace_hwp_image. Args: file_path.

Inputs: file_path (required).

list_hwp_fieldsA

List Hancom-style fields (<hp:fldBegin>/end pairs) in the document, with name and type when available. Useful before fill_hwp_template. Args: file_path.

Inputs: file_path (required).

list_hwp_imagesC

List embedded images (mime, byte length, locator) in an HWP/HWPX file. Args: file_path.

Inputs: file_path (required).

merge_hwp_cells_horizontalB

Merge horizontal cells in a row of a table by setting colSpan on the first cell and removing the absorbed cells. Args: file_path, table_index, row, col_start, col_count (>=2), output_path (optional).

Inputs: file_path (required), table_index (required), row (required), col_start (required), +2 more.

merge_hwp_cells_verticalC

Merge vertical cells across rows in a single column by setting rowSpan on the first cell and removing absorbed cells in following rows. Args: file_path, table_index, col, row_start, row_count (>=2), output_path (optional).

Inputs: file_path (required), table_index (required), col (required), row_start (required), +2 more.

read_hwpA

Read full HWP/HWPX document content as text + tables (markdown) + image listing. Args: file_path (absolute path).

Inputs: file_path (required).

read_hwp_tablesC

Extract every table from an HWP/HWPX file as GitHub-flavored markdown. Args: file_path.

Inputs: file_path (required).

read_hwp_textB

Extract plain body text from an HWP/HWPX file (no tables, no images). Args: file_path.

Inputs: file_path (required).

render_hwp_all_pagesA

Render every page of an HWP/HWPX as SVG files in a directory. Args: file_path, output_dir (default _pages/), max_pages (optional limit).

Inputs: file_path (required), output_dir, max_pages.

render_hwp_equation_svgA

Render an OWPML equation script (e.g. 'TIMES LEFT ( {a} over {b} RIGHT )') to SVG. Args: script, font_size (HWP units, default 1300), color (default 0).

Inputs: script (required), font_size, color.

render_hwp_htmlA

Render a single page of an HWP/HWPX as HTML. Useful for AI consumption when SVG isn't ideal. Args: file_path, page (0-based, default 0), output_path (optional).

Inputs: file_path (required), page, output_path.

render_hwp_pageA

Render a single page of an HWP/HWPX document as SVG. If output_path is omitted, the raw SVG string is returned inline (useful for direct LLM consumption). Args: file_path, page (0-based, default 0), output_path (optional).

Inputs: file_path (required), page, output_path.

replace_hwp_imageB

Replace an embedded image inside an .hwpx by overwriting its BinData/ ZIP entry with new file contents. target accepts either basename ('image1.bmp') or full entry path ('BinData/image1.bmp'). Args: file_path, target, source_path, output_path (optional).

Inputs: file_path (required), target (required), source_path (required), output_path.

replace_hwp_textB

Find and replace text in an HWPX file. v0.2: only .hwpx is supported as input/output. Args: file_path, old_text, new_text, output_path (optional).

Inputs: file_path (required), old_text (required), new_text (required), output_path.

set_hwp_cell_textC

Replace a single cell's text in a table inside an .hwpx. Args: file_path, table_index, row, col (all 0-based), text, output_path (optional).

Inputs: file_path (required), table_index (required), row (required), col (required), +2 more.

set_hwp_field_valueA

Set a Hancom field's value by name in an .hwpx (writes the new text between the matching <hp:fldBegin name=...> and <hp:fldEnd>). Use list_hwp_fields first to discover names. Args: file_path, name, value, output_path (optional).

Inputs: file_path (required), name (required), value (required), output_path.

set_hwp_paragraph_textA

Replace the entire text of the Nth paragraph (0-based) in an .hwpx body with new text. The paragraph attributes (paraPr/style refs) are preserved; runs are collapsed into a single hp:run with the new text. Args: file_path, index, text, output_path (optional).

Inputs: file_path (required), index (required), text (required), output_path.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 34 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose, targeting specific aspects of HWP/HWPX manipulation (paragraphs, tables, images, fields, etc.). Overlaps like read_hwp, read_hwp_text, and read_hwp_tables are clearly differentiated by their output focus.

    Naming Consistency5/5

    All tools follow a consistent verb_noun (or verb_noun_noun) snake_case pattern, such as append_hwp_paragraph, extract_hwp_images, set_hwp_cell_text. No mixing of conventions.

    Tool Count4/5

    34 tools is a large set, but given the complexity of the HWP format and the need for granular control over paragraphs, tables, images, fields, and rendering, the count is justified and not excessive.

    Completeness4/5

    The tool surface covers CRUD-like operations for paragraphs, tables, images, and fields, plus reading and rendering. Minor gaps exist (e.g., no explicit delete document), but the core workflow is well-supported.

    Maintenance

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      An MCP server that enables LLMs to convert HWP and HWPX documents into Markdown for analysis and processing. It supports document conversion via local file paths or Base64 content across various MCP-compatible clients.
      2
      -
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      An MCP server that enables AI models to control Hancom Office Hanword (HWP) documents on Windows. It allows for the automated creation, editing, and management of Korean word processor files, including text formatting and table manipulation.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server for reading, editing, and creating Hangul Word Processor (.hwpx) files. It enables users to extract text, perform find-and-replace operations, and modify font styles through automated XML patching.
      -