The MCP Server for Apache Airflow provides a standardized interface that allows MCP clients to interact with Apache Airflow through the Model Context Protocol. With this server, you can:
DAG Management: List, retrieve, pause, unpause, update, delete DAGs; manage DAG sources and reparse DAG files
DAG Runs: List, create, retrieve, update, delete, clear, and set notes for DAG runs; manage upstream dataset events
Tasks: Manage tasks and task instances including listing, retrieving, updating, clearing, and setting states
Resources: Create, list, update, and delete variables, connections, and pools
Data Exchange: List and retrieve XComs; manage datasets and dataset events
Monitoring: Check health status, retrieve DAG statistics, view configuration and system information
System Info: Access plugins, providers, event logs, import errors, and version information
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
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.
Related MCP server: MCP Server for Apache Airflow
Feature Implementation Status
Feature | API Path | Status |
DAG Management | ||
List DAGs |
| ✅ |
Get DAG Details |
| ✅ |
Pause DAG |
| ✅ |
Unpause DAG |
| ✅ |
Update DAG |
| ✅ |
Delete DAG |
| ✅ |
Get DAG Source |
| ✅ |
Patch Multiple DAGs |
| ✅ |
Reparse DAG File |
| ✅ |
DAG Runs | ||
List DAG Runs |
| ✅ |
Create DAG Run |
| ✅ |
Get DAG Run Details |
| ✅ |
Update DAG Run |
| ✅ |
Delete DAG Run |
| ✅ |
Get DAG Runs Batch |
| ✅ |
Clear DAG Run |
| ✅ |
Set DAG Run Note |
| ✅ |
Get Upstream Dataset Events |
| ✅ |
Tasks | ||
List DAG Tasks |
| ✅ |
Get Task Details |
| ✅ |
Get Task Instance |
| ✅ |
List Task Instances |
| ✅ |
Update Task Instance |
| ✅ |
Get Task Instance Log |
| ✅ |
Clear Task Instances |
| ✅ |
Set Task Instances State |
| ✅ |
List Task Instance Tries |
| ✅ |
Variables | ||
List Variables |
| ✅ |
Create Variable |
| ✅ |
Get Variable |
| ✅ |
Update Variable |
| ✅ |
Delete Variable |
| ✅ |
Connections | ||
List Connections |
| ✅ |
Create Connection |
| ✅ |
Get Connection |
| ✅ |
Update Connection |
| ✅ |
Delete Connection |
| ✅ |
Test Connection |
| ✅ |
Pools | ||
List Pools |
| ✅ |
Create Pool |
| ✅ |
Get Pool |
| ✅ |
Update Pool |
| ✅ |
Delete Pool |
| ✅ |
XComs | ||
List XComs |
| ✅ |
Get XCom Entry |
| ✅ |
Datasets | ||
List Datasets |
| ✅ |
Get Dataset |
| ✅ |
Get Dataset Events |
| ✅ |
Create Dataset Event |
| ✅ |
Get DAG Dataset Queued Event |
| ✅ |
Get DAG Dataset Queued Events |
| ✅ |
Delete DAG Dataset Queued Event |
| ✅ |
Delete DAG Dataset Queued Events |
| ✅ |
Get Dataset Queued Events |
| ✅ |
Delete Dataset Queued Events |
| ✅ |
Monitoring | ||
Get Health |
| ✅ |
DAG Stats | ||
Get DAG Stats |
| ✅ |
Config | ||
Get Config |
| ✅ |
Plugins | ||
Get Plugins |
| ✅ |
Providers | ||
List Providers |
| ✅ |
Event Logs | ||
List Event Logs |
| ✅ |
Get Event Log |
| ✅ |
System | ||
Get Import Errors |
| ✅ |
Get Import Error Details |
| ✅ |
Get Health Status |
| ✅ |
Get 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:
Authentication
Choose one of the following authentication methods:
Basic Authentication (default):
JWT Token Authentication:
To obtain a JWT token, you can use Airflow's authentication endpoint:
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:
JWT Token Authentication:
For read-only mode (recommended for safety):
Basic Authentication:
JWT Token Authentication:
Alternative configuration using uv:
Basic Authentication:
JWT Token Authentication:
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.
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:
Using the environment variable:
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:
Manual Execution
You can also run the server manually:
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:
Also, you could start service directly using uv like in the following command:
Installing via Smithery
To install Apache Airflow MCP Server for Claude Desktop automatically via Smithery:
Development
Setting up Development Environment
Clone the repository:
Install development dependencies:
Create a
.envfile for environment variables (optional for development):
Note: No environment variables are required for running tests. The
AIRFLOW_HOSTdefaults tohttp://localhost:8080for development and testing purposes.
Running Tests
The project uses pytest for testing with the following commands available:
Code Quality
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
mainbranch
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.