Skip to main content
Glama

hwp-mcp

A server that allows MCP-compatible AIs like Claude, Cursor, and ChatGPT to read, modify, and create Hangul documents (.hwp / .hwpx).

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

hwp-mcp is a Model Context Protocol (MCP) server that enables AI agents to directly handle Hancom Office documents. It supports not only reading, but also text modification, template filling, and creating new documents.

What is this project?

This project is divided into two parts:

  • πŸ”§ What rhwp did (Core Engine) β€” Edward Kim's rhwp is an open-source engine that reverse-engineered the closed Hangul formats (HWP 5.0 binary, HWPX/OWPML) and implemented them in Rust + WebAssembly. Parsing, extraction of tables, images, equations, and headers, SVG rendering, and Hancom-compatible Field API β€” all these core capabilities are provided by rhwp. Without rhwp, this project would not exist.

  • 🀝 What hwp-mcp did (Agent Adapter) β€” A thin MCP server layer built on top of @rhwp/core. What we added:

    • Agent-friendly tool signatures like read_hwp, fill_hwp_template, and replace_hwp_text β€” allowing LLMs like Claude/Cursor to call them in natural language.

    • A scenario-focused traversal walker that dumps body text, tables, images, headers, footers, footnotes, and equations all at once.

    • Usability layers such as automatic table cell merging and automatic footnote/equation consolidation.

    • A .hwpx ZIP-level mutation layer to bypass the round-trip limitations of rhwp 0.7.7's exportHwpx (the key to enabling actual writing).

    • The npm hwp-mcp package (one-line installation) + Node.js WASM bootstrap.

Summary: An adapter that allows AI to truly read and write Hangul documents. Please send all gratitude for the open Hangul capabilities to the rhwp project πŸ™


Related MCP server: HWP-MCP

Installation

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

Requires Node.js 20 or higher.


Tool List

These are the 34 MCP tools exposed by hwp-mcp v0.2. Reading/rendering supports both .hwp and .hwpx, while writing is exclusive to .hwpx.

Reading (5)

Tool

.hwp

.hwpx

Description

read_hwp

βœ…

βœ…

Body + Tables (Markdown) + Image list at once

read_hwp_text

βœ…

βœ…

Integrated text: Body + Headers + Footers + Footnotes + Equations

read_hwp_tables

βœ…

βœ…

Tables as GitHub Markdown (with cell merging)

list_hwp_images

βœ…

βœ…

List of embedded images (mime, bytes)

extract_hwp_images

βœ…

βœ…

Extract images to disk

Meta / Query (5)

Tool

.hwp

.hwpx

Description

get_hwp_info

βœ…

βœ…

Version, pages, fonts, stats for tables/images/footnotes/equations

get_hwp_page_def

βœ…

βœ…

Paper size, margins, columns, header/footer margins per section

list_hwp_fields

βœ…

βœ…

List of Hancom fields

get_hwp_field_value

βœ…

βœ…

Query field values

list_hwp_bindata

–

βœ…

List of .hwpx BinData/ entries

Visual Rendering (4)

Tool

.hwp

.hwpx

Description

render_hwp_page

βœ…

βœ…

Specific page β†’ SVG (inline/file)

render_hwp_all_pages

βœ…

βœ…

Batch SVG for all pages

render_hwp_html

βœ…

βœ…

Page β†’ HTML

render_hwp_equation_svg

–

–

OWPML equation script β†’ SVG

Writing β€” Text (5)

Tool

.hwpx

Description

replace_hwp_text

βœ…

Find and replace specific strings

fill_hwp_template

βœ…

Multiple placeholders like {{name}}

set_hwp_paragraph_text

βœ…

Replace entire text of the Nth paragraph

set_hwp_cell_text

βœ…

Directly set text in a table cell (row, column)

set_hwp_field_value

βœ…

Set field values

Writing β€” Structure (9)

Tool

.hwpx

Description

append_hwp_paragraph

βœ…

New paragraph at the end of the body

delete_hwp_paragraph

βœ…

Delete the Nth paragraph

append_hwp_table_row

βœ…

New row at the end of a table

delete_hwp_table_row

βœ…

Delete a table row

append_hwp_table_column

βœ…

New column at the end of a table (in all rows)

delete_hwp_table_column

βœ…

Delete a table column

merge_hwp_cells_horizontal

βœ…

Horizontal cell merge (colSpan)

merge_hwp_cells_vertical

βœ…

Vertical cell merge (rowSpan)

replace_hwp_image

βœ…

Replace embedded image

Writing β€” Formatting (2)

Tool

.hwpx

Description

apply_hwp_text_style

βœ…

Text color, bold, italic, underline, size (adds charPr)

