# HWPX MCP Server - Enhanced Edition
[](https://github.com/Dayoooun/hwp-extension)
[](https://github.com/mjyoo2/hwp-extension)
> ๐ **Original ํ๋ก์ ํธ๋ฅผ Forkํ์ฌ ์์ ์ฑ๊ณผ ๊ธฐ๋ฅ์ ๋ํญ ๊ฐ์ ํ ๋ฒ์ ์
๋๋ค.**
AI ๋๊ตฌ(Claude ๋ฑ)์ ์ฐ๋ํ์ฌ ํ๊ธ(HWPX) ๋ฌธ์๋ฅผ ์๋์ผ๋ก ํธ์งํ ์ ์๋ MCP(Model Context Protocol) ์๋ฒ์
๋๋ค.
---
## โจ Enhanced Features (๊ฐ์ ๋ ๊ธฐ๋ฅ)
์๋ณธ ํ๋ก์ ํธ ๋๋น ๋ค์๊ณผ ๊ฐ์ **ํต์ฌ ๋ฌธ์ ๋ค์ ํด๊ฒฐ**ํ์ต๋๋ค:
### ๐ง Critical Bug Fixes
| ๋ฌธ์ | ์๋ณธ ์ํ | ๊ฐ์ ํ |
|------|----------|---------|
| **ํ
์ด๋ธ ์ ์ฅ ์คํจ** | ์
์์ ํ ์ ์ฅํด๋ ๋ณ๊ฒฝ์ฌํญ ์ฌ๋ผ์ง | โ
์๋ฒฝํ๊ฒ ์ ์ฅ๋จ |
| **ํ
์คํธ ๊ฒน์นจ ํ์** | ์ ์ฅ ํ ํ๊ธ์์ ์ด๋ฉด ๊ธ์๊ฐ ๊ฒน์ณ ํ์ | โ
์ ์ ํ์ |
| **ํ์ผ ์์** | ์ ์ฅ ์ ๊ฐ๋ ํ์ผ์ด ์์๋จ | โ
์์์ ์ฐ๊ธฐ๋ก 100% ์์ |
| **๋ค์ค ์
์์** | ๊ฐ์ ํ์ ์ฌ๋ฌ ์
์์ ์ XML ์์ | โ
์ธ๋ฑ์ค ๊ด๋ฆฌ๋ก ์์ |
| **์๊ฐ/์ค๊ฐ๊ฒฉ ์์ค** | ์ ์ฅ ํ ์คํ์ผ ์ ๋ณด ์ ์ค | โ
๋ชจ๋ ์คํ์ผ ๋ณด์กด |
### ๐ Technical Improvements
1. **Atomic File Writing (์์์ ํ์ผ ์ฐ๊ธฐ)**
- ์์ ํ์ผ โ ZIP ๊ฒ์ฆ โ ์์์ ์ด๋
- ์ ์ฅ ์ค ์ค๋ฅ ๋ฐ์ํด๋ ์๋ณธ ํ์ผ ๋ณดํธ
2. **Smart Lineseg Reset (์ค๋งํธ ์ค ๋ ์ด์์ ์ด๊ธฐํ)**
- ํ
์คํธ ์์ ์ `lineseg` ์๋ ์ด๊ธฐํ
- ํ๊ธ ํ๋ก๊ทธ๋จ์ด ์ด ๋ ์๋์ผ๋ก ์ค๋ฐ๊ฟ ์ฌ๊ณ์ฐ
- ํ
์คํธ ๊ฒน์นจ ํ์ ์์ ํด๊ฒฐ
3. **Depth-based XML Parsing (๊น์ด ๊ธฐ๋ฐ XML ํ์ฑ)**
- ๊ธฐ์กด lazy regex์ ์ค์ฒฉ ๊ตฌ์กฐ ์ค์ธ์ ๋ฌธ์ ํด๊ฒฐ
- ๋ณต์กํ ํ
์ด๋ธ(์ค์ฒฉ ํ
์ด๋ธ, subList ๋ฑ) ์๋ฒฝ ์ง์
4. **Complete Style Preservation (์คํ์ผ ์์ ๋ณด์กด)**
- `charPr`, `spacing` ๋ฑ ์๋ณธ ์คํ์ผ 100% ์ ์ง
- ๋ถ์์ ํ ์ง๋ ฌํ ๋ก์ง ์ ๊ฑฐ๋ก ๋ฐ์ดํฐ ๋ฌด๊ฒฐ์ฑ ๋ณด์ฅ
5. **Safe Multi-Cell Updates (์์ ํ ๋ค์ค ์
์
๋ฐ์ดํธ)**
- ๊ฐ์ ํ(row)์ ์ฌ๋ฌ ์
์ ๋์์ ์์ ํด๋ ์์
- ํ๋ณ ๊ทธ๋ฃนํ + ์ญ์ ์ฒ๋ฆฌ๋ก ์ธ๋ฑ์ค ์์ ๋ฐฉ์ง
---
## ๐ฆ Installation
### MCP ์๋ฒ ์ค์น
```bash
git clone https://github.com/Dayoooun/hwp-extension.git
cd hwp-extension/mcp-server
npm install
npm run build
```
### Claude Code ์ฐ๋
`~/.claude/claude_desktop_config.json` ๋๋ `.vscode/mcp.json`์ ์ถ๊ฐ:
```json
{
"mcpServers": {
"hwpx": {
"command": "node",
"args": ["/path/to/hwp-extension/mcp-server/dist/index.js"]
}
}
}
```
---
## ๐ MCP Tools (77๊ฐ)
### ๐ ๋ฌธ์ ๊ด๋ฆฌ (Document Management) - 5๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `create_document` | ์ ๋น HWPX ๋ฌธ์ ์์ฑ | `title?`, `creator?` |
| `open_document` | HWPX ๋ฌธ์ ์ด๊ธฐ | `file_path` |
| `close_document` | ์ด๋ฆฐ ๋ฌธ์ ๋ซ๊ธฐ | `doc_id` |
| `save_document` | ๋ฌธ์ ์ ์ฅ (๋ฐฑ์
/๋ฌด๊ฒฐ์ฑ ๊ฒ์ฆ ์ง์) | `doc_id`, `output_path?`, `create_backup?`, `verify_integrity?` |
| `list_open_documents` | ํ์ฌ ์ด๋ฆฐ ๋ฌธ์ ๋ชฉ๋ก ์กฐํ | - |
### ๐ ๋ฌธ์ ์ ๋ณด (Document Info) - 5๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_document_text` | ๋ฌธ์ ์ ์ฒด ํ
์คํธ ์ถ์ถ | `doc_id` |
| `get_document_structure` | ๋ฌธ์ ๊ตฌ์กฐ ์กฐํ (์น์
/๋จ๋ฝ/ํ
์ด๋ธ/์ด๋ฏธ์ง ์) | `doc_id` |
| `get_document_metadata` | ๋ฉํ๋ฐ์ดํฐ ์กฐํ (์ ๋ชฉ, ์ ์, ๋ ์ง ๋ฑ) | `doc_id` |
| `set_document_metadata` | ๋ฉํ๋ฐ์ดํฐ ์์ | `doc_id`, `title?`, `creator?`, `subject?`, `description?` |
| `get_word_count` | ๊ธ์์/๋จ์ด์ ํต๊ณ | `doc_id` |
### ๐ ๋จ๋ฝ (Paragraphs) - 8๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_paragraphs` | ๋จ๋ฝ ๋ชฉ๋ก ์กฐํ (ํ
์คํธ/์คํ์ผ ํฌํจ) | `doc_id`, `section_index?` |
| `get_paragraph` | ํน์ ๋จ๋ฝ ์์ธ ์ ๋ณด | `doc_id`, `section_index`, `paragraph_index` |
| `insert_paragraph` | ์ ๋จ๋ฝ ์ฝ์
| `doc_id`, `section_index`, `after_index`, `text` |
| `delete_paragraph` | ๋จ๋ฝ ์ญ์ | `doc_id`, `section_index`, `paragraph_index` |
| `update_paragraph_text` | ๋จ๋ฝ ํ
์คํธ ๋ด์ฉ ์์ | `doc_id`, `section_index`, `paragraph_index`, `text`, `run_index?` |
| `append_text_to_paragraph` | ๊ธฐ์กด ๋จ๋ฝ์ ํ
์คํธ ์ถ๊ฐ | `doc_id`, `section_index`, `paragraph_index`, `text` |
| `copy_paragraph` | ๋จ๋ฝ์ ๋ค๋ฅธ ์์น๋ก ๋ณต์ฌ | `doc_id`, `source_section`, `source_paragraph`, `target_section`, `target_after` |
| `move_paragraph` | ๋จ๋ฝ์ ๋ค๋ฅธ ์์น๋ก ์ด๋ | `doc_id`, `source_section`, `source_paragraph`, `target_section`, `target_after` |
### ๐จ ํ
์คํธ ์คํ์ผ (Text Styling) - 4๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_text_style` | ๊ธ์ ์์ ์กฐํ (ํฐํธ/ํฌ๊ธฐ/์์ ๋ฑ) | `doc_id`, `section_index`, `paragraph_index`, `run_index?` |
| `set_text_style` | ๊ธ์ ์์ ์ค์ | `doc_id`, `section_index`, `paragraph_index`, `bold?`, `italic?`, `underline?`, `strikethrough?`, `font_name?`, `font_size?`, `font_color?`, `background_color?` |
| `get_paragraph_style` | ๋ฌธ๋จ ์์ ์กฐํ (์ ๋ ฌ/์ค๊ฐ๊ฒฉ/์ฌ๋ฐฑ ๋ฑ) | `doc_id`, `section_index`, `paragraph_index` |
| `set_paragraph_style` | ๋ฌธ๋จ ์์ ์ค์ | `doc_id`, `section_index`, `paragraph_index`, `align?`, `line_spacing?`, `margin_*?`, `first_line_indent?` |
### ๐ ๊ฒ์/์นํ (Search & Replace) - 4๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `search_text` | ๋ฌธ์ ๋ด ํ
์คํธ ๊ฒ์ (์ ๊ท์ ์ง์, **ํ
์ด๋ธ ์
ํฌํจ**) | `doc_id`, `query`, `case_sensitive?`, `regex?`, `include_tables?` |
| `replace_text` | ํ
์คํธ ์ฐพ์ ๋ฐ๊พธ๊ธฐ | `doc_id`, `old_text`, `new_text`, `case_sensitive?`, `regex?`, `replace_all?` |
| `replace_text_in_cell` | **ํน์ ํ
์ด๋ธ ์
๋ด ํ
์คํธ ์นํ** | `doc_id`, `section_index`, `table_index`, `row`, `col`, `old_text`, `new_text` |
| `batch_replace` | ์ฌ๋ฌ ํ
์คํธ ์ผ๊ด ์นํ | `doc_id`, `replacements[]` (old_text, new_text ์ ๋ฐฐ์ด) |
### ๐ ํ
์ด๋ธ (Tables) - 12๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_tables` | ๋ฌธ์ ๋ด ๋ชจ๋ ํ
์ด๋ธ ๋ชฉ๋ก | `doc_id` |
| `get_table` | ํน์ ํ
์ด๋ธ ์ ์ฒด ๋ฐ์ดํฐ ์กฐํ | `doc_id`, `section_index`, `table_index` |
| `get_table_cell` | ํน์ ์
๋ด์ฉ ์กฐํ | `doc_id`, `section_index`, `table_index`, `row`, `col` |
| `update_table_cell` | ์
๋ด์ฉ ์์ (์คํ์ผ ๋ณด์กด) | `doc_id`, `section_index`, `table_index`, `row`, `col`, `text`, `char_shape_id?` |
| `set_cell_properties` | ์
์์ฑ ์ค์ (ํฌ๊ธฐ/๋ฐฐ๊ฒฝ์/์ ๋ ฌ) | `doc_id`, `section_index`, `table_index`, `row`, `col`, `width?`, `height?`, `background_color?`, `vertical_align?` |
| `insert_table` | ์ ํ
์ด๋ธ ์ฝ์
| `doc_id`, `section_index`, `after_index`, `rows`, `cols`, `width?` |
| `insert_table_row` | ํ
์ด๋ธ์ ํ ์ฝ์
| `doc_id`, `section_index`, `table_index`, `after_row`, `cell_texts?` |
| `delete_table_row` | ํ
์ด๋ธ์์ ํ ์ญ์ | `doc_id`, `section_index`, `table_index`, `row_index` |
| `insert_table_column` | ํ
์ด๋ธ์ ์ด ์ฝ์
| `doc_id`, `section_index`, `table_index`, `after_col` |
| `delete_table_column` | ํ
์ด๋ธ์์ ์ด ์ญ์ | `doc_id`, `section_index`, `table_index`, `col_index` |
| `insert_nested_table` | **์
์์ ์ค์ฒฉ ํ
์ด๋ธ ์ฝ์
(ํ ์์ ํ)** | `doc_id`, `section_index`, `parent_table_index`, `row`, `col`, `nested_rows`, `nested_cols`, `data?` |
| `get_table_as_csv` | ํ
์ด๋ธ์ CSV ํ์์ผ๋ก ์ถ์ถ | `doc_id`, `section_index`, `table_index`, `delimiter?` |
### ๐ ํ์ด์ง ์ค์ (Page Settings) - 2๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_page_settings` | ํ์ด์ง ์ค์ ์กฐํ (์ฉ์ง ํฌ๊ธฐ/์ฌ๋ฐฑ) | `doc_id`, `section_index?` |
| `set_page_settings` | ํ์ด์ง ์ค์ ๋ณ๊ฒฝ | `doc_id`, `section_index?`, `width?`, `height?`, `margin_*?`, `orientation?` |
### ๐ผ๏ธ ์ด๋ฏธ์ง (Images) - 5๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_images` | ๋ฌธ์ ๋ด ๋ชจ๋ ์ด๋ฏธ์ง ๋ชฉ๋ก | `doc_id` |
| `insert_image` | ์ด๋ฏธ์ง ํ์ผ ์ฝ์
(BinData ์๋ ๋ฑ๋ก) | `doc_id`, `section_index`, `after_index`, `image_path`, `width?`, `height?` |
| `update_image_size` | ๊ธฐ์กด ์ด๋ฏธ์ง ํฌ๊ธฐ ๋ณ๊ฒฝ | `doc_id`, `section_index`, `image_index`, `width`, `height` |
| `delete_image` | ์ด๋ฏธ์ง ์ญ์ | `doc_id`, `section_index`, `image_index` |
| `render_mermaid` | **Mermaid ๋ค์ด์ด๊ทธ๋จ์ ์ด๋ฏธ์ง๋ก ์ฝ์
** | `doc_id`, `mermaid_code`, `after_index`, `section_index?`, `width?`, `height?`, `theme?`, `background_color?` |
### โ๏ธ ๋ํ (Shapes) - 3๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `insert_line` | ์ ๋ํ ์ฝ์
| `doc_id`, `section_index`, `after_index`, `x1`, `y1`, `x2`, `y2`, `stroke_color?`, `stroke_width?` |
| `insert_rect` | ์ฌ๊ฐํ ๋ํ ์ฝ์
| `doc_id`, `section_index`, `after_index`, `x`, `y`, `width`, `height`, `fill_color?`, `stroke_color?` |
| `insert_ellipse` | ํ์ ๋ํ ์ฝ์
| `doc_id`, `section_index`, `after_index`, `cx`, `cy`, `rx`, `ry`, `fill_color?`, `stroke_color?` |
### ๐ ๋จธ๋ฆฌ๊ธ/๋ฐ๋ฅ๊ธ (Header/Footer) - 4๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_header` | ๋จธ๋ฆฌ๊ธ ๋ด์ฉ ์กฐํ | `doc_id`, `section_index?` |
| `set_header` | ๋จธ๋ฆฌ๊ธ ์ค์ | `doc_id`, `text`, `section_index?`, `apply_page_type?` (both/even/odd) |
| `get_footer` | ๋ฐ๋ฅ๊ธ ๋ด์ฉ ์กฐํ | `doc_id`, `section_index?` |
| `set_footer` | ๋ฐ๋ฅ๊ธ ์ค์ | `doc_id`, `text`, `section_index?`, `apply_page_type?` (both/even/odd) |
### ๐ ๊ฐ์ฃผ/๋ฏธ์ฃผ (Footnotes/Endnotes) - 4๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_footnotes` | ๋ฌธ์ ๋ด ๋ชจ๋ ๊ฐ์ฃผ ๋ชฉ๋ก | `doc_id` |
| `insert_footnote` | ํน์ ์์น์ ๊ฐ์ฃผ ์ฝ์
| `doc_id`, `section_index`, `paragraph_index`, `text` |
| `get_endnotes` | ๋ฌธ์ ๋ด ๋ชจ๋ ๋ฏธ์ฃผ ๋ชฉ๋ก | `doc_id` |
| `insert_endnote` | ํน์ ์์น์ ๋ฏธ์ฃผ ์ฝ์
| `doc_id`, `section_index`, `paragraph_index`, `text` |
### ๐ ๋ถ๋งํฌ/ํ์ดํผ๋งํฌ (Bookmarks/Hyperlinks) - 4๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_bookmarks` | ๋ฌธ์ ๋ด ๋ชจ๋ ๋ถ๋งํฌ ๋ชฉ๋ก | `doc_id` |
| `insert_bookmark` | ํน์ ์์น์ ๋ถ๋งํฌ ์ฝ์
| `doc_id`, `section_index`, `paragraph_index`, `name` |
| `get_hyperlinks` | ๋ฌธ์ ๋ด ๋ชจ๋ ํ์ดํผ๋งํฌ ๋ชฉ๋ก | `doc_id` |
| `insert_hyperlink` | ํ์ดํผ๋งํฌ ์ฝ์
| `doc_id`, `section_index`, `paragraph_index`, `url`, `text` |
### โ ์์ (Equations) - 2๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_equations` | ๋ฌธ์ ๋ด ๋ชจ๋ ์์ ๋ชฉ๋ก | `doc_id` |
| `insert_equation` | ์์ ์ฝ์
(HWP ์์ ์คํฌ๋ฆฝํธ ํ์) | `doc_id`, `section_index`, `after_index`, `script` |
### ๐ฌ ๋ฉ๋ชจ (Memos/Comments) - 3๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_memos` | ๋ฌธ์ ๋ด ๋ชจ๋ ๋ฉ๋ชจ/์ฃผ์ ๋ชฉ๋ก | `doc_id` |
| `insert_memo` | ๋ฉ๋ชจ/์ฃผ์ ์ฝ์
| `doc_id`, `section_index`, `paragraph_index`, `content`, `author?` |
| `delete_memo` | ๋ฉ๋ชจ/์ฃผ์ ์ญ์ | `doc_id`, `memo_id` |
### ๐ ์น์
(Sections) - 5๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_sections` | ๋ฌธ์ ๋ด ๋ชจ๋ ์น์
๋ชฉ๋ก | `doc_id` |
| `insert_section` | ์ ์น์
์ฝ์
| `doc_id`, `after_index` |
| `delete_section` | ์น์
์ญ์ | `doc_id`, `section_index` |
| `get_section_xml` | **์น์
Raw XML ์กฐํ (AI ๋ฌธ์ ์กฐ์์ฉ)** | `doc_id`, `section_index?` |
| `set_section_xml` | **์น์
Raw XML ๊ต์ฒด (HWPML ํ์ ํ์)** | `doc_id`, `xml`, `section_index?`, `validate?` |
### ๐ญ ์คํ์ผ ์ ์ (Style Definitions) - 4๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_styles` | ๋ฌธ์์ ์ ์๋ ์คํ์ผ ๋ชฉ๋ก | `doc_id` |
| `get_char_shapes` | ๊ธ์ ๋ชจ์(CharShape) ์ ์ ๋ชฉ๋ก | `doc_id` |
| `get_para_shapes` | ๋ฌธ๋จ ๋ชจ์(ParaShape) ์ ์ ๋ชฉ๋ก | `doc_id` |
| `apply_style` | ๋จ๋ฝ์ ์คํ์ผ ์ ์ฉ | `doc_id`, `section_index`, `paragraph_index`, `style_id` |
### ๐ฐ ๋จ ์ค์ (Column Layout) - 2๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `get_column_def` | ๋จ(Column) ์ค์ ์กฐํ | `doc_id`, `section_index?` |
| `set_column_def` | ๋จ ์ค์ ๋ณ๊ฒฝ (๋ค๋จ ํธ์ง) | `doc_id`, `count`, `section_index?`, `type?`, `same_size?`, `gap?` |
### ๐ค ๋ด๋ณด๋ด๊ธฐ (Export) - 2๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `export_to_text` | ๋ฌธ์๋ฅผ ํ
์คํธ ํ์ผ๋ก ๋ด๋ณด๋ด๊ธฐ | `doc_id`, `output_path` |
| `export_to_html` | ๋ฌธ์๋ฅผ HTML ํ์ผ๋ก ๋ด๋ณด๋ด๊ธฐ | `doc_id`, `output_path` |
### โฉ๏ธ ์คํ ์ทจ์ (Undo/Redo) - 2๊ฐ
| Tool | ์ค๋ช
| ์ฃผ์ ํ๋ผ๋ฏธํฐ |
|------|------|--------------|
| `undo` | ๋ง์ง๋ง ๋ณ๊ฒฝ ์คํ ์ทจ์ | `doc_id` |
| `redo` | ์คํ ์ทจ์ํ ๋ณ๊ฒฝ ๋ค์ ์คํ | `doc_id` |
---
### ์ฌ์ฉ ์์
```typescript
// ๋ฌธ์ ์ด๊ธฐ
await mcp.open_document({ file_path: "report.hwpx" })
// ํ
์ด๋ธ ์
์์
await mcp.update_table_cell({
doc_id: "...",
section_index: 0,
table_index: 0,
row: 0,
col: 1,
text: "์์ ๋ ๋ด์ฉ"
})
// ์ค์ฒฉ ํ
์ด๋ธ ์ฝ์
(ํ ์์ ํ)
await mcp.insert_nested_table({
doc_id: "...",
section_index: 0,
parent_table_index: 0,
row: 1,
col: 2,
nested_rows: 2,
nested_cols: 2,
data: [["A1", "A2"], ["B1", "B2"]]
})
// Mermaid ๋ค์ด์ด๊ทธ๋จ ์ฝ์
await mcp.render_mermaid({
doc_id: "...",
mermaid_code: "graph TD; A-->B; B-->C;",
after_index: 0,
theme: "default"
})
// ์ ์ฅ
await mcp.save_document({ doc_id: "..." })
```
#### ํ
์ด๋ธ ์
๊ฒ์/์นํ ์ํฌํ๋ก์ฐ
๋์ผํ ํ
์คํธ๊ฐ ์ฌ๋ฌ ๊ณณ์ ์์ ๋ **ํน์ ์์น**๋ง ์์ ํ๋ ๋ฐฉ๋ฒ:
```typescript
// 1. ํ
์ด๋ธ ํฌํจ ๊ฒ์์ผ๋ก ์์น ํ์
const results = await mcp.search_text({
doc_id: "...",
query: "์์ ๋์",
include_tables: true // ํ
์ด๋ธ ์
ํฌํจ
})
// ๊ฒฐ๊ณผ: [{ text: "์์ ๋์", location: { type: "table", tableIndex: 2, row: 3, col: 1 } }, ...]
// 2. ์ํ๋ ์์น์ ์
๋ง ์ ๋ฐ ์นํ
await mcp.replace_text_in_cell({
doc_id: "...",
section_index: 0,
table_index: 2, // ๊ฒ์ ๊ฒฐ๊ณผ์์ ํ์ธํ ์์น
row: 3,
col: 1,
old_text: "์์ ๋์",
new_text: "์๋ก์ด๋ด์ฉ"
})
```
---
## ๐ Supported Format
| ํฌ๋งท | ํ์ฅ์ | ์ฝ๊ธฐ | ์ฐ๊ธฐ |
|------|--------|:----:|:----:|
| HWPX | .hwpx | โ
| โ
|
| HWP | .hwp | โ | โ |
> **Note**: HWP(๋ฐ์ด๋๋ฆฌ) ํ์ผ์ ์ง์ํ์ง ์์ต๋๋ค. ํ์ปด์คํผ์ค์์ HWPX๋ก ๋ณํ ํ ์ฌ์ฉํ์ธ์.
---
## ๐ Release Notes
### v0.4.0 (Enhanced Search & Diagram Support)
- ๐ **New Feature**: `search_text`์ `include_tables` ์ต์
์ถ๊ฐ - ํ
์ด๋ธ ์
๋ด ํ
์คํธ๋ ๊ฒ์
- ๐ **New Feature**: `replace_text_in_cell` - ํน์ ํ
์ด๋ธ ์
๋ด ํ
์คํธ๋ง ์ ๋ฐ ์นํ
- ๐ **New Feature**: `render_mermaid` - Mermaid ๋ค์ด์ด๊ทธ๋จ์ ์ด๋ฏธ์ง๋ก ๋ฌธ์์ ์ฝ์
- Flowchart, Sequence, Class Diagram ๋ฑ ๋ชจ๋ Mermaid ๋ฌธ๋ฒ ์ง์
- ํ
๋ง ์ ํ ๊ฐ๋ฅ (default, dark, forest, neutral)
- ๐ **New Feature**: `get_section_xml` / `set_section_xml` - ์น์
Raw XML ์ง์ ์กฐ์
- AI ๊ธฐ๋ฐ ๊ณ ๊ธ ๋ฌธ์ ํธ์ง ์๋๋ฆฌ์ค ์ง์
- ๐ง **Improvement**: `insert_image` ์์ ๊ฐ์
- BinData ํด๋์ ์ด๋ฏธ์ง ์๋ ์ ์ฅ
- content.hpf ๋งค๋ํ์คํธ ์๋ ๋ฑ๋ก
- ํ์ผ ์์ ์์ด ์ด๋ฏธ์ง ์ฝ์
๋ณด์ฅ
### v0.3.0 (Nested Table Support)
- ๐ **New Feature**: `insert_nested_table` - ํ
์ด๋ธ ์
์์ ์ค์ฒฉ ํ
์ด๋ธ ์ฝ์
๊ธฐ๋ฅ
- ๋ถ๋ชจ ํ
์ด๋ธ์ ํน์ ์
์ ์ ํ
์ด๋ธ์ ์ฝ์
- ์ด๊ธฐ ๋ฐ์ดํฐ ์ง์ ๊ฐ๋ฅ (2D ๋ฐฐ์ด)
- HWPX ํ์ค ๊ตฌ์กฐ(`treatAsChar`, `hp:subList`) ์๋ฒฝ ์ค์
- ๐ง **Improvement**: charSpacing ํ์ฑ ๊ฐ์ (์์ฑ ์์ ๋ฌด๊ดํ๊ฒ ์ฒ๋ฆฌ)
### v0.2.1 (Critical Fix)
- ๐ฅ **Critical Fix**: ๊ฐ์ ํ์ ์ฌ๋ฌ ์
๋์ ์์ ์ ํ์ผ ์์ ๋ฌธ์ ์์ ํด๊ฒฐ
- ํ(row)๋ณ ์
๋ฐ์ดํธ ๊ทธ๋ฃนํ๋ก ์ธ๋ฑ์ค ๋ถ์ผ์น ๋ฐฉ์ง
- ์ญ์(descending) ์ฒ๋ฆฌ๋ก ์์ ํ XML ์์ ๋ณด์ฅ
### v0.2.0 (Enhanced Edition)
- ๐ฅ **Major Fix**: ํ
์คํธ ์์ ์ lineseg ์๋ ์ด๊ธฐํ๋ก ๊ฒน์นจ ํ์ ์์ ํด๊ฒฐ
- ๐ง **Bug Fix**: ์ค์ฒฉ ํ
์ด๋ธ ๊ตฌ์กฐ์์ XML ์์ ๊ฒฝ๊ณ ์ค์ธ์ ๋ฌธ์ ์์
- ๐ก๏ธ **Stability**: ์์์ ํ์ผ ์ฐ๊ธฐ๋ก ํ์ผ ์์ ๋ฐฉ์ง
- ๐ฆ **Preservation**: ์๋ณธ charPr/spacing ์คํ์ผ ์์ ๋ณด์กด
### v0.1.0 (Original)
- ์ต์ด ๋ฆด๋ฆฌ์ค (mjyoo2/hwp-extension)
---
## ๐ Credits
- Original Project: [mjyoo2/hwp-extension](https://github.com/mjyoo2/hwp-extension)
- Enhanced by: [Dayoooun](https://github.com/Dayoooun)
---
## ๐ License
MIT
---
## ๐ค Contributing
๋ฒ๊ทธ ๋ฆฌํฌํธ ๋ฐ ๊ธฐ๋ฅ ์์ฒญ: [GitHub Issues](https://github.com/Dayoooun/hwp-extension/issues)