CPN 한국어 자습서 · 외부 문서 한국어 미러
MCP 문서 · Specification
Cancellation · 원문: modelcontextprotocol.io/specification/2025-11-25/basic/utilities/cancellation
아래는 원문을 한국어로 옮긴 미러입니다. 코드·명령은 원문 그대로이며, 가장 최신 정보는 하단 원문 링크에서 확인하세요.
MCP(Model Context Protocol)는 알림 메시지를 통해 진행 중인 요청을 선택적으로 취소하는 기능을 지원합니다. 어느 쪽이든 취소 알림을 전송하여 이전에 발행한 요청을 종료해야 함을 나타낼 수 있습니다.
진행 중인 요청을 취소하려는 측은 다음을 포함하는 notifications/cancelled 알림을 전송합니다.
{
"jsonrpc": "2.0",
"method": "notifications/cancelled",
"params": {
"requestId": "123",
"reason": "User requested cancellation"
}
}
initialize 요청을 취소해서는 안 됩니다(MUST NOT).notifications/cancelled 알림 대신 tasks/cancel 요청을 사용해야 합니다(MUST). 태스크는 최종 태스크 상태를 반환하는 전용 취소 메커니즘을 가지고 있습니다.네트워크 지연으로 인해 취소 알림이 요청 처리가 완료된 후, 또는 응답이 이미 전송된 후에 도착할 수 있습니다.
양측은 이러한 경쟁 조건을 정상적으로 처리해야 합니다(MUST).
sequenceDiagram
participant Client
participant Server
Client->>Server: Request (ID: 123)
Note over Server: Processing starts
Client--)Server: notifications/cancelled (ID: 123)
alt
Note over Server: Processing may have<br/>completed before<br/>cancellation arrives
else If not completed
Note over Server: Stop processing
end
유효하지 않은 취소 알림은 무시해야 합니다(SHOULD).
이는 비동기 통신에서 경쟁 조건을 허용하면서도 알림의 "fire and forget" 특성을 유지합니다.
원문(영어): https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/cancellation · 본 문서는 학습용 한국어 번역이며 원본의 권리는 원저작자(Model Context Protocol)에게 있습니다.
원문(영어): https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/cancellation