MCP Server for Apache Airflow

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Allows interaction with Apache Airflow through a Model Context Protocol server that wraps Airflow's REST API. Supports DAG management (listing, viewing details, pausing/unpausing), DAG runs (listing, creating), task management (listing tasks and task instances), and system information (health status, version, import errors).

mcp-server-apache-airflow

Apache Airflow 向けのモデルコンテキストプロトコル (MCP) サーバー実装。MCP クライアントとのシームレスな統合を可能にします。このプロジェクトは、モデルコンテキストプロトコルを介して Apache Airflow と対話するための標準化された方法を提供します。

について

このプロジェクトは、Apache AirflowのREST APIをラップするモデルコンテキストプロトコル( MCP)サーバーを実装し、MCPクライアントが標準化された方法でAirflowとやり取りできるようにします。互換性と保守性を確保するために、公式のApache Airflowクライアントライブラリを使用しています。

機能実装状況

特徴APIパス状態
DAG管理
DAGの一覧/api/v1/dags
DAGの詳細を取得する/api/v1/dags/{dag_id}
DAGを一時停止/api/v1/dags/{dag_id}
DAG の一時停止を解除/api/v1/dags/{dag_id}
DAGを更新/api/v1/dags/{dag_id}
DAGを削除/api/v1/dags/{dag_id}
DAGソースを取得/api/v1/dagSources/{file_token}
複数のDAGをパッチする/api/v1/dags
DAG ファイルの再解析/api/v1/dagSources/{file_token}/reparse
DAGラン
DAG実行の一覧/api/v1/dags/{dag_id}/dagRuns
DAG 実行の作成/api/v1/dags/{dag_id}/dagRuns
DAG 実行の詳細を取得する/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}
DAG 実行の更新/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}
DAG実行を削除/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}
DAG実行バッチを取得/api/v1/dags/~/dagRuns/list
DAGランをクリア/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/clear
DAG実行ノートの設定/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/setNote
アップストリームデータセットイベントを取得する/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents
タスク
DAGタスクの一覧/api/v1/dags/{dag_id}/tasks
タスクの詳細を取得/api/v1/dags/{dag_id}/tasks/{task_id}
タスクインスタンスの取得/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}
タスクインスタンスの一覧表示/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances
タスクインスタンスの更新/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}
タスクインスタンスをクリア/api/v1/dags/{dag_id}/clearTaskInstances
タスクインスタンスの状態を設定する/api/v1/dags/{dag_id}/updateTaskInstancesState
変数
リスト変数/api/v1/variables
変数を作成/api/v1/variables
変数を取得/api/v1/variables/{variable_key}
変数の更新/api/v1/variables/{variable_key}
変数を削除/api/v1/variables/{variable_key}
接続
接続の一覧/api/v1/connections
接続を作成/api/v1/connections
接続を取得/api/v1/connections/{connection_id}
接続の更新/api/v1/connections/{connection_id}
接続を削除/api/v1/connections/{connection_id}
テスト接続/api/v1/connections/test
プール
リストプール/api/v1/pools
プールを作成/api/v1/pools
プールを取得/api/v1/pools/{pool_name}
アップデートプール/api/v1/pools/{pool_name}
プールを削除/api/v1/pools/{pool_name}
Xコム
XComsのリスト/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries
XComエントリーを入手/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}
データセット
データセットの一覧/api/v1/datasets
データセットを取得/api/v1/datasets/{uri}
データセットイベントを取得する/api/v1/datasetEvents
データセットイベントの作成/api/v1/datasetEvents
DAG データセットのキューイベントの取得/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents/{uri}
DAG データセットのキューイベントを取得する/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents
DAG データセットのキューイベントの削除/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents/{uri}
DAG データセットのキューイベントの削除/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents
データセットのキューイベントを取得する/api/v1/datasets/{uri}/dagRuns/queued/datasetEvents
データセットのキューイベントの削除/api/v1/datasets/{uri}/dagRuns/queued/datasetEvents
監視
健康になる/api/v1/health
DAG統計
DAG統計を取得/api/v1/dags/statistics
設定
設定を取得/api/v1/config
プラグイン
プラグインを入手/api/v1/plugins
プロバイダー
リストプロバイダー/api/v1/providers
イベントログ
イベントログの一覧表示/api/v1/eventLogs
イベントログを取得/api/v1/eventLogs/{event_log_id}
システム
インポートエラーを取得する/api/v1/importErrors
インポートエラーの詳細を取得する/api/v1/importErrors/{import_error_id}
健康状態を取得する/api/v1/health
バージョンを取得/api/v1/version

設定

依存関係

このプロジェクトは、Apache Airflow公式クライアントライブラリ( apache-airflow-client )に依存しています。このパッケージをインストールすると、自動的にインストールされます。

環境変数

次の環境変数を設定します。

AIRFLOW_HOST=<your-airflow-host> AIRFLOW_USERNAME=<your-airflow-username> AIRFLOW_PASSWORD=<your-airflow-password>

Claude Desktopでの使用

claude_desktop_config.jsonに追加します:

{ "mcpServers": { "mcp-server-apache-airflow": { "command": "uvx", "args": ["mcp-server-apache-airflow"], "env": { "AIRFLOW_HOST": "https://your-airflow-host", "AIRFLOW_USERNAME": "your-username", "AIRFLOW_PASSWORD": "your-password" } } } }

uvを使用した代替構成:

{ "mcpServers": { "mcp-server-apache-airflow": { "command": "uv", "args": [ "--directory", "/path/to/mcp-server-apache-airflow", "run", "mcp-server-apache-airflow" ], "env": { "AIRFLOW_HOST": "https://your-airflow-host", "AIRFLOW_USERNAME": "your-username", "AIRFLOW_PASSWORD": "your-password" } } } }

/path/to/mcp-server-apache-airflowリポジトリのクローンを作成した実際のパスに置き換えます。

APIグループの選択

--apisフラグを設定することで、使用する API グループを選択できます。

uv run mcp-server-apache-airflow --apis "dag,dagrun"

デフォルトではすべての API が使用されます。

許可される値は次のとおりです。

  • 設定
  • 接続
  • ダグ
  • ダグルン
  • ダグスタッツ
  • データセット
  • イベントログ
  • インポートエラー
  • 監視
  • プラグイン
  • プール
  • プロバイダー
  • タスクインスタンス
  • 変数
  • エックスコム

手動実行

サーバーを手動で実行することもできます。

make run

make run次のオプションを受け入れます:

オプション:

  • --port : SSEをリッスンするポート(デフォルト: 8000)
  • --transport : トランスポートタイプ (stdio/sse、デフォルト: stdio)

または、同じパラメータを受け入れる sse サーバーを直接実行することもできます。

make run-sse

Smithery経由でインストール

Smithery経由で Claude Desktop 用の Apache Airflow MCP サーバーを自動的にインストールするには:

npx -y @smithery/cli install @yangkyeongmo/mcp-server-apache-airflow --client claude

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

ライセンス

MITライセンス

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

MCP クライアントが Apache Airflow の REST API と対話するための標準化された方法を提供し、DAG 管理や Airflow システムの健全性の監視などの操作をサポートします。

  1. About
    1. Feature Implementation Status
      1. Setup
        1. Dependencies
        2. Environment Variables
        3. Usage with Claude Desktop
        4. Selecting the API groups
        5. Manual Execution
        6. Installing via Smithery
      2. Contributing
        1. License
          ID: e99b6vx9lw