A Node.js server that implements Model Context Protocol (MCP) for controlling HWP (Korean word processor) documents, allowing AI assistants like Claude to create and manipulate Hangul documents.
HWP-MCP는 한글 워드 프로세서(HWP)를 Claude와 같은 AI 모델이 제어할 수 있도록 해주는 Model Context Protocol(MCP) 서버입니다. 이 프로젝트는 한글 문서를 자동으로 생성, 편집, 조작하는 기능을 AI에게 제공합니다.
git clone https://github.com/jkf87/hwp-mcp.git cd hwp-mcp
pip install -r requirements.txt
pip install mcp
Claude 데스크톱 설정 파일에 다음과 같이 HWP-MCP 서버를 등록하세요:
{ "mcpServers": { "hwp": { "command": "python", "args": ["경로/hwp-mcp/hwp_mcp_stdio_server.py"] } } }
hwp_create()
hwp_insert_text("원하는 텍스트를 입력하세요.")
# 테이블 생성 hwp_insert_table(rows=5, cols=2) # 테이블에 데이터 채우기 hwp_fill_table_with_data([ ["월", "판매량"], ["1월", "120"], ["2월", "150"], ["3월", "180"], ["4월", "200"] ], has_header=True) # 표에 연속된 숫자 채우기 hwp_fill_column_numbers(start=1, end=10, column=1, from_first_cell=True)
hwp_save("경로/문서명.hwp")
hwp_batch_operations([ {"operation": "hwp_create"}, {"operation": "hwp_insert_text", "params": {"text": "제목"}}, {"operation": "hwp_set_font", "params": {"size": 20, "bold": True}}, {"operation": "hwp_save", "params": {"path": "경로/문서명.hwp"}} ])
hwp-mcp/
├── hwp_mcp_stdio_server.py # 메인 서버 스크립트
├── requirements.txt # 의존성 패키지 목록
├── hwp-mcp-구조설명.md # 프로젝트 구조 설명 문서
├── src/
│ ├── tools/
│ │ ├── hwp_controller.py # 한글 제어 핵심 컨트롤러
│ │ └── hwp_table_tools.py # 테이블 관련 기능 전문 모듈
│ ├── utils/ # 유틸리티 함수
│ └── __tests__/ # 테스트 모듈
└── security_module/
└── FilePathCheckerModuleExample.dll # 보안 모듈
기본적으로 한글 프로그램은 외부에서 파일 접근 시 보안 경고를 표시합니다. 이를 우회하기 위해 FilePathCheckerModuleExample.dll
모듈을 사용합니다. 만약 보안 모듈 등록에 실패해도 기능은 작동하지만, 파일 열기/저장 시 보안 대화 상자가 표시될 수 있습니다.
한글 프로그램이 실행 중이지 않을 경우 연결에 실패할 수 있습니다. 한글 프로그램이 설치되어 있고 정상 작동하는지 확인하세요.
테이블에 데이터를 입력할 때 커서 위치가 예상과 다르게 동작하는 경우가 있었으나, 현재 버전에서는 이 문제가 해결되었습니다. 테이블의 모든 셀에 정확하게 데이터가 입력됩니다.
hwp_table_tools.py
) 추가hwp_fill_column_numbers
함수에 from_first_cell
옵션 추가이 프로젝트는 MIT 라이선스에 따라 배포됩니다. 자세한 내용은 LICENSE 파일을 참조하세요.
프로젝트 관련 문의는 GitHub 이슈, 코난쌤를 통해 해주세요.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!