Hwp MCP Go
Go implementation of Model Context Protocol (MCP) server for HWP โ control Hangul Word Processor documents (create, edit, tables, images) via Claude and AI models using HWP COM API on Windows.
Installation
npx hwp-mcp-goAsk AI about Hwp MCP Go
Powered by Claude ยท Grounded in docs
I know everything about Hwp MCP Go. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
HWP-MCP-Go (ํ๊ธ Model Context Protocol - Go Implementation)
HWP-MCP-Go๋ ํ๊ธ ์๋ ํ๋ก์ธ์(HWP)๋ฅผ Claude์ ๊ฐ์ AI ๋ชจ๋ธ์ด ์ ์ดํ ์ ์๋๋ก ํด์ฃผ๋ Model Context Protocol(MCP) ์๋ฒ์ Go ๊ตฌํ์ฒด์ ๋๋ค.
์ฃผ์ ๊ธฐ๋ฅ
- ๋ฌธ์ ์์ฑ ๋ฐ ๊ด๋ฆฌ: ์ ๋ฌธ์ ์์ฑ, ์ด๊ธฐ, ์ ์ฅ ๊ธฐ๋ฅ
- ํ ์คํธ ํธ์ง: ํ ์คํธ ์ฝ์ , ๊ธ๊ผด ์ค์ , ๋จ๋ฝ ์ถ๊ฐ
- ํ ์ด๋ธ ์์ : ํ ์ด๋ธ ์์ฑ, ๋ฐ์ดํฐ ์ฑ์ฐ๊ธฐ, ์ด์ ์ฐ์ ์ซ์ ์ ๋ ฅ
- ๊ณ ์ฑ๋ฅ: Go์ ์ฑ๋ฅ๊ณผ ๋์์ฑ ์ฒ๋ฆฌ ๋ฅ๋ ฅ ํ์ฉ
- ํฌ๋ก์ค ํ๋ซํผ: Windows์์ HWP COM ์ธํฐํ์ด์ค ์ง์
์์คํ ์๊ตฌ์ฌํญ
- Windows ์ด์์ฒด์
- ํ๊ธ(HWP) ํ๋ก๊ทธ๋จ ์ค์น
- Go 1.21 ์ด์
์ค์น ๋ฐฉ๋ฒ
- ์ ์ฅ์ ํด๋ก :
git clone <repository-url>
cd hwp-mcp-go
- ์์กด์ฑ ์ค์น:
go mod tidy
- ๋น๋:
go build -o hwp-mcp-go.exe main.go
์ฌ์ฉ ๋ฐฉ๋ฒ
Claude์ ํจ๊ป ์ฌ์ฉํ๊ธฐ
Claude ๋ฐ์คํฌํฑ ์ค์ ํ์ผ์ ๋ค์๊ณผ ๊ฐ์ด HWP-MCP-Go ์๋ฒ๋ฅผ ๋ฑ๋กํ์ธ์:
{
"mcpServers": {
"hwp-go": {
"command": "๊ฒฝ๋ก/hwp-mcp-go.exe"
}
}
}
์ง์๋๋ ๋๊ตฌ๋ค
๋ฌธ์ ๊ด๋ฆฌ
hwp_create: ์ ๋ฌธ์ ์์ฑhwp_open: ๋ฌธ์ ์ด๊ธฐhwp_save: ๋ฌธ์ ์ ์ฅhwp_close: ๋ฌธ์ ๋ซ๊ธฐhwp_get_text: ๋ฌธ์ ํ ์คํธ ๊ฐ์ ธ์ค๊ธฐhwp_ping_pong: ์ฐ๊ฒฐ ํ ์คํธ
ํ ์คํธ ํธ์ง
hwp_insert_text: ํ ์คํธ ์ฝ์ (์ค๋ฐ๊ฟ ๋ณด์กด ์ต์ )hwp_set_font: ๊ธ๊ผด ์ค์ (์ด๋ฆ, ํฌ๊ธฐ, ๊ตต๊ฒ, ๊ธฐ์ธ์, ๋ฐ์ค)hwp_insert_paragraph: ๋จ๋ฝ ์ฝ์hwp_batch_operations: ๋ค์ค ์์ ๋ฐฐ์น ์คํhwp_create_document_from_text: ํ ์คํธ๋ก๋ถํฐ ๋ฌธ์ ์์ฑ
์ด๋ฏธ์ง ์ฒ๋ฆฌ
hwp_insert_image: ์ด๋ฏธ์ง ์ฝ์ (ํฌ๊ธฐ ์กฐ์ , ์ข ํก๋น, ํจ๊ณผ, ์ํฐ๋งํฌ ๋ฑ)
ํ ์ด๋ธ ์์
hwp_insert_table: ํ ์ด๋ธ ์์ฑhwp_fill_table_with_data: ํ ์ด๋ธ์ ๋ฐ์ดํฐ ์ฑ์ฐ๊ธฐhwp_fill_column_numbers: ์ด์ ์ฐ์ ์ซ์ ์ฑ์ฐ๊ธฐhwp_create_table_with_data: ๋ฐ์ดํฐ์ ํจ๊ป ํ ์ด๋ธ ์์ฑ
ํ ์ด๋ธ ์กฐ์
hwp_insert_left_column: ์ผ์ชฝ์ ์ด ์ฝ์hwp_insert_right_column: ์ค๋ฅธ์ชฝ์ ์ด ์ฝ์hwp_insert_upper_row: ์์ชฝ์ ํ ์ฝ์hwp_insert_lower_row: ์๋์ชฝ์ ํ ์ฝ์hwp_move_to_left_cell: ์ผ์ชฝ ์ ๋ก ์ด๋hwp_move_to_right_cell: ์ค๋ฅธ์ชฝ ์ ๋ก ์ด๋hwp_move_to_upper_cell: ์์ชฝ ์ ๋ก ์ด๋hwp_move_to_lower_cell: ์๋์ชฝ ์ ๋ก ์ด๋hwp_merge_table_cells: ํ ์ด๋ธ ์ ๋ณํฉhwp_merge_tables: ์ธ์ ํ ํ ์ด๋ธ ๋ณํฉ
๊ณ ๊ธ ๋ฌธ์ ์์ฑ
hwp_create_complete_document: ์์ ํ ๋ฌธ์ ์์ฑ (๋ณด๊ณ ์, ํธ์ง, ๋ฉ๋ชจ)
API ์์
์ ๋ฌธ์ ์์ฑ ๋ฐ ํ ์คํธ ์ฝ์
# ์ ๋ฌธ์ ์์ฑ
curl -X POST http://localhost:8080/tools/hwp_create
# ํ
์คํธ ์ฝ์
curl -X POST http://localhost:8080/tools/hwp_insert_text \
-d '{"text": "์๋
ํ์ธ์, ํ๊ธ ๋ฌธ์์
๋๋ค."}'
# ๊ธ๊ผด ์ค์
curl -X POST http://localhost:8080/tools/hwp_set_font \
-d '{"name": "๋ง์ ๊ณ ๋", "size": 14, "bold": true}'
ํ ์ด๋ธ ์์ฑ ๋ฐ ๋ฐ์ดํฐ ์ ๋ ฅ
# 3x3 ํ
์ด๋ธ ์์ฑ
curl -X POST http://localhost:8080/tools/hwp_insert_table \
-d '{"rows": 3, "cols": 3}'
# ํ
์ด๋ธ์ ๋ฐ์ดํฐ ์ฑ์ฐ๊ธฐ
curl -X POST http://localhost:8080/tools/hwp_fill_table_with_data \
-d '{
"data": [
["์", "ํ", "์"],
["1", "2", "3"],
["4", "5", "6"]
],
"has_header": true
}'
# ์ฒซ ๋ฒ์งธ ์ด์ 1-10 ์ซ์ ์ฑ์ฐ๊ธฐ
curl -X POST http://localhost:8080/tools/hwp_fill_column_numbers \
-d '{"start": 1, "end": 10, "column": 1}'
ํ๋ก์ ํธ ๊ตฌ์กฐ
hwp-mcp-go/
โโโ hwp-mcp-server/ # ๋ฉ์ธ ์๋ฒ ์ ํ๋ฆฌ์ผ์ด์
โ โโโ main.go # ์๋ฒ ์ง์
์ ๋ฐ ๋๊ตฌ ๋ฑ๋ก
โ โโโ internal/ # ๋ด๋ถ ํจํค์ง
โ โโโ hwp/ # HWP COM ์ธํฐํ์ด์ค
โ โ โโโ controller.go # HWP ์ปจํธ๋กค๋ฌ ๋ฐ ์ค๋ ๋ ๊ด๋ฆฌ
โ โโโ handlers/ # MCP ๋๊ตฌ ํธ๋ค๋ฌ
โ โโโ document.go # ๋ฌธ์ ๊ด๋ฆฌ ๋๊ตฌ
โ โโโ text.go # ํ
์คํธ ์กฐ์ ๋๊ตฌ
โ โโโ table.go # ํ
์ด๋ธ ์์
๋๊ตฌ
โ โโโ advanced.go # ๊ณ ๊ธ ๋ฌธ์ ์์ฑ ๋๊ตฌ
โโโ test-client/ # ํ
์คํธ ํด๋ผ์ด์ธํธ
โ โโโ test.go # MCP ํ๋กํ ์ฝ ํ
์คํธ
โโโ go.mod # Go ๋ชจ๋ ์ ์
โโโ go.sum # ์์กด์ฑ ์ฒดํฌ์ฌ
โโโ README.md # ํ๋ก์ ํธ ๋ฌธ์
โโโ CLAUDE.md # Claude Code ์ง์นจ
โโโ .gitignore # Git ๋ฌด์ ํ์ผ
๊ธฐ์ ์คํ
- Go: ๋ฉ์ธ ํ๋ก๊ทธ๋๋ฐ ์ธ์ด
- mark3labs/mcp-go: Model Context Protocol Go ๊ตฌํ์ฒด
- go-ole: Windows COM ์ธํฐํ์ด์ค ์ง์
- HWP COM API: ํ๊ธ ํ๋ก๊ทธ๋จ ์ ์ด
Python ๋ฒ์ ๊ณผ์ ์ฐจ์ด์
- ์ฑ๋ฅ: Go์ ์ปดํ์ผ๋ ๋ฐ์ด๋๋ฆฌ๋ก ๋ ๋น ๋ฅธ ์คํ ์๋
- ๋ฉ๋ชจ๋ฆฌ ํจ์จ์ฑ: Go์ ๊ฐ๋น์ง ์ปฌ๋ ํฐ์ ํจ์จ์ ์ธ ๋ฉ๋ชจ๋ฆฌ ๊ด๋ฆฌ
- ๋์์ฑ: Go์ ๊ณ ๋ฃจํด์ ํ์ฉํ ๋น๋๊ธฐ ์ฒ๋ฆฌ ์ง์
- ๋ฐฐํฌ: ๋จ์ผ ์คํ ํ์ผ๋ก ๋ฐฐํฌ ๊ฐ๋ฅ (Python ์ธํฐํ๋ฆฌํฐ ๋ถํ์)
- ํ์ ์์ ์ฑ: ์ ์ ํ์ ์์คํ ์ผ๋ก ๋ฐํ์ ์ค๋ฅ ๊ฐ์
๊ฐ๋ฐ ๋ฐ ๊ธฐ์ฌ
๋ก์ปฌ ๊ฐ๋ฐ
# ๊ฐ๋ฐ ๋ชจ๋๋ก ์คํ
go run main.go
# ํ
์คํธ ์คํ
go test ./...
# ๋ฆฐํฐ ์คํ (golangci-lint ํ์)
golangci-lint run
๊ธฐ์ฌ ๋ฐฉ๋ฒ
- ์ด์ ์ ๋ณด ๋๋ ๊ธฐ๋ฅ ์ ์: GitHub ์ด์๋ฅผ ์ฌ์ฉํ์ธ์.
- ์ฝ๋ ๊ธฐ์ฌ: Pull Request๋ฅผ ์ ์ถํ์ธ์.
- ์ฝ๋ ์คํ์ผ: Go์ ํ์ค ํฌ๋งทํ
์ ๋ฐ๋ผ์ฃผ์ธ์ (
go fmt).
ํธ๋ฌ๋ธ์ํ
HWP ์ฐ๊ฒฐ ์คํจ
- ํ๊ธ ํ๋ก๊ทธ๋จ์ด ์ค์น๋์ด ์๋์ง ํ์ธ
- Windows์ COM ๋ณด์ ์ค์ ํ์ธ
- ๊ด๋ฆฌ์ ๊ถํ์ผ๋ก ์คํ ์๋
COM ์ธํฐํ์ด์ค ์ค๋ฅ
go-oleํจํค์ง๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ค์น๋์๋์ง ํ์ธ- Windows ํ๊ฒฝ์์๋ง ์คํ ๊ฐ๋ฅ
๋ผ์ด์ ์ค
์ด ํ๋ก์ ํธ๋ MIT ๋ผ์ด์ ์ค์ ๋ฐ๋ผ ๋ฐฐํฌ๋ฉ๋๋ค. ์์ธํ ๋ด์ฉ์ LICENSE ํ์ผ์ ์ฐธ์กฐํ์ธ์.
๊ด๋ จ ํ๋ก์ ํธ
ํ ์คํธ ๋ฐฉ๋ฒ
์๋ ํ ์คํธ ์คํ
1. ๋ฐฐ์น ์คํฌ๋ฆฝํธ ์ฌ์ฉ (Windows)
test.bat
2. Python ํ ์คํธ ํด๋ผ์ด์ธํธ
python test_mcp_client.py
3. Go ํ ์คํธ ํด๋ผ์ด์ธํธ
# ๋น๋ ํ ์คํ
go build -o test-client.exe test_mcp_client.go
test-client.exe
์๋ ํ ์คํธ
1. ์๋ฒ ์์
./hwp-mcp-go.exe
2. ๋ค๋ฅธ ํฐ๋ฏธ๋์์ JSON-RPC ์์ฒญ ์ ์ก
# Initialize
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"roots":{"listChanged":true}},"clientInfo":{"name":"test-client","version":"1.0.0"}}}' | ./hwp-mcp-go.exe
# List tools
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | ./hwp-mcp-go.exe
# Ping test
echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"hwp_ping_pong","arguments":{"message":"ํ"}}}' | ./hwp-mcp-go.exe
ํ ์คํธ ํญ๋ชฉ
- โ MCP ํ๋กํ ์ฝ ์ด๊ธฐํ
- โ ๋๊ตฌ ๋ชฉ๋ก ์กฐํ
- โ ํํ ํ ์คํธ (์๋ฒ ์ฐ๊ฒฐ ํ์ธ)
- โ HWP ๋ฌธ์ ์์ฑ (ํ๊ธ ํ๋ก๊ทธ๋จ ํ์)
- โ ํ ์คํธ ์ฝ์ ํ ์คํธ
- โ HWP ์ฐ๊ฒฐ ์ข ๋ฃ
๋ฌธ์ ํด๊ฒฐ
COM ์ด๊ธฐํ ์ค๋ฅ
- Windows์์๋ง ์คํ ๊ฐ๋ฅ
- ๊ด๋ฆฌ์ ๊ถํ์ผ๋ก ์คํ ์๋
- ํ๊ธ ํ๋ก๊ทธ๋จ์ด ์ค์น๋์ด ์๋์ง ํ์ธ
์ฐ๊ฒฐ ์คํจ
- ๋ฐฉํ๋ฒฝ ์ค์ ํ์ธ
- ํ๊ธ ํ๋ก๊ทธ๋จ ๋ฒ์ ํธํ์ฑ ํ์ธ
๋ณ๊ฒฝ ๋ก๊ทธ
v1.0.0
- Python hwp-mcp์ Go ํฌํ ์๋ฃ
- mark3labs/mcp-go ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ
- ๋ชจ๋ ์ฃผ์ ๊ธฐ๋ฅ ๊ตฌํ (๋ฌธ์ ๊ด๋ฆฌ, ํ ์คํธ ํธ์ง, ํ ์ด๋ธ ์์ )
- Windows COM ์ธํฐํ์ด์ค ์ง์
- ์๋ ํ ์คํธ ํด๋ผ์ด์ธํธ ์ถ๊ฐ (Go, Python, Batch)
