What is A Model Context Protocol (MCP) server implementation for Apache Airflow.?
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.
Documentation
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.
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_USERNAME=<your-airflow-username>
AIRFLOW_PASSWORD=<your-airflow-password>
AIRFLOW_API_VERSION=v1 # Optional, defaults to v1
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.
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
Read-Only Mode
You can run the server in read-only mode by using the --read-only flag. This will only expose tools that perform read operations (GET requests) and exclude any tools that create, update, or delete resources.
uv run mcp-server-apache-airflow --read-only
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:
uv run mcp-server-apache-airflow --read-only --apis "dag,variable"
Manual Execution
You can also run the server manually:
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:
make run-sse
Installing via Smithery
To install Apache Airflow MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @yangkyeongmo/mcp-server-apache-airflow --client claude
Development# Setting up Development Environment
Clone the repository:
git clone https://github.com/yangkyeongmo/mcp-server-apache-airflow.git
cd mcp-server-apache-airflow
Install development dependencies:
uv sync --dev
Create a .env file for environment variables (optional for development):
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:
make test
Code Quality
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.