airflow-dev-mcp

v0.4.0
airflow-dev-mcp Checked 1 day ago Published 4 months ago

MCP server for driving a dev/local Airflow cluster over its REST API — trigger DAGs, check run/task status, fetch logs, and diagnose import errors from…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

trigger_dag

Trigger a manual run of a DAG in the dev Airflow cluster. Args: dag_id: DAG identifier as it appears in Airflow. conf: Optional dict passed to the run (accessible as `dag_run.conf` inside tasks). logical_date: Optional ISO-8601 timestamp for the run's logical date. Defaults to now. note: Optional human-readable note attached to the run. Returns: DagRunSummary for the created run, including `dag_run_id` needed for status/log lookups. Note: if the DAG is paused, the run is created in `queued` state but will not execute until the D…

ParameterTypeDescription
dag_id *string
conf
logical_date
note

get_run_status

Get the state of a DAG run and (optionally) its task instances. Args: dag_id: DAG identifier. run_id: DAG run identifier returned by `trigger_dag` (e.g. `manual__2026-07-02T14:23:11+00:00`). include_tasks: When True (default), also fetch per-task states. Returns: RunStatus with `run` (a DagRunSummary) and, if requested, `tasks` (a list of TaskInstanceSummary: task_id, state, try_number, operator, start/end dates, duration, map_index). `tasks` is null when include_tasks is False.

ParameterTypeDescription
dag_id *string
run_id *string
include_tasksboolean

get_task_logs

Fetch logs for a single task instance attempt. Args: dag_id: DAG identifier. run_id: DAG run identifier. task_id: Task identifier within the DAG. try_number: Attempt number (1-indexed). Retried tasks have multiple attempts — call `get_run_status` to see the latest `try_number` per task. map_index: Mapped task index for dynamic task mapping. Use -1 for a normal task. tail_lines: Return only the last N lines (default 500). Pass null for the full log — beware, large tasks can produce many MB of output that will blow…

ParameterTypeDescription
dag_id *string
run_id *string
task_id *string
map_indexinteger
tail_lines
try_numberinteger

list_dags

List DAGs registered in the cluster with their paused / import-error flags. Use this to confirm a DAG parsed and registered. Important: a DAG whose file fails to import at module load does NOT appear here at all — call `get_import_errors` for that. Args: limit: Max DAGs to return (default 100). offset: Pagination offset. dag_id_pattern: Optional case-insensitive substring filter on dag_id. tags: Optional list of tags; only DAGs carrying one of them are returned. Returns: DagList with `dags` (dag_id, is_paused, is_active, has_import_e…

ParameterTypeDescription
dag_id_pattern
limitinteger
offsetinteger
tags

get_import_errors

List DAG import errors (parse failures) recorded by the scheduler. The primary debugging tool when a DAG you just wrote isn't showing up: a file that raises at import time is recorded here with its filename and full traceback. Args: limit: Max errors to return (default 100). offset: Pagination offset. Returns: ImportErrorList with `import_errors` (filename, stack_trace, timestamp, import_error_id) and `total_entries`.

ParameterTypeDescription
limitinteger
offsetinteger

set_dag_paused

Pause or unpause a DAG. Locally, newly added DAGs are paused by default, so `trigger_dag` will queue a run that never executes until the DAG is unpaused. Call this with paused=False to enable it. Args: dag_id: DAG identifier. paused: True to pause, False to unpause. Returns: DagInfo reflecting the updated state.

ParameterTypeDescription
dag_id *string
paused *boolean

list_dag_runs

List recent runs of a DAG — useful when you don't already hold a run_id. Args: dag_id: DAG identifier. Pass "~" to list runs across all DAGs. limit: Max runs to return (default 25). offset: Pagination offset. state: Optional filter, e.g. ["running"], ["failed"], ["success", "queued"]. Returns: DagRunList with `dag_runs` (each a DagRunSummary) and `total_entries`.

ParameterTypeDescription
dag_id *string
limitinteger
offsetinteger
state

clear_task_instances

Clear task instances so they re-run — the fast way to re-test a task after a fix. Defaults to a DRY RUN: it reports which task instances *would* be cleared without touching them. Pass dry_run=False to actually clear; with reset_dag_runs=True the affected run is put back into a running state so cleared tasks re-execute. Args: dag_id: DAG identifier. dag_run_id: Restrict to a single run (recommended). If omitted, the API's other filters apply across runs. task_ids: Restrict to specific task_ids. If omitted, all matching tasks are cleared.…

ParameterTypeDescription
dag_id *string
dag_run_id
dry_runboolean
only_failedboolean
reset_dag_runsboolean
task_ids

list_variables

List Airflow Variables (read-only) — handy when troubleshooting why a task can't find config it expects. Values flagged sensitive by Airflow's secrets masker come back masked. Read-only by design: this tool cannot create or modify variables. Args: limit: Max variables to return (default 100). offset: Pagination offset. Returns: VariableList with `variables` (key, value, description) and `total_entries`.

ParameterTypeDescription
limitinteger
offsetinteger

list_connections

List Airflow Connections (read-only) — passwords are never returned by the API. Read-only by design: use it to confirm a connection exists with the expected conn_type / host / schema when a task fails to connect. Args: limit: Max connections to return (default 100). offset: Pagination offset. Returns: ConnectionList with `connections` (connection_id, conn_type, host, db_schema, login, port, description) and `total_entries`.

ParameterTypeDescription
limitinteger
offsetinteger