# mcp-server-apache-airflow

> MCP Server

This repository provides a Model Context Protocol (MCP) server implementation for Apache Airflow, enabling standardized interaction with Airflow through the MCP. It wraps Airflow's REST API, allowing MCP clients to

## Overview

- **Category:** System Tools
- **Language:** Python
- **Stars:** 174
- **Forks:** 3
- **Owner:** yangkyeongmo
- **GitHub:** https://github.com/yangkyeongmo/mcp-server-apache-airflow
- **Homepage:** https://pypi.org/project/mcp-server-apache-airflow/
- **Created:** 2025-02-13T04:09:06+00:00
- **Updated:** 2025-03-27T23:37:36+00:00
- **Source:** https://model-context-protocol.com/servers/mcp-server-airflow-model-context-protocol

## Setup

## 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>
AIRFLOW_USERNAME=<your-airflow-username>
AIRFLOW_PASSWORD=<your-airflow-password>
```

### Usage with Claude Desktop

Add to your `claude_desktop_config.json`:

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

Alternative configuration using `uv`:

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

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,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

### 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, default: stdio)

Or, you could run the sse server directly, which accepts same parameters:
```bash
make run-sse
```

### Installing via Smithery

To install Apache Airflow MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@yangkyeongmo/mcp-server-apache-airflow):

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

## Tools

## Available Tools

1.  DAG Management (Provides functionalities to manage DAGs, including listing, getting details, pausing, unpausing, updating, deleting, getting source, patching, and reparsing).
2.  DAG Runs (Provides functionalities to manage DAG Runs, including listing, creating, getting details, updating, deleting, getting batch, clearing, setting notes, and getting upstream dataset events).
3.  Tasks (Provides functionalities to manage DAG Tasks, including listing, getting details, getting task instance, listing task instances, updating task instance, clearing task instances, and setting task instances state).
4.  Variables (Provides functionalities to manage Airflow Variables, including listing, creating, getting, updating, and deleting).
5.  Connections (Provides functionalities to manage Airflow Connections, including listing, creating, getting, updating, deleting, and testing).
6.  Pools (Provides functionalities to manage Airflow Pools, including listing, creating, getting, updating, and deleting).
7.  XComs (Provides functionalities to manage XComs, including listing and getting XCom entries).
8.  Datasets (Provides functionalities to manage Datasets, including listing, getting, getting dataset events, creating dataset event, and managing queued events).
9.  Monitoring (Provides functionalities for monitoring, including getting health).
10. DAG Stats (Provides functionalities to get DAG statistics).
11. Config (Provides functionalities to get Airflow configuration).
12. Plugins (Provides functionalities to get Airflow plugins).
13. Providers (Provides functionalities to list Airflow providers).
14. Event Logs (Provides functionalities to manage Event Logs, including listing and getting).
15. System (Provides functionalities to get import errors, import error details, health status, and version).
