Non-destructive write tools omit `destructiveHint: false`, causing conservative approval prompts
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Bắt đầu bằng cách xác định các đăng ký của create_branch và create_pull_request, sau đó so sánh ToolAnnotations của chúng với create_pull_request_review và delete_file. Kiểm tra các công cụ ghi khác được đề cập trong issue, đánh dấu rõ ràng các thao tác mang tính bổ sung là không gây phá hủy, đồng thời xử lý thận trọng hành vi ghi đè hoặc xóa. Hoàn thành khi các annotation liên quan đã được phân loại và các bài kiểm thử công cụ hiện có đều chạy đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Some clearly non-destructive/additive GitHub MCP tools set ReadOnlyHint: false but omit DestructiveHint: false.
Under the MCP ToolAnnotations contract, destructiveHint defaults to true when omitted for a non-read-only tool. Clients that honor the conservative default can therefore treat routine additive operations as potentially destructive and require additional confirmation.
This is observable with ChatGPT using the official github-mcp-server over Streamable HTTP / Secure MCP Tunnel: read tools execute automatically when the app is configured with elevated / "Allow all actions" permissions, while routine write tools such as creating a branch or opening a pull request still trigger confirmation.
On desktop, the user can approve for the conversation. On mobile, the same workflow can require repeated per-call approvals.
Examples in the current server
create_branch currently advertises:
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_CREATE_BRANCH_USER_TITLE", "Create branch"),
ReadOnlyHint: false,
},
create_pull_request currently advertises:
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_CREATE_PULL_REQUEST_USER_TITLE", "Open new pull request"),
ReadOnlyHint: false,
},
Both operations are additive and appear to be good candidates for an explicit:
DestructiveHint: jsonschema.Ptr(false),
There is already precedent in the codebase: create_pull_request_review explicitly sets DestructiveHint: false, while genuinely destructive tools such as delete_file explicitly set DestructiveHint: true.
Expected behavior
Clearly additive write tools should explicitly advertise DestructiveHint: false instead of inheriting the MCP default of true.
It may also be worth auditing other write tools and explicitly classifying them rather than relying on the default. Tools whose behavior depends on the requested method or which can overwrite/delete existing state should remain conservative.
Why this matters
This does not change security enforcement; MCP annotations are hints. But clients use those hints to drive confirmation UX.
Missing destructiveHint: false makes safe additive operations indistinguishable from potentially destructive writes to conservative clients, which creates significant approval friction in agentic workflows.
Environment
github-mcp-serverv1.12.1- Streamable HTTP transport
- ChatGPT custom MCP app over OpenAI Secure MCP Tunnel
- App permission set to elevated / Allow all actions
- Read operations do not prompt; routine write operations do
Related issues
- #798 — fine-grained confirmation settings for write actions
- #2723 —
label_writedelete missingDestructiveHint: true
- Ngôn ngữ chính
- Go
- Star
- 33.1k
- Fork
- 5k
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 27
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/github-mcp-server
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
github/github-mcp-server#3235 ·
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
github/github-mcp-server#3042 · 2 bình luận ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/github-mcp-server#3032 · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
github/github-mcp-server#2803 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
github/github-mcp-server#2740 ·
Tất cả issue của github/github-mcp-server
Issue tương tự
-
kind/bug needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
matrixorigin/matrixone#29223 ·
-
needs-acceptance wg/data-plane-networking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vllm-project/semantic-router#4024 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
alexgorbatchev/dotfiles#107 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100