Apache Airflowのロゴ

Apache Airflow

コミュニティ
yangkyeongmo

A Model Context Protocol (MCP) server implementation for Apache Airflow, enabling seamless integration with MCP clients. This project provides a standardized way to interact with Apache Airflow…

公開者yangkyeongmo
リポジトリmcp-server-apache-airflow
言語Python
フォーク
49
スター
178
利用可能なツール
0
通信方式stdio
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Apache Airflowは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには178件のスターと49件のフォークがあります。

MseeP.ai Security Assessment Badge

mcp-server-apache-airflow

smithery badge PyPI - Downloads

A Model Context Protocol (MCP) server implementation for Apache Airflow, enabling seamless integration with MCP clients. This project provides a standardized way to interact with Apache Airflow through the Model Context Protocol.

About

This project implements a Model Context Protocol server that wraps Apache Airflow's REST API, allowing MCP clients to interact with Airflow in a standardized way. It uses the official Apache Airflow client library to ensure compatibility and maintainability.

Feature Implementation Status

FeatureAPI PathStatus
DAG Management
List DAGs/api/v1/dags✅
Get DAG Details/api/v1/dags/{dag_id}✅
Pause DAG/api/v1/dags/{dag_id}✅
Unpause DAG/api/v1/dags/{dag_id}✅
Update DAG/api/v1/dags/{dag_id}✅
Delete DAG/api/v1/dags/{dag_id}✅
Get DAG Source/api/v1/dagSources/{file_token}✅
Patch Multiple DAGs/api/v1/dags✅
Reparse DAG File/api/v1/dagSources/{file_token}/reparse✅
DAG Runs
List DAG Runs/api/v1/dags/{dag_id}/dagRuns✅
Create DAG Run/api/v1/dags/{dag_id}/dagRuns✅
Get DAG Run Details/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}✅
Update DAG Run/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}✅
Delete DAG Run/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}✅
Get DAG Runs Batch/api/v1/dags/~/dagRuns/list✅
Clear DAG Run/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/clear✅
Set DAG Run Note/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/setNote✅
Get Upstream Dataset Events/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents✅
Tasks
List DAG Tasks/api/v1/dags/{dag_id}/tasks✅
Get Task Details/api/v1/dags/{dag_id}/tasks/{task_id}✅
Get Task Instance/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}✅
List Task Instances/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances✅
Update Task Instance/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}✅
Get Task Instance Log/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{task_try_number}✅
Clear Task Instances/api/v1/dags/{dag_id}/clearTaskInstances✅
Set Task Instances State/api/v1/dags/{dag_id}/updateTaskInstancesState✅
List Task Instance Tries/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/tries✅
Variables
List Variables/api/v1/variables✅
Create Variable/api/v1/variables✅
Get Variable/api/v1/variables/{variable_key}✅
Update Variable/api/v1/variables/{variable_key}✅
Delete Variable/api/v1/variables/{variable_key}✅
Connections
List Connections/api/v1/connections✅
Create Connection/api/v1/connections✅
Get Connection/api/v1/connections/{connection_id}✅
Update Connection/api/v1/connections/{connection_id}✅
Delete Connection/api/v1/connections/{connection_id}✅
Test Connection/api/v1/connections/test✅
Pools
List Pools/api/v1/pools✅
Create Pool/api/v1/pools✅
Get Pool/api/v1/pools/{pool_name}✅
Update Pool/api/v1/pools/{pool_name}✅
Delete Pool/api/v1/pools/{pool_name}✅
XComs
List XComs/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries✅
Get XCom Entry/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}✅
Datasets
List Datasets/api/v1/datasets✅
Get Dataset/api/v1/datasets/{uri}✅
Get Dataset Events/api/v1/datasetEvents✅
Create Dataset Event/api/v1/datasetEvents✅
Get DAG Dataset Queued Event/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents/{uri}✅
Get DAG Dataset Queued Events/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents✅
Delete DAG Dataset Queued Event/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents/{uri}✅
Delete DAG Dataset Queued Events/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents✅
Get Dataset Queued Events/api/v1/datasets/{uri}/dagRuns/queued/datasetEvents✅
Delete Dataset Queued Events/api/v1/datasets/{uri}/dagRuns/queued/datasetEvents✅
Monitoring
Get Health/api/v1/health✅
DAG Stats
Get DAG Stats/api/v1/dags/statistics✅
Config
Get Config/api/v1/config✅
Plugins
Get Plugins/api/v1/plugins✅
Providers
List Providers/api/v1/providers✅
Event Logs
List Event Logs/api/v1/eventLogs✅
Get Event Log/api/v1/eventLogs/{event_log_id}✅
System
Get Import Errors/api/v1/importErrors✅
Get Import Error Details/api/v1/importErrors/{import_error_id}✅
Get Health Status/api/v1/health✅
Get Version/api/v1/version✅

Setup

Dependencies

This project depends on the official Apache Airflow client library (apache-airflow-client). It will be automatically installed when you install this package.

Environment Variables

Set the following environment variables:

AIRFLOW_HOST=<your-airflow-host>        # Optional, defaults to http://localhost:8080
AIRFLOW_API_VERSION=v1                  # Optional, defaults to v1
READ_ONLY=true                          # Optional, enables read-only mode (true/false, defaults to false)

Authentication

Choose one of the following authentication methods:

Basic Authentication (default):

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

JWT Token Authentication:

AIRFLOW_JWT_TOKEN=<your-jwt-token>

To obtain a JWT token, you can use Airflow's authentication endpoint:

