Skip to content

[plan] Add progress notifications to long-running MCP tools (logs, audit, audit-diff) #30118

@github-actions

Description

@github-actions

Objective

Implement MCP progress notifications for long-running tools so AI clients (Claude, Copilot) display progress indicators during execution.

Context

From discussion #30108 (Go Fan module review): logs, audit, and audit-diff tools can execute for 30+ seconds. MCP clients display progress indicators when the server calls NotifyProgress. This is a high-impact, low-effort change.

Approach

For each of the three long-running tool handlers, add a progress notification pattern at key stages:

if token := req.Params.GetProgressToken(); token != nil {
    _ = req.Session.NotifyProgress(ctx, &mcp.ProgressNotificationParams{
        ProgressToken: token,
        Progress:      0, Total: 100,
        Message:       "Downloading workflow logs...",
    })
}

Emit multiple progress events at meaningful stages (e.g., 0%, 50%, 100%) so clients show a live indicator.

Files to Modify

  • pkg/cli/mcp_server.go — locate the logs, audit, and audit-diff tool handler functions and add NotifyProgress calls at logical checkpoints

Acceptance Criteria

  • logs tool emits at least 2 progress notifications (start + end)
  • audit tool emits at least 2 progress notifications
  • audit-diff tool emits at least 2 progress notifications
  • Progress tokens are checked for nil before use
  • Existing tests still pass (make test-unit)

Generated by Plan Command for issue #discussion #30108 · ● 308.5K ·

  • expires on May 6, 2026, 9:41 AM UTC

Metadata

Metadata

Labels

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