MCP Elicitation 폼 빌더
코딩중급
2025-06-18 MCP 스펙의 accept/decline/cancel 3-action 모델 기반 JSON Schema 요청을 생성하고, 플랫 객체 + 원시 타입 제약을 자동 검증합니다.
트리거
/mcp-elicit사용빈도per tool
MCP Server Author라면? Use /mcp-elicit to add interactive prompts to booking/approval tools
Backend Developer라면? Generate type-safe elicitation schemas with validation
MCPElicitationJSON Schema인터랙티브
작동 흐름
/mcp-elicit [use-case] run
↓
Phase 1: analyze and generate
schema-gen
Generate requestedSchema from use case
validation
Validate flat-object + primitive constraints
handler
Create response handler (accept/decline/cancel)
↓
Wire into MCP server tool handler
↓
✓ Elicitation-enabled tool with schema + handler
스킬 코드
# MCP Elicitation Form Builder
## Trigger: /mcp-elicit [use-case-description]
When invoked:
1. Analyze the use case and generate elicitation schema:
```typescript
// Example: travel booking tool needs dates
const elicitationRequest = {
method: "elicitation/create",
params: {
message: "Please provide your travel details",
requestedSchema: {
type: "object",
properties: {
destination: {
type: "string",
description: "Travel destination city"
},
departureDate: {
type: "string",
description: "Departure date (YYYY-MM-DD)"
},
returnDate: {
type: "string",
description: "Return date (YYYY-MM-DD)"
},
travelers: {
type: "number",
description: "Number of travelers"
}
},
required: ["destination", "departureDate"]
}
}
};
```
2. Generate response handler:
```typescript
const response = await client.request(elicitationRequest);
switch (response.action) {
case "accept":
// User submitted — process response.content
const { destination, departureDate } = response.content;
return await searchFlights(destination, departureDate);
case "decline":
// User explicitly said no
return { content: [{ type: "text", text: "Booking cancelled." }] };
case "cancel":
// User dismissed without choosing
return { content: [{ type: "text", text: "No action taken." }] };
}
```
3. Validation rules:
- Only flat objects (no nested objects/arrays)
- Only primitive types: string, number, boolean
- NEVER request sensitive info (passwords, tokens, SSN)
- Include clear descriptions for each field
복사해서 CLAUDE.md에 붙여넣으면 바로 사용할 수 있습니다.
MCP Elicitation 폼 빌더 작동 방식
MCP Elicitation Form Builder는 사용 사례를 분석하여 JSON Schema 기반 elicitation 요청 스키마를 생성하고, accept/decline/cancel 3가지 응답을 처리하는 핸들러를 만든 후, MCP 서버의 tool 핸들러에 연결합니다. 2025-06-18 스펙의 flat object + primitive 타입 제약을 자동으로 검증합니다.
MCP Elicitation 폼 빌더이(가) 빛나는 순간
예약, 승인, 데이터 입력 등 tool 실행 중 사용자에게 구조화된 질문을 해야 할 때 가장 유용합니다. 인터랙티브 프롬프트로 워크플로우를 중단 없이 진행할 수 있습니다.
핵심 특장점
- JSON Schema 기반 타입 안전한 사용자 입력 수집
- accept/decline/cancel 3-action 모델 완벽 지원
- MCP 2025-06-18 스펙 자동 검증
- 민감 정보 요청 방지 가드레일 내장