Skip to content

feat(mcp): add operational mutation tools and unit tests for dagster_plus #3549

@cbini

Description

@cbini

Summary

Follow-up from #3547. Two areas identified during MCP server review that should be addressed separately.

1. Operational mutations

The server can observe everything but can only act on launches and re-executions. These mutations exist in the Dagster GraphQL schema and would fill critical ops gaps:

High priority:

  • terminate_runs — cancel stuck/unwanted runs (terminateRuns mutation with SAFE_TERMINATE / MARK_AS_CANCELED_IMMEDIATELY policies)
  • cancel_backfill / resume_backfillcancelPartitionBackfill / resumePartitionBackfill mutations (complement existing list_backfills/get_backfill which already return hasCancelPermission/hasResumePermission)
  • start_schedule / stop_schedulestartSchedule / stopRunningSchedule mutations
  • start_sensor / stop_sensorstartSensor / stopSensor mutations
  • reload_code_locationreloadRepositoryLocation mutation

Medium priority:

  • list_schedules / list_sensors — discovery tools (no way to find schedule/sensor names today without knowing them)
  • free_concurrency_slots — unblock stuck pipelines
  • set_sensor_cursor — reset sensor tracking position

All mutation tools should use the existing confirm flag pattern (confirm=False for preview, confirm=True for execute).

2. Unit tests

The _handle_gql_errors decorator, _build_execution_params, RunSpec validation, and client-side filtering logic (e.g., get_run_logs with filter_types) are testable without hitting the API. Mock gql() and verify input/output transforms.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions