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_backfill — cancelPartitionBackfill / resumePartitionBackfill mutations (complement existing list_backfills/get_backfill which already return hasCancelPermission/hasResumePermission)
start_schedule / stop_schedule — startSchedule / stopRunningSchedule mutations
start_sensor / stop_sensor — startSensor / stopSensor mutations
reload_code_location — reloadRepositoryLocation 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
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 (terminateRunsmutation withSAFE_TERMINATE/MARK_AS_CANCELED_IMMEDIATELYpolicies)cancel_backfill/resume_backfill—cancelPartitionBackfill/resumePartitionBackfillmutations (complement existinglist_backfills/get_backfillwhich already returnhasCancelPermission/hasResumePermission)start_schedule/stop_schedule—startSchedule/stopRunningSchedulemutationsstart_sensor/stop_sensor—startSensor/stopSensormutationsreload_code_location—reloadRepositoryLocationmutationMedium priority:
list_schedules/list_sensors— discovery tools (no way to find schedule/sensor names today without knowing them)free_concurrency_slots— unblock stuck pipelinesset_sensor_cursor— reset sensor tracking positionAll mutation tools should use the existing confirm flag pattern (
confirm=Falsefor preview,confirm=Truefor execute).2. Unit tests
The
_handle_gql_errorsdecorator,_build_execution_params,RunSpecvalidation, and client-side filtering logic (e.g.,get_run_logswithfilter_types) are testable without hitting the API. Mockgql()and verify input/output transforms.References