Skip to main content
Glama
EricSeokgon

egovframe-scaffold-mcp

by EricSeokgon

보안약점 자동 조치

fix_egovframe_secure_coding
Destructive

Fixes only rule-definable eGovFrame secure-coding findings, with dry-run and backup, and reports remaining issues as manual items with reasons.

Instructions

check_egovframe_secure_coding 이 찾은 항목 중 고친 결과를 규칙으로 정할 수 있는 것만 고치고, 나머지는 사유와 함께 수동 항목으로 냅니다. xss-cout-unescaped: 줄바꿈을 로 바꾸는 값은 fn:escapeXml 로 먼저 감싸고, 단순 속성 값은 escapeXml="false" 를 지웁니다(HTML 편집기 값일 수 있는 본문 필드는 수동, HTMLTagFilter 가 등록돼 있으면 요청 값이 엔티티로 저장되므로 ignoreHtmlTagFilter=true 가 아니면 모두 수동). print-stack-trace·debug-code: 클래스의 로거(SLF4J·Commons Logging·Log4j 2/1·Lombok)로 바꿉니다(로거가 없거나 정적 문맥에서 인스턴스 로거면 수동). cookie-flags: Secure·HttpOnly 는 동작을 바꾸므로 제안만. 공통컴포넌트 출처·테스트는 기본 제외(includeComponents·includeTests). 기본 dryRun(바뀔 줄과 재점검 결과), 적용은 파일 트랜잭션(원본은 migration-backup/)이며 재점검이 계획과 다르면(고친 항목만 사라지고 새 항목·다른 규칙 변화가 없어야 함) 적용하지 않습니다.

Input Schema

NameRequiredDescriptionDefault
topNNoMarkdown 에 보일 파일·수동 항목 수
pathsNo프로젝트 상대 경로 접두어로 좁히기
rulesNo조치할 규칙(기본 전체: xss-cout-unescaped·print-stack-trace·debug-code·cookie-flags)
dryRunNotrue(기본)면 파일을 쓰지 않고 계획·재점검만
formatNo응답 형식markdown
projectDirYes프로젝트 디렉터리(절대경로 권장)
includeTestsNosrc/test 도 고침
includeComponentsNo공통컴포넌트 출처(매니페스트·egovframework/com 경로)도 고침 — 업그레이드·재조립 때 원본으로 바뀔 수 있음
ignoreHtmlTagFilterNoHTMLTagFilter 가 등록돼 있어도 c:out 을 고침(필터를 걷어내고 출력 escape 로 바꿀 때만)

Output Schema

NameRequiredDescriptionDefault
filesYes
notesYes
byRuleYes
dryRunYes
manualYes
verifyYes
summaryYes
planPathNo
backupDirNo
projectDirYes
htmlTagFilterNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.9.0

TDQS

A4.6/5.0
Behavior5/5

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

With destructiveHint=true already declared, the description adds substantial context beyond annotations: which rules are auto-fixed, which are deliberately downgraded to suggestions only (cookie-flags), which are routed to manual (HTML editor body fields, no logger, static context), that originals are preserved in migration-backup/, and that writes use a file transaction. The recheck-gate rule ('고친 항목만 사라지고 새 항목·다른 규칙 변화가 없어야 함') is exactly the kind of safety contract an agent cannot infer from annotations.

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

Conciseness4/5

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

Front-loaded with the core contract, then per-rule behavior, then the dryRun/transaction gate—a logical order with no filler sentences. It is a dense block of semicolon-joined clauses that would scan faster as a short list, which is the only reason it is not a 5.

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

Completeness5/5

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

For a 9-parameter destructive fixer, the description covers the decision boundaries (which findings get fixed vs. deferred), the safety model (default dryRun, backup directory, transactional apply, recheck mismatch aborts), and the exclusion policy. An output schema exists, so return-value detail is correctly omitted.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description goes further by tying parameters to behavior: includeComponents/includeTests are off by default for provenance and test isolation, and ignoreHtmlTagFilter is conditioned on HTMLTagFilter being registered and the intent of switching to output escaping. That explains the concrete consequence of each flag rather than restating its schema text.

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?

Names a specific verb and resource ('고치고' / auto-remediation of secure-coding findings) and explicitly scopes the work as a subset of what check_egovframe_secure_coding reports, which distinguishes it from that sibling in one clause. An agent knows immediately this is the write-side counterpart of the checker.

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?

Establishes the workflow precondition (run the checker first, then fix only rule-determinable items) and states that remaining findings are emitted as manual items with reasons, which effectively tells the agent when this tool will not do the work. It does not explicitly name an alternative for the unfixable cases, but the manual-item fallback covers the routing need.

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