apply_hwp_paragraph_style

βœ…

Paragraph alignment, indentation, line spacing (adds paraPr)

Writing β€” Images / Tables / New (4)

Tool

.hwpx

Description

insert_hwp_image

βœ…

Add new image (BinData + manifest + <hp:pic>)

delete_hwp_image

βœ…

Delete BinData/ entry

insert_hwp_table

⚠️

Insert new OWPML table (experimental β€” file valid, rhwp recognition incomplete)

create_hwpx_document

βœ…

Create new .hwpx from text

Content Extraction Matrix

Content

Extraction

Notes

Body paragraph text

βœ…

read_hwp_text, read_hwp

Tables (incl. merged cells)

βœ…

read_hwp_tables as markdown

Embedded images

βœ…

Extract PNG/JPG/BMP, etc.

Headers / Footers

βœ…

--- headers --- / --- footers --- blocks in read_hwp_text result

Footnotes

βœ…

--- footnotes --- block at the end of result, format [1] body...

Equations

βœ…

OWPML script format (e.g., TIMES LEFT ( {a} over {b} RIGHT )), --- equations --- block

Page SVG render

βœ…

render_hwp_page

Textbox body

❌

rhwp's createShapeControl creates them, but getTextBoxControlIndex return pattern is implicit β€” trace in v0.3

Endnotes

–

Not supported by rhwp (footnotes only)

Charts

❌

After v0.3

Writing Matrix

Task

.hwp

.hwpx

Notes

Single text replacement

❌

βœ…

replace_hwp_text

Fill multiple placeholders

❌

βœ…

fill_hwp_template

Replace entire paragraph text

❌

βœ…

set_hwp_paragraph_text

Direct table cell modification

❌

βœ…

set_hwp_cell_text (specify row/col)

Set field value

❌

βœ…

set_hwp_field_value

Append / Delete paragraph

❌

βœ…

append_hwp_paragraph / delete_hwp_paragraph

Append / Delete table row

❌

βœ…

append_hwp_table_row / delete_hwp_table_row

Replace / Delete image

❌

βœ…

replace_hwp_image / delete_hwp_image

Create new document (text)

–

βœ…

create_hwpx_document

Create new document (table)

–

⚠️

Flattened as text rows (real OWPML table in v0.3)

Insert new image

❌

βœ…

insert_hwp_image

Append / Delete table column

❌

βœ…

append_hwp_table_column / delete_hwp_table_column

Cell merge (horizontal/vertical)

❌

βœ…

merge_hwp_cells_horizontal / merge_hwp_cells_vertical

Text formatting (color/bold/italic/underline/size)

❌

βœ…

apply_hwp_text_style

Paragraph formatting (align/indent/spacing)

❌

βœ…

apply_hwp_paragraph_style

Insert new table (real OWPML)

❌

⚠️

insert_hwp_table (experimental)

Insert new header/footer

❌

❌

v0.3

Charts/Bookmarks/Style definitions

❌

❌

v0.3

.hwp binary writing is not supported in v0.2 due to the exportHwp round-trip limitations of rhwp 0.7.7. Please save as .hwpx in Hancom Office before using writing tools, or wait for the v0.3 release.


Usage Examples

Reading Government Hangul Documents

λ‚˜: /Users/me/2026λ…„_μ‹œν–‰κ³„νš.hwpx μ½μ–΄μ€˜

AI: # 2026λ…„_μ‹œν–‰κ³„νš.hwpx
    ν˜•μ‹: .HWPX | 문단: 153개 | ν‘œ: 15개 | 이미지: 2개

    β… . μΆ”μ§„ λ°°κ²½
    β–‘ (κΈ€λ‘œλ²Œ ν˜„ν™©) 전세계 AI μ†”λ£¨μ…˜ μ‹œμž₯ 규λͺ¨λŠ” ...

    ### ν‘œ 9 (7ν–‰ x 4μ—΄)
    | 도메인 | μž…λ ₯ 데이터 | ν•™μŠ΅ λ‚΄μš© | μ‚°μ—…AI μ†”λ£¨μ…˜ 적용 κΈ°λŠ₯ μ˜ˆμ‹œ |
    | --- | --- | --- | --- |
    | 기계 | Β· μ„Όμ„œ 데이터 둜그 ... | ... | ... |

Filling Templates

λ‚˜: /path/to/form.hwpx μ—μ„œ {{이름}}=λ‚¨λŒ€ν˜„, {{νšŒμ‚¬}}=ν¬ν…λž© 으둜 μ±„μ›Œμ€˜

