Skip to content

v0.5.0 — MCP server (rhwp-mcp)#16

Merged
DanMeon merged 12 commits into
mainfrom
feature/v0.5.0
May 7, 2026
Merged

v0.5.0 — MCP server (rhwp-mcp)#16
DanMeon merged 12 commits into
mainfrom
feature/v0.5.0

Conversation

@DanMeon
Copy link
Copy Markdown
Owner

@DanMeon DanMeon commented May 7, 2026

Summary

  • rhwp-mcpModel Context Protocol 서버 신설. LLM 에이전트 (Claude Desktop / Cursor / Cline / Continue.dev / Goose / 자체 에이전트) 가 HWP/HWPX 를 직접 파싱·요약·청크화 가능. standalone fastmcp v3 기반 (2026-05 현업 표준 — MCP 서버 약 70% 시장 점유)
  • 7 도구 / 2 transportparse_hwp_summary / extract_text / get_ir / iter_blocks / to_markdown / to_html / chunks × stdio (기본, Claude Desktop) + streamable-http (옵션, uvicorn ASGI). unsendable 안전 패턴 강제 (sync handler), chunkslangchain-text-splitters 런타임 extras gate
  • GA 준비 완료 — 11/11 인수조건 충족, stages/stage-{1..5} Frozen, Cargo.toml 0.4.0 → 0.5.0, CHANGELOG [0.5.0] — 2026-05-06 추가

Why

v0.4.0 IR view 렌더러까지 GA 후 LLM 에이전트 표면이 비었음. MCP 가 사실상 표준 프로토콜로 정착하면서 (Claude Desktop / Cursor 등 1st-party 통합) HWP/HWPX 가 LLM 워크플로우에 직접 들어갈 수 있는 진입점이 필요. v0.5.0 시점이 sweet spot — IR / view / chunks 표면이 모두 안정화되어 도구 surface 가 의미 있는 기능을 묶어냄.

ADR § 1 SDK 결정은 처음 공식 mcp SDK 채택으로 출발했다가 S1 진행 중 standalone fastmcp v3 (jlowin) 으로 갱신 — 2026-05 현업 패턴 (시장 점유 약 70% + v3 의 OAuth / OpenTelemetry / server composition / streamable-http 우선 같은 프로덕션 기능). 공식 SDK 의 FastMCP v1 은 frozen 상태라 새 기능 부재. 결정 사항 매트릭스는 docs/design/v0.5.0/mcp-research.md § 1.

부수적으로 docs-lint 정책 옵션 A 적용 — Frozen + target 조합을 docs/implementation/vX.Y.Z/ pre-GA stage log 에 한해 허용 (Rust RFC / PEP / ADR 의 editorial vs release 차원 분리 패턴 정합).

주요 변경

영역 변경
코드 (신규) python/rhwp/mcp/{__init__.py, __main__.py, server.py, tools.py} (404 lines), tests/test_mcp_server.py (620 lines, 40 테스트), examples/06_mcp_server.py (158 lines)
extras / scripts [mcp] = ["fastmcp>=3,<4"], [mcp-chunks], [examples] fastmcp 합집합, rhwp-mcp = "rhwp.mcp:run" entry point
문서 (신규) docs/roadmap/v0.5.0/mcp.md (Frozen, 11 AC), docs/design/v0.5.0/mcp-research.md (Frozen, 4 결정 매트릭스), docs/implementation/v0.5.0/stages/stage-{1..5}.md (Frozen)
문서 (갱신) README § "MCP server (rhwp-mcp)" 신설, examples/README § 6, roadmap/README v0.5.0 row Frozen, CONVENTIONS § ga/target schema 예외 명시
Living-policy scripts/_doc_lint.py is_pre_ga_stage 면제 분기 추가 — pre-GA stage log 의 Frozen + target 허용
CI test-without-extras skip count 4 → 5 (test_mcp_server.py gated by fastmcp), pyright 대상에 추가, AGENTS.md / CLAUDE.md 동기
Build Cargo.toml 0.4.0 → 0.5.0, CHANGELOG [0.5.0] — 2026-05-06, external/rhwp submodule pin 0fb3e67 유지 (pure Python layer)

Test plan

  • uv run pytest tests/ -m "not slow"569 passed, 2 skipped
  • uv run pytest tests/test_mcp_server.py (slow 포함) → 40 passed
  • uv run ruff check (S1~S5 변경분) → clean
  • uv run pyright python/ tests/test_mcp_server.py examples/06_mcp_server.py → 0 errors
  • uv run python scripts/lint_docs.py → exit 0
  • uv run python scripts/generate_spec_trace.py --check → up to date
  • code-reviewer fresh-context 검증 (S1, S2, S3, S4 각 stage 후) → BLOCKER 0 / HIGH 모두 반영
  • AC-1 ~ AC-11 sweep — 11/11 충족 (stage-5.md § AC sweep evidence 매핑)
  • 실제 손 검증 — Claude Code .mcp.json 으로 uv run rhwp-mcp stdio 통합, 7 도구 노출 확인
  • pip install rhwp-python[mcp] 후 Claude Desktop claude_desktop_config.json 등록 손 검증 (release 후)
  • rhwp-mcp --transport streamable-http --port N 컨테이너 배포 손 검증 (release 후)

🤖 Generated with Claude Code

DanMeon and others added 12 commits May 6, 2026 14:07
변경사항:
- AGENTS.md async direction 노트에서 LlamaIndex / Haystack 언급 제거, "LangChain (or future RAG framework)" 으로 교체
- roadmap/README.md v0.5.0 ~ v0.6.0 RAG 프레임워크 통합 섹션 삭제, "v0.5.0+ 미정 (demand-driven)" narrative 로 교체
- v0.8.0 ~ v1.0.0 선행 조건을 "v0.6.0 까지 GA" → "v0.5.0+ minor 들 GA" 로 수정
- v0.7.0/mcp.md 에서 LlamaIndex / Haystack 도구 노출 / 통합 패턴 설명을 LangChain 단독 기준으로 정리, last_updated 2026-05-06

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
변경사항:
- mcp.md / mcp-research.md 를 v0.7.0 → v0.5.0 으로 이동 (git rename 인식)
- spec body sweet-spot 논거 v0.5.0 시점 기준 재서술 (v0.4.0 view + v0.3.0 LangChain 만 의존, RAG wave 보류 명시)
- README 활성 spec 인덱스 row + 현재 상태 + 미착수 narrative (v0.5.0+ → v0.6.0+) + v0.8.0 prereq 갱신
- CONVENTIONS Draft 예시 / retrofit narrative 의 동적 spec 인스턴스 참조 제거 (추상 패턴으로 교체) — 정책 SSOT 안정성 회복
- spec-system-overhaul Frozen impl log 의 broken-link 수정만 (v0.7.0 → v0.5.0)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
변경사항:
- python/rhwp/mcp/ 패키지 신설 — FastMCP 인스턴스 + 4 sync 도구 (parse_hwp_summary / extract_text / get_ir / iter_blocks), stdio transport, unsendable 안전 패턴 강제
- pyproject.toml [mcp] / [mcp-chunks] extras + rhwp-mcp entry point 추가 (fastmcp>=3,<4)
- tests/test_mcp_server.py 18개 — AC-2/3/4/5/9/10 매핑 (file-level importorskip("fastmcp"))
- CI test-without-extras skip count 4→5, pyright 대상에 test_mcp_server.py 추가
- spec ADR § 1 갱신 (Draft in-place): 공식 mcp SDK → standalone fastmcp v3 — 2026-05 현업 표준 (시장 점유 약 70%) + v3 의 OAuth / OpenTelemetry / server composition 기능
- docs-lint 정책 갱신: Frozen + target 조합을 docs/implementation/vX.Y.Z/ pre-GA stage log 에 한해 허용 — Rust RFC / PEP / ADR 의 editorial vs release 차원 분리 패턴 정합
- AGENTS.md / CLAUDE.md gated file 카운트 4→5
- docs/implementation/v0.5.0/stages/stage-1.md (Frozen+target) 신설
- coverage trace 자동 갱신 (7 AC 매핑 추가)
- 의존성 업데이트 (fastmcp>=3,<4 트리)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
변경사항:
- python/rhwp/mcp/tools.py 에 to_markdown / to_html 추가 — v0.4.0 view API thin wrapper (byte-equality 보장)
- python/rhwp/mcp/server.py build_server() 가 6 도구 등록 (S1 코어 4 + S2 view 2)
- tests/test_mcp_server.py: TestToMarkdown / TestToHtml 신설 (AC-6 매핑), test_lists_exactly_six_tools 로 rename
- docs/implementation/v0.5.0/stages/stage-2.md 작성 (Frozen, target v0.5.0) — S2 결정 사항·검증·S3 인계
- docs/traces/coverage.md auto-regen — AC-6 매핑 3 건 추가

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
변경사항:
- python/rhwp/mcp/tools.py 에 chunks 추가 — langchain-text-splitters lazy import + ImportError 시 친절 메시지
- python/rhwp/mcp/server.py build_server() 가 7 도구 등록 (mcp.md AC-2 GA 기준 충족)
- tests/test_mcp_server.py: TestChunks 신설 (smoke 3 + AC-7 missing-extras 2), test_lists_exactly_seven_tools 로 rename
- docs/implementation/v0.5.0/stages/stage-3.md 작성 (Frozen, target v0.5.0) — extras gate 위치·메시지·smoke 게이트 결정
- docs/traces/coverage.md auto-regen — AC-7 매핑 2 건 추가

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
변경사항:
- python/rhwp/mcp/tools.py chunks 시그니처에 include_furniture: bool = False 추가 — HwpLoader 동일 의미를 MCP 표면에 노출 (ir-blocks 모드에서만 작동, 다른 모드는 silently 무시)
- docs/roadmap/v0.5.0/mcp.md §노출 도구 chunks row 시그니처 갱신
- tests/test_mcp_server.py TestChunks 에 2 테스트 추가 — furniture 청크 yield 검증, 모드별 무시 검증
- docs/traces/coverage.md auto-regen — 새 테스트 2 건 매핑

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… / --port)

변경사항:
- python/rhwp/mcp/server.py run() 에 argparse 추가 — --transport stdio | streamable-http, --host, --port 옵션 + stdio 와 명시 host/port 충돌 fail-fast 검증
- tests/test_mcp_server.py TestTransportCli 신설 (10 테스트 — argparse 7 + dispatch mock 2 + slow smoke 1)
- docs/implementation/v0.5.0/stages/stage-4.md 작성 (Frozen, target v0.5.0) — argparse 채택 / smoke 게이트 / S5 인계 결정
- docs/traces/coverage.md auto-regen — AC-8 매핑 추가

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
변경사항:
- README.md § MCP server (rhwp-mcp) 신설 — 도구 7 종 표 + 설치 / Claude Desktop 등록 JSON / 클라이언트 호환성 표 + streamable-http 사용 예
- examples/06_mcp_server.py 신설 — fastmcp Client in-process round-trip 데모 (7 도구 차례 호출), --skip-chunks 옵션
- examples/README.md § 6 row 추가, [examples] extras 갱신 안내
- pyproject.toml [examples] extras 에 fastmcp>=3,<4 추가 — pip install rhwp-python[examples] 한 줄로 06 까지 실행 가능
- docs/implementation/v0.5.0/stages/stage-5.md 작성 (Frozen, target v0.5.0) — AC-1~AC-11 sweep 11/11 충족 + GA 절차 인계

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
변경사항:
- spec / ADR frontmatter status: Draft → Frozen, target → ga: v0.5.0 전환 (mcp.md, mcp-research.md)
- 구현 로그 5 파일 (stages/stage-1 ~ stage-5) frontmatter target → ga: v0.5.0 일괄 (post-S1 docs-lint 정책: pre-GA stage 면제 분기 → GA 후 ga 라벨 부여)
- roadmap/README.md — 활성 spec 인덱스 v0.5.0 row Status Frozen, 구현 로그 표 v0.5.0 row 추가, 현재 상태 섹션 갱신 (2026-05-06 GA), v0.6.0+ narrative 의 v0.5.0 참조 Draft → Frozen

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
변경사항:
- Cargo.toml version 0.4.0 → 0.5.0 (publish.yml verify-version 가드 통과 조건)
- CHANGELOG.md [0.5.0] — 2026-05-06 섹션 분리 — Added / Changed / Build / Notes
- external/rhwp submodule pin 0fb3e67 유지 (pure Python MCP layer, 상류 변경 0)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
변경사항:
- tests/test_mcp_server.py 의 ``import tomllib`` 분기를 ``try/except ModuleNotFoundError`` → ``if sys.version_info >= (3, 11)`` guard 로 교체
- pyright 의 statically-resolved 모듈 검증을 통과 — Python 3.10 venv (tomllib stdlib 부재) 에서도 tomli 폴백을 정확히 보고
- 모듈-레벨 ``import sys`` 추가 (테스트 함수 안 import 와 별도)
- 런타임 동작 동일 — pytest>=8 의 transitive ``tomli>=1; python_version<'3.11'`` 가 이미 testing extras 에 가용

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@DanMeon DanMeon merged commit 9adacfa into main May 7, 2026
17 checks passed
@DanMeon DanMeon deleted the feature/v0.5.0 branch May 7, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant