mcp-server-cloudflare icon indicating copy to clipboard operation
mcp-server-cloudflare copied to clipboard

Enhancement: Add build comparison and diff tools for Workers Builds

Open Scarmonit opened this issue 3 months ago • 0 comments

Problem

When managing Workers Builds, developers often need to:

  1. Compare builds - Understand what changed between successful and failed builds
  2. Track configuration changes - See how build/deploy commands evolved over time
  3. Debug regressions - Identify when specific issues were introduced
  4. Audit deployments - Track changes for compliance and debugging

Currently, the MCP server provides tools to view individual builds, but lacks comparison capabilities.

Proposed Enhancement

Add Build Comparison Tool

Tool Name: workers_builds_compare_builds

Functionality:

  • Compare two builds by UUID
  • Show differences in:
    • Build commands
    • Deploy commands
    • Build duration
    • Success/failure status
    • Error messages (if applicable)
    • Timestamps

Example Usage:

Compare build abc-123 with build def-456

Output Format:

{
  "build_a": { "uuid": "abc-123", "status": "success", ... },
  "build_b": { "uuid": "def-456", "status": "failure", ... },
  "differences": {
    "status_changed": true,
    "command_changed": false,
    "duration_delta": "+15s",
    "new_errors": ["Error message here"]
  }
}

Add Build History Summary Tool

Tool Name: workers_builds_get_summary

Functionality:

  • Get aggregate statistics for a worker
  • Success/failure rates
  • Average build duration
  • Common errors
  • Recent trends

Example Usage:

Show me a summary of builds for my-worker over the last 7 days

Enhanced Prompt Examples

With these new tools:

  • Compare my last successful build with the failed build
  • What changed between build abc-123 and def-456?
  • Show me build success rate for frontend-app this week
  • What are the most common build errors for my-worker?
  • When did build duration start increasing for api-worker?

Benefits

  • Faster debugging - Quickly identify what changed between builds
  • Better insights - Understand build patterns and trends
  • Proactive monitoring - Catch regressions early
  • Compliance - Better audit trail for deployments

Implementation Notes

  • Should work with existing workers_builds_set_active_worker pattern
  • Consider pagination for large datasets
  • Cache comparison results for performance
  • Include error log diffs if logs differ significantly

Related Functionality

  • Complements existing workers_builds_get_build tool
  • Works alongside workers_builds_list_builds for context
  • Could integrate with monitoring/alerting tools

Priority

Medium-High - This would significantly enhance debugging capabilities and provide valuable insights for CI/CD workflows.

This enhancement makes the MCP server more powerful for understanding build history and troubleshooting issues.

Scarmonit avatar Nov 01 '25 10:11 Scarmonit