bash
ENDPOINT_URL="http://localhost:8080"  # Replace with your Airflow endpoint
curl -X 'POST' \
  "${ENDPOINT_URL}/auth/token" \
  -H 'Content-Type: application/json' \
  -d '{ "username": "<your-username>", "password": "<your-password>" }'

Note: If both JWT token and basic authentication credentials are provided, JWT token takes precedence.

Usage with Claude Desktop

Add to your claude_desktop_config.json:

Basic Authentication:

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"
      }
    }
  }
}

JWT Token Authentication:

json
{
  "mcpServers": {
    "mcp-server-apache-airflow": {
      "command": "uvx",
      "args": ["mcp-server-apache-airflow"],
      "env": {
        "AIRFLOW_HOST": "https://your-airflow-host",
        "AIRFLOW_JWT_TOKEN": "your-jwt-token"
      }
    }
  }
}

For read-only mode (recommended for safety):

Basic Authentication:

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",
        "READ_ONLY": "true"
      }
    }
  }
}

JWT Token Authentication:

json
{
  "mcpServers": {
    "mcp-server-apache-airflow": {
      "command": "uvx",
      "args": ["mcp-server-apache-airflow", "--read-only"],
      "env": {
        "AIRFLOW_HOST": "https://your-airflow-host",
        "AIRFLOW_JWT_TOKEN": "your-jwt-token"
      }
    }
  }
}

Alternative configuration using uv:

Basic Authentication:

json
{
  "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"
      }
    }
  }
}

JWT Token Authentication:

json
{
  "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_JWT_TOKEN": "your-jwt-token"
      }
    }
  }
}

Replace /path/to/mcp-server-apache-airflow with the actual path where you've cloned the repository.

Selecting the API groups

You can select the API groups you want to use by setting the --apis flag.

bash
uv run mcp-server-apache-airflow --apis dag --apis dagrun

The default is to use all APIs.

Allowed values are:

  • config
  • connections
  • dag
  • dagrun
  • dagstats
  • dataset
  • eventlog
  • importerror
  • monitoring
  • plugin
  • pool
  • provider
  • taskinstance
  • variable
  • xcom

Read-Only Mode

You can run the server in read-only mode by using the --read-only flag or by setting the READ_ONLY=true environment variable. This will only expose tools that perform read operations (GET requests) and exclude any tools that create, update, or delete resources.

Using the command-line flag:

bash
uv run mcp-server-apache-airflow --read-only

Using the environment variable:

bash
READ_ONLY=true uv run mcp-server-apache-airflow

In read-only mode, the server will only expose tools like:

  • Listing DAGs, DAG runs, tasks, variables, connections, etc.
  • Getting details of specific resources
  • Reading configurations and monitoring information
  • Testing connections (non-destructive)

Write operations like creating, updating, deleting DAGs, variables, connections, triggering DAG runs, etc. will not be available in read-only mode.

You can combine read-only mode with API group selection:

bash
uv run mcp-server-apache-airflow --read-only --apis dag --apis variable

Manual Execution

You can also run the server manually:

bash
make run

make run accepts following options:

Options:

  • --port: Port to listen on for SSE (default: 8000)
  • --transport: Transport type (stdio/sse/http, default: stdio)

Or, you could run the sse server directly, which accepts same parameters:

bash
make run-sse

Also, you could start service directly using uv like in the following command:

bash
uv run src --transport http --port 8080

Installing via Smithery

To install Apache Airflow MCP Server for Claude Desktop automatically via Smithery:

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

Development

Setting up Development Environment

  1. Clone the repository:
bash
git clone https://github.com/yangkyeongmo/mcp-server-apache-airflow.git
cd mcp-server-apache-airflow
  1. Install development dependencies:
bash
uv sync --dev
  1. Create a .env file for environment variables (optional for development):
bash
touch .env

Note: No environment variables are required for running tests. The AIRFLOW_HOST defaults to http://localhost:8080 for development and testing purposes.

Running Tests

The project uses pytest for testing with the following commands available:

bash
# Run all tests
make test

Code Quality

bash
# Run linting
make lint

# Run code formatting
make format

Continuous Integration

The project includes a GitHub Actions workflow (.github/workflows/test.yml) that automatically:

  • Runs tests on Python 3.10, 3.11, and 3.12
  • Executes linting checks using ruff
  • Runs on every push and pull request to main branch

The CI pipeline ensures code quality and compatibility across supported Python versions before any changes are merged.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

The package is deployed automatically to PyPI when project.version is updated in pyproject.toml. Follow semver for versioning.

Please include version update in the PR in order to apply the changes to core logic.

License

MIT License

インストール

TypingMind
前提条件:

Node.js 18+

{
  "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"
      }
    }
  }
}

Apache AirflowのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Apache Airflowに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Apache Airflowをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Apache AirflowのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "apache-airflow": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-apache-airflow"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてApache AirflowのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Apache AirflowのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Apache Airflowを使ってこのタスクを手伝ってもらえますか?
Apache Airflow
はい、読みました。
Apache Airflowで調べた結果をお伝えします。

よくある質問

Apache Airflow MCPサーバーは何に使いますか?

Apache Airflowは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでApache Airflow MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでApache Airflowを利用できます。

TypingMindでApache Airflow MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Apache Airflowを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Apache Airflow MCPをTypingMindに接続するにはどうすればよいですか?

Apache AirflowはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでApache Airflow MCPのどのようなツールを利用できますか?

Apache AirflowはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Apache Airflow MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Apache Airflowで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