AI: μ €μž₯ μ™„λ£Œ (saved): form_filled.hwpx
    총 2건 μΉ˜ν™˜ (2 replacements)
      '{{이름}}' β†’ 1건
      '{{νšŒμ‚¬}}' β†’ 1건

Text Replacement

λ‚˜: /path/to/doc.hwpx 의 "μ‚°μ—…AI" λ₯Ό "μ‚°μ—…-AI" 둜 λ°”κΏ”μ€˜

AI: 'μ‚°μ—…AI' β†’ 'μ‚°μ—…-AI': 18건 ꡐ체 (replaced 18)
    μ €μž₯ (saved): doc_modified.hwpx

Creating a New .hwpx

λ‚˜: employees.hwpx 에 "사원 λͺ…λΆ€" 와 "두 번째 쀄" 두 쀄을 κ°€μ§„ λ¬Έμ„œ λ§Œλ“€μ–΄μ€˜

AI: HWPX λ¬Έμ„œ 생성 μ™„λ£Œ (created): employees.hwpx

Extracting Images

λ‚˜: /path/to/document.hwpx μ—μ„œ 이미지 빼쀘

AI: 이미지 2개λ₯Ό μΆ”μΆœν–ˆμŠ΅λ‹ˆλ‹€ (extracted 2 images):
    μ €μž₯ μœ„μΉ˜: /path/to/document_images
      - image_001.bmp
      - image_002.bmp

Rendering Pages to SVG (for visual analysis)

λ‚˜: /path/to/document.hwpx 의 첫 νŽ˜μ΄μ§€λ₯Ό SVG둜 λ³΄μ—¬μ€˜

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

Or save to disk:

λ‚˜: /path/to/document.hwpx λͺ¨λ“  νŽ˜μ΄μ§€ SVG둜 μ €μž₯ν•΄μ€˜

AI: 9/9 νŽ˜μ΄μ§€ SVG μ €μž₯ (rendered 9/9 pages):
    μ €μž₯ μœ„μΉ˜: /path/to/document_pages
      - page_001.svg
      - page_002.svg ...

Limitations

Known constraints of hwp-mcp v0.2:

  • .hwp writing not supported β€” Reading works for both .hwp/.hwpx. Writing is .hwpx only. Calling writing tools on .hwp input will return a clear error message. Please save as .hwpx in Hancom Office or wait for v0.3.

  • Cross-format saving denied β€” .hwpx input is saved only as .hwpx.

  • Headers/Footers/Footnotes extractable; Textboxes/Endnotes/Equations in v0.3 β€” In read_hwp_text results, headers are marked as --- headers ---, footers as --- footers ---, and footnotes as --- footnotes --- blocks. Textbox body, endnotes, and equation extraction are planned for v0.3.

  • No matching if search term spans two text nodes β€” e.g., if one <hp:t> ends in "Industry" and the next starts with "AI", "IndustryAI" will not match. This is the same limitation as Hancom's hwpctl.

  • Tables in create_hwpx_document are flattened to text rows in v0.2 β€” Real OWPML tables will be in v0.3.


How does it work?

  • Reading: @rhwp/core (rhwp's Rust+WASM parser) traverses sections, paragraphs, tables (including merged cells), and images.

  • Writing (.hwpx): Directly parses Contents/section*.xml inside the ZIP archive, performs search/replace on <hp:t> text nodes, and re-packages (mimetype stored as per spec). This is a layer to bypass rhwp's exportHwpx() round-trip issues.

  • New Documents: Created using rhwp's createBlankDocument + insertText, then saved via exportHwpx (text round-trip is stable).

Credits

rhwp (@edwardkim) β€” Core parser, renderer, and Field API. All the work that opened up the closed Hangul format is the foundation of this project. If possible, please support that project as well: https://github.com/edwardkim/rhwp

hwp-mcp β€” A thin MCP adapter built on top of rhwp that turns it into tools that AI agents can call in natural language. All core capabilities belong to rhwp; we are just the wiring that connects it to LLMs.

Coverage

Area

Coverage

Reading/Extraction

~90%

Rendering

~85% (SVG Β· HTML Β· Equation SVG Β· Canvas excluded as it's for browsers)

Writing β€” Text

~95%

Writing β€” Structure

~90% (Rows Β· Columns Β· Merging Β· 4 types of images)

Writing β€” Formatting

~70% (Text + Paragraph)

Meta / Fields

~85%

Overall Weighted

~85%

Remaining major items for v0.3: .hwp binary writing, charts, style definitions/application, textbox body extraction, hwpctl 30 Actions (intentionally excluded).

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.

Install Server
A
license - permissive license
A
quality
A
maintenance

Maintenance

–Maintainers
–Response time
4wRelease cycle
2Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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.
  • A
    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.
    67
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/treesoop/hwp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server