Skip to content

MCP destructive-hint annotations missing on k8s_delete/exec, helm_uninstall, sentry_resolve, clanker_run_command #26

@rafeegnash

Description

@rafeegnash

Problem

Several mutating MCP tools don't declare mcp.WithDestructiveHintAnnotation(true). Linear and Notion mutation tools do — so cautious MCP clients (Claude Desktop, Cursor) will prompt before Linear writes but silently execute kubectl delete pod or clanker run-command apply ....

Where

  • cmd/mcp_k8s.go:352k8s_delete_resource
  • cmd/mcp_k8s.go:379k8s_exec
  • cmd/mcp_k8s.go:434helm_install
  • cmd/mcp_k8s.go:523helm_uninstall
  • cmd/mcp_sentry.go:99sentry_resolve_issues
  • cmd/mcp.go:176clanker_run_command

Fix

Add mcp.WithDestructiveHintAnnotation(true) to every mutating tool. Add a unit test that fails when an unannotated tool name matches *_delete_*, *_uninstall*, *_exec*, *_resolve_*, or *_create_*:

func TestMutatingToolsHaveDestructiveHint(t *testing.T) {
    suspect := regexp.MustCompile(`_(delete|uninstall|exec|resolve|create|apply|run)`)
    for _, tool := range mcp.RegisteredTools() {
        if suspect.MatchString(tool.Name) {
            if !tool.Annotations.DestructiveHint {
                t.Errorf("%s should declare DestructiveHint", tool.Name)
            }
        }
    }
}

Acceptance criteria

  • All 6 listed tools have the annotation
  • The lint test passes against the current state
  • New mutating tools added later will trip the test if they forget the annotation

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority: highFix in next sprint

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions