Skip to main content
Glama
egovframe-scaffold-mcp

egovframe-scaffold-mcp

by EricSeokgon

AI 계층 조립

add_ai_components

공식 egovframe-ai-rag 샘플 기반 AI RAG 챗봇(문서 업로드→임베딩→하이브리드 검색→LLM 응답)을 기존 Boot 프로젝트에 조립합니다. 소스·설정(application-ai.yml 프로필)·UI·인프라를 복사하고 pom에 누락 의존성만 마커 구간으로 삽입합니다(백업 생성, 제거 시 원복). 기존 파일과 충돌하면 아무것도 쓰지 않고 거부합니다. dryRun=true로 먼저 미리볼 수 있습니다.

Instructions

공식 egovframe-ai-rag 샘플 기반 AI RAG 챗봇(문서 업로드→임베딩→하이브리드 검색→LLM 응답)을 기존 Boot 프로젝트에 조립합니다. 소스·설정(application-ai.yml 프로필)·UI·인프라를 복사하고 pom에 누락 의존성만 마커 구간으로 삽입합니다(백업 생성, 제거 시 원복). 기존 파일과 충돌하면 아무것도 쓰지 않고 거부합니다. dryRun=true로 먼저 미리볼 수 있습니다. v1.20: Boot parent 가 5.1.0 이상이면(base=auto) 샘플 복사 대신 5.1.0 실행환경 AI 모듈(egovframe-rte-ai-core + Spring AI/LangChain4j 어댑터)을 쓰는 조립물을 프로젝트 패키지에 생성합니다 — 문서 추출(HWP·HWPX·DOCX·PDF·Markdown, 추출 한도)→정규화→한국어 문장 청킹→개인정보 마스킹→PGVector 재색인, 질의는 프롬프트 인젝션 가드→검색→OpenAI 호환 모델 응답(POST /ai/documents·/ai/ask), 접속 정보는 환경 변수 EGOV_AI_*. v1.22: search=hybrid 면 벡터 순위와 어휘(pg_trgm) 순위를 RRF 로 융합하고, EGOV-AI.md 에 프로젝트 보안 방식에 맞는 /ai/** 접근 통제 조각을 싣습니다.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectDir": "<projectDir>",
      "stack": "<stack>"
    },
    "name": "add_ai_components"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoegovframe-ai-rag 브랜치/태그 (기본: 카탈로그 기준 브랜치)
baseNoauto = Boot parent 5.1.0 이상이면 rte-ai, 아니면 sample. rte-ai = 5.1.0 AI 모듈로 생성(parent 5.1.0 이상 필요, 벡터 저장소 PGVector). sample = 공식 egovframe-ai-rag 샘플 복사auto
stackYesAI 스택: spring-ai | langchain4j. 상호 배타. 벡터 저장소 — sample: spring-ai=Redis Stack·langchain4j=PGVector, rte-ai: 둘 다 PGVector
dryRunNotrue면 복사·병합 없이 계획만 미리보기(네트워크 불필요)
searchNorte-ai(v1.22): dense = 벡터 검색(v1.20 과 같은 코드). hybrid = 벡터 + 어휘(pg_trgm) 순위를 RRF 로 융합 — 조문 번호·고유명사·약어 질의용, PostgreSQL pg_trgm 확장 필요dense
formatsNorte-ai: pom 에 넣을 문서 파서(기본 전부). Markdown 은 항상 지원
includeUiNo채팅 UI(chat.html·static) 복사
projectDirYes대상 프로젝트 디렉터리(절대경로 권장). egovframe-boot-starter-parent 기반 Boot 프로젝트
includeInfraNosample: docker-compose.ai.yml·Dockerfile.ai·k8s/ai 복사
includeTestsNo샘플 테스트 복사

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.22.0
    • addedInput schema / properties / search
      Added value: +{
      +  "default": "dense",
      +  "description": "rte-ai(v1.22): dense = 벡터 검색(v1.20 과 같은 코드). hybrid = 벡터 + 어휘(pg_trgm) 순위를 RRF 로 융합 — 조문 번호·고유명사·약어 질의용, PostgreSQL pg_trgm 확장 필요",
      +  "enum": [
      +    "dense",
      +    "hybrid"
      +  ],
      +  "type": "string"
      +}
  2. Changed4 schema fields changedv1.20.0
    • addedInput schema / properties / base
      Added value: +{
      +  "default": "auto",
      +  "description": "auto = Boot parent 5.1.0 이상이면 rte-ai, 아니면 sample. rte-ai = 5.1.0 AI 모듈로 생성(parent 5.1.0 이상 필요, 벡터 저장소 PGVector). sample = 공식 egovframe-ai-rag 샘플 복사",
      +  "enum": [
      +    "auto",
      +    "sample",
      +    "rte-ai"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / formats
      Added value: +{
      +  "description": "rte-ai: pom 에 넣을 문서 파서(기본 전부). Markdown 은 항상 지원",
      +  "items": {
      +    "enum": [
      +      "hwp",
      +      "hwpx",
      +      "docx",
      +      "pdf"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / includeInfra / description
      Previous value: -"docker-compose.ai.yml·Dockerfile.ai·k8s/ai 복사"New value: +"sample: docker-compose.ai.yml·Dockerfile.ai·k8s/ai 복사"
    • changedInput schema / properties / stack / description
      Previous value: -"AI 스택: spring-ai(Redis Stack) | langchain4j(PGVector). 상호 배타"New value: +"AI 스택: spring-ai | langchain4j. 상호 배타. 벡터 저장소 — sample: spring-ai=Redis Stack·langchain4j=PGVector, rte-ai: 둘 다 PGVector"
  3. Changed1 schema field changedv1.6.0
    • removedInput schema / additionalProperties
      Removed value: -false
  4. Addedv0.19.0

TDQS

A4.2/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations it discloses the traits that matter for a mutating tool: backups are created, changes are reverted on removal, dependencies are inserted only inside marker sections, and any conflict with existing files aborts with no writes at all (atomic). It also notes that dryRun needs no network and that generated artifacts expose endpoints and EGOV_AI_* environment variables, which is consistent with openWorldHint=true and destructiveHint=false.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and there is no filler, but the v1.20 sentence is a long run-on that crams the whole extraction→normalization→chunking→masking→reindex pipeline and the request endpoints into one breath. Version-tagged changelog phrasing ('v1.20:', 'v1.22:') pushes the definition toward release notes. It is dense and useful but not economically sized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter, non-idempotent assembly tool with no output schema, the description covers mode selection, safety (backup/refusal/restore), generated endpoints, and required environment variables. What it leaves out is what a call returns (created file list, plan preview shape for dryRun) and how it relates to the sibling remove/reassemble tools beyond the passing mention of restoration. That is a minor gap rather than a blocking one.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all ten parameters, including base, stack, search, formats, and dryRun. The description mostly restates those same semantics (auto/5.1.0 threshold, hybrid=RRF with pg_trgm) rather than adding new meaning. A few details such as extraction limits and the always-supported Markdown format are additive, but the baseline of 3 is right here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a concrete verb+resource+target: it assembles an AI RAG chatbot (upload→embedding→hybrid search→LLM answer) into an existing Boot project, and names the source (official egovframe-ai-rag sample). It is clearly distinguishable from the generic add_egovframe_components and from remove/reassemble siblings, which are only implied. An agent can identify the operation without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear situational guidance: only for existing Boot projects, use dryRun=true to preview first, and base=auto switches to rte-ai when the Boot parent is 5.1.0 or newer. What is missing is any explicit routing statement versus add_egovframe_components or reassemble_egovframe_components, so the agent must infer the boundary from names. The conditions it does state are precise and actionable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.