hwp-mcp
hwp-mcp
Un servidor que permite a las IAs compatibles con MCP, como Claude, Cursor o ChatGPT, leer, modificar y crear nuevos documentos de Hangul (.hwp / .hwpx).
hwp-mcp es un servidor MCP (Model Context Protocol) que permite a los agentes de IA manejar directamente documentos de Hancom Office. No solo permite la lectura, sino también la modificación de texto, el relleno de plantillas y la creación de nuevos documentos.
¿Qué es este proyecto?
Este proyecto se divide en dos partes:
🔧 Lo que hizo rhwp (motor principal) — rhwp de Edward Kim es un motor de código abierto implementado en Rust + WebAssembly que ha descifrado mediante ingeniería inversa los formatos cerrados de Hangul (HWP 5.0 binario, HWPX/OWPML). El análisis, la extracción de tablas, imágenes, fórmulas y encabezados, la renderización SVG y la API de campos compatibles con Hancom: todas estas capacidades principales son proporcionadas por rhwp. Sin rhwp, este proyecto no existiría.
🤝 Lo que hizo
hwp-mcp(adaptador de agente) — Una capa de servidor MCP ligera construida sobre@rhwp/core. Lo que hemos añadido es:Firmas de herramientas amigables para agentes como
read_hwp,fill_hwp_template,replace_hwp_text, para que los LLM como Claude/Cursor puedan invocarlas en lenguaje natural.Un recorredor (traversal walker) centrado en escenarios que vuelca el cuerpo, tablas, imágenes, encabezados, pies de página, notas al pie y fórmulas de una sola vez.
Una capa de facilidad de uso para el manejo automático de combinación de celdas de tablas, consolidación automática de notas al pie/fórmulas.
Una capa de mutación a nivel de ZIP de
.hwpxpara eludir las limitaciones de round-trip deexportHwpxde rhwp 0.7.7 (la clave para hacer posible la escritura real).Paquete npm
hwp-mcp(instalación en una línea) + bootstrap de Node.js WASM.
Resumen: Un adaptador que permite a la IA leer y escribir documentos de Hangul de verdad. Por favor, envíe su agradecimiento por todas las capacidades de Hangul de código abierto al proyecto rhwp 🙏
Related MCP server: HWP-MCP
Instalación
Claude Code
claude mcp add hwp-mcp -- npx -y hwp-mcpClaude Desktop / Cursor / VS Code (settings JSON)
{
"mcpServers": {
"hwp-mcp": {
"command": "npx",
"args": ["-y", "hwp-mcp"]
}
}
}Requiere Node.js 20 o superior.
Lista de herramientas
Estas son las 34 herramientas MCP expuestas por hwp-mcp v0.2. La lectura/renderizado es compatible con .hwp/.hwpx, la escritura es exclusiva para .hwpx.
Lectura (5)
Herramienta |
|
| Descripción |
| ✅ | ✅ | Cuerpo + tablas (markdown) + lista de imágenes de una vez |
| ✅ | ✅ | Texto integrado de cuerpo + encabezados + pies de página + notas al pie + fórmulas |
| ✅ | ✅ | Tablas a GitHub Markdown (manejo de combinación de celdas) |
| ✅ | ✅ | Lista de imágenes incrustadas (mime, bytes) |
| ✅ | ✅ | Extraer imágenes al disco |
Meta / Consulta (5)
Herramienta |
|
| Descripción |
| ✅ | ✅ | Estadísticas de versión, páginas, fuentes, tablas/imágenes/notas al pie/fórmulas |
| ✅ | ✅ | Tamaño de papel, márgenes, columnas, márgenes de encabezado/pie por sección |
| ✅ | ✅ | Lista de campos de Hancom |
| ✅ | ✅ | Consultar valor de campo |
| – | ✅ | Lista de entradas BinData/ de |
Renderizado visual (4)
Herramienta |
|
| Descripción |
| ✅ | ✅ | Página específica → SVG (inline/archivo) |
| ✅ | ✅ | SVG de todas las páginas en lote |
| ✅ | ✅ | Página → HTML |
| – | – | Script de fórmula OWPML → SVG |
Escritura — Texto (5)
Herramienta |
| Descripción |
| ✅ | Buscar y reemplazar una cadena específica |
| ✅ | Múltiples marcadores de posición como |
| ✅ | Reemplazar completamente el texto del N-ésimo párrafo |
| ✅ | Establecer directamente el texto de una celda de tabla (fila, columna) |
| ✅ | Establecer valor de campo |
Escritura — Estructura (9)
Herramienta |
| Descripción |
| ✅ | Nuevo párrafo al final del cuerpo |
| ✅ | Eliminar el N-ésimo párrafo |
| ✅ | Nueva fila al final de la tabla |
| ✅ | Eliminar fila de tabla |
| ✅ | Nueva columna al final de la tabla (en todas las filas) |
| ✅ | Eliminar columna de tabla |
| ✅ | Combinar celdas horizontalmente (colSpan) |
| ✅ | Combinar celdas verticalmente (rowSpan) |
| ✅ | Reemplazar imagen incrustada |
Escritura — Formato (2)
Herramienta |
| Descripción |
| ✅ | Color de fuente, negrita, cursiva, subrayado, tamaño (añadir charPr) |
| ✅ | Alineación de párrafo, sangría, interlineado (añadir paraPr) |
Escritura — Imágenes / Tablas / Nuevo (4)
Herramienta |
| Descripción |
| ✅ | Añadir nueva imagen (BinData + manifiesto + |
| ✅ | Eliminar entrada BinData/ |
| ⚠️ | Insertar nueva tabla OWPML (experimental — archivo válido, reconocimiento de rhwp incompleto) |
| ✅ | Crear nuevo |
Matriz de extracción de contenido
Contenido | Extracción | Notas |
Texto de párrafo del cuerpo | ✅ |
|
Tablas (incluyendo combinación) | ✅ |
|
Imágenes incrustadas | ✅ | Extracción de PNG/JPG/BMP, etc. |
Encabezados / Pies de página | ✅ | Bloques |
Notas al pie (footnote) | ✅ | Bloque |
Fórmulas (equation) | ✅ | Formato de script OWPML (ej: |
Renderizado SVG de página | ✅ |
|
Cuerpo de cuadro de texto | ❌ |
|
Notas al final (endnote) | – | No soportado por rhwp (solo footnote) |
Gráficos (chart) | ❌ | Después de v0.3 |
Matriz de escritura
Tarea |
|
| Notas |
Reemplazo único de texto | ❌ | ✅ |
|
Relleno de múltiples marcadores | ❌ | ✅ |
|
Reemplazo total de texto de párrafo | ❌ | ✅ |
|
Modificación directa de celda de tabla | ❌ | ✅ |
|
Establecer valor de campo | ❌ | ✅ |
|
Añadir / eliminar nuevo párrafo | ❌ | ✅ |
|
Añadir / eliminar fila de tabla | ❌ | ✅ |
|
Reemplazar / eliminar imagen | ❌ | ✅ |
|
Crear nuevo documento (texto) | – | ✅ |
|
Crear nuevo documento (tabla) | – | ⚠️ | Aplanado a filas de texto (tabla OWPML real en v0.3) |
Insertar nueva imagen | ❌ | ✅ |
|
Añadir / eliminar columna de tabla | ❌ | ✅ |
|
Combinar celdas (horizontal/vertical) | ❌ | ✅ |
|
Formato de texto (color/negrita/cursiva/subrayado/tamaño) | ❌ | ✅ |
|
Formato de párrafo (alineación/sangría/interlineado) | ❌ | ✅ |
|
Insertar nueva tabla (OWPML real) | ❌ | ⚠️ |
|
Nueva inserción de encabezado/pie | ❌ | ❌ | v0.3 |
Definición de gráficos/marcadores/estilos | ❌ | ❌ | v0.3 |
La escritura binaria de
.hwpno es compatible en v0.2 debido a las limitaciones de round-trip deexportHwpde rhwp 0.7.7. Por favor, guarde como.hwpxen Hancom Office antes de usar las herramientas de escritura, o espere al lanzamiento de v0.3.
Ejemplos de uso
Leer documentos gubernamentales de Hangul
나: /Users/me/2026년_시행계획.hwpx 읽어줘
AI: # 2026년_시행계획.hwpx
형식: .HWPX | 문단: 153개 | 표: 15개 | 이미지: 2개
Ⅰ. 추진 배경
□ (글로벌 현황) 전세계 AI 솔루션 시장 규모는 ...
### 표 9 (7행 x 4열)
| 도메인 | 입력 데이터 | 학습 내용 | 산업AI 솔루션 적용 기능 예시 |
| --- | --- | --- | --- |
| 기계 | · 센서 데이터 로그 ... | ... | ... |Rellenar plantillas
나: /path/to/form.hwpx 에서 {{이름}}=남대현, {{회사}}=포텐랩 으로 채워줘
AI: 저장 완료 (saved): form_filled.hwpx
총 2건 치환 (2 replacements)
'{{이름}}' → 1건
'{{회사}}' → 1건Reemplazo de texto
나: /path/to/doc.hwpx 의 "산업AI" 를 "산업-AI" 로 바꿔줘
AI: '산업AI' → '산업-AI': 18건 교체 (replaced 18)
저장 (saved): doc_modified.hwpxCrear un nuevo .hwpx
나: employees.hwpx 에 "사원 명부" 와 "두 번째 줄" 두 줄을 가진 문서 만들어줘
AI: HWPX 문서 생성 완료 (created): employees.hwpxExtracción de imágenes
나: /path/to/document.hwpx 에서 이미지 빼줘
AI: 이미지 2개를 추출했습니다 (extracted 2 images):
저장 위치: /path/to/document_images
- image_001.bmp
- image_002.bmpRenderizar página a SVG (para análisis visual)
나: /path/to/document.hwpx 의 첫 페이지를 SVG로 보여줘
AI: <svg xmlns="..." width="793" height="1122" viewBox="...">
<defs>...</defs>
...
</svg>O guardar en disco:
나: /path/to/document.hwpx 모든 페이지 SVG로 저장해줘
AI: 9/9 페이지 SVG 저장 (rendered 9/9 pages):
저장 위치: /path/to/document_pages
- page_001.svg
- page_002.svg ...Limitaciones
Limitaciones conocidas de hwp-mcp v0.2:
Escritura de
.hwpno soportada — La lectura funciona tanto para.hwpcomo para.hwpx. La escritura es solo para.hwpx. Si se llama a una herramienta de escritura para una entrada.hwp, devolverá un mensaje de error claro. Por favor, guarde como.hwpxen Hancom Office antes de usar, o espere al lanzamiento de v0.3.Rechazo de guardado entre formatos — La entrada
.hwpxsolo se guarda como.hwpx.Extracción de encabezados/pies de página/notas al pie posible, cuadros de texto/notas al final/fórmulas en v0.3 — En el resultado de
read_hwp_text, los encabezados se marcan como--- headers ---, los pies de página como--- footers ---y las notas al pie como bloques--- footnotes ---. La extracción de cuerpo de cuadros de texto, notas al final y fórmulas está prevista para v0.3.No hay coincidencia si el término de búsqueda abarca dos nodos de texto — Ej: Si un
<hp:t>termina en "indus" y el siguiente comienza en "trial", "industrial" no coincidirá. Es la misma limitación que hwpctl de Hancom.Las tablas de
create_hwpx_documentse aplanan a filas de texto en v0.2 — Las tablas OWPML reales estarán en v0.3.
¿Cómo funciona?
Lectura:
@rhwp/core(el analizador Rust+WASM de rhwp) recorre secciones, párrafos, tablas (incluyendo celdas combinadas) e imágenes.Escritura (.hwpx): Analiza directamente
Contents/section*.xmldentro del archivo ZIP, busca/reemplaza el nodo de texto<hp:t>y luego vuelve a empaquetar (el mimetype se almacena según la especificación). Es una capa para eludir el problema de round-trip deexportHwpx()de rhwp.Nuevo documento: Se crea con
createBlankDocument+insertTextde rhwp y luego se guarda conexportHwpx(el round-trip de texto es estable).
Créditos
rhwp (@edwardkim) — Analizador principal, renderizador, API de campos. Todo el trabajo de abrir el formato cerrado de Hangul es la base de este proyecto. Si puede, por favor apoye también ese proyecto: https://github.com/edwardkim/rhwp
hwp-mcp — Un adaptador MCP ligero sobre rhwp que permite a los agentes de IA invocarlo en lenguaje natural. Todas las capacidades principales son de rhwp, nosotros somos el cableado que lo conecta al LLM.
Cobertura
Área | Cobertura |
Lectura/Extracción | ~90% |
Renderizado | ~85% (SVG · HTML · SVG de fórmula · Canvas excluido por ser para navegador) |
Escritura — Texto | ~95% |
Escritura — Estructura | ~90% (4 tipos: fila, columna, combinación, imagen) |
Escritura — Formato | ~70% (fuente + párrafo) |
Meta / Campos | ~85% |
Ponderado total | ~85% |
Grandes elementos restantes para v0.3: escritura binaria de .hwp, gráficos, definición/aplicación de estilos, extracción de cuerpo de cuadros de texto, 30 acciones de hwpctl (excluidas intencionalmente).
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 toolsappend_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
Scored across 34 tools
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.
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.
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.
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
Related MCP Connectors
Create Korean HWPX files from Markdown, fill HWP/HWPX forms, render pages and PDFs
Make, convert and read Korean HWP and HWPX files, and fill in common Korean forms.
Korean hwpx forms held in shape: AI writes the lines, the server keeps the frame and measures each.
Extract text and tables from Korean HWP/HWPX, PDF, Word, Excel and PowerPoint files
Related MCP Servers
- FlicenseAqualityDmaintenanceAn 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-
- FlicenseNot gradedqualityNot gradedmaintenanceAn 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.-
- FlicenseNot gradedqualityDmaintenanceAn 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.-
- AlicenseNot gradedqualityCmaintenanceMCP server for AI-driven editing of HWPX (Korean word processor) documents, providing 132 tools for text, tables, images, and more.MIT