Airflow MCP
Enables users to interact with Apache Airflow orchestration platform through natural language to query pipeline statuses, troubleshoot DAG failures, trigger DAGs, and analyze configurations.
README
⚠️ REPOSITORY MOVED - NO LONGER MAINTAINED HERE
This repository has been transferred to new ownership and is no longer actively maintained in this location.
🔄 Migration Notice
This repository and all associated open-source packages have been moved to a new GitHub organization.
New Location: https://github.com/ponderedw
📍 What This Means
- ✅ Active development continues at the new location
- ✅ Latest updates and releases are published there
- ✅ Issues and pull requests should be submitted to the new repository
- ⚠️ This repository will no longer receive updates
🔗 Find the Updated Repository
Please visit https://github.com/ponderedw to:
- Access the latest version of this package
- Report issues or contribute
- View updated documentation
- Get support from the maintainers
Thank you for your understanding during this transition.
Airflow MCP
This project implements an MCP server for Apache Airflow, enabling users to interact with their orchestration platform using natural language.
With a few minutes of setup, you should be able to use Claude Desktop or any MCP-enabled LLM to ask questions like:
- "What DAGs do we have in our Airflow cluster?"
- "What is our latest failed DAG?"
And more!
About MCP and Airflow MCP
The Model Context Protocol (MCP) is an open standard creating secure connections between data sources and AI applications. This repository provides a custom MCP server for Apache Airflow that transforms how teams interact with their orchestration platform through natural language.
🚀 Features
- Query pipeline statuses through natural language
- Troubleshoot DAG failures efficiently
- Retrieve comprehensive DAG information
- Trigger DAGs based on their status
- Monitor execution results
- Analyze DAG components and configurations
🛠️ Getting Started
Prerequisites
If you already have an Airflow instance and want to use our prebuilt Docker image, you only need:
- Docker
- Access to your Apache Airflow instance
- LLM access (Claude, ChatGPT, or AWS Bedrock)
This repository also provides a local setup for Apache Airflow, which you can use for demo purposes.
You can also build the MCP server from source, detailed below.
Quick Start - Using the Prebuilt Docker Image
If you have an Airflow instance and want to use our prebuilt Docker image, simply follow these steps:
You'll need to configure Claude Desktop to connect to your Airflow instance. If you haven't configured Claude Desktop for use with MCP before, we recommend following the Claude Desktop documentation.
Here are the steps to configure Claude Desktop to connect to your Airflow instance, using our prebuilt Docker image:
- Open Claude Desktop
- Go to Settings → Developer tab
- Edit the MCP config with:
{
"mcpServers": {
"airflow_mcp": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "airflow_api_url", "-e", "airflow", "-e", "airflow", "hipposysai/airflow-mcp:latest"],
"env": {
"airflow_api_url": "http://host.docker.internal:8088/api/v1",
"airflow_username": "airflow",
"airflow_password": "airflow"
}
}
}
}
Running MCP Locally with Claude Desktop
-
Clone this repository:
git clone https://github.com/hipposys-ltd/airflow-mcp -
If you don't have a running Airflow environment, start one with:
just airflowThis will start an Airflow instance on port 8088, with username
airflowand passwordairflow.You can access Airflow at http://localhost:8088/ and see multiple DAGs configured:
.These DAGs have complex dependencies, some running on a schedule and some using Airflow's Dataset functionality.
-
Configure Claude Desktop:
You'll need to configure Claude Desktop to connect to your Airflow instance. If you haven't configured Claude Desktop for use with MCP before, we recommend following the Claude Desktop documentation.
Here are the steps to configure Claude Desktop to connect to your Airflow instance:
- Open Claude Desktop
- Go to Settings → Developer tab
- Edit the MCP config with:
{ "mcpServers": { "airflow_mcp": { "command": "docker", "args": ["run", "-i", "--rm", "-e", "airflow_api_url", "-e", "airflow", "-e", "airflow", "hipposysai/airflow-mcp:latest"], "env": { "airflow_api_url": "http://host.docker.internal:8088/api/v1", "airflow_username": "airflow", "airflow_password": "airflow" } } } } -
Test your setup by asking Claude: "What DAGs do we have in our Airflow cluster?"
Integrating with LangChain
-
Set up environment:
cp template.env .env -
Configure your LLM model in
.env:- For AWS Bedrock:
LLM_MODEL_ID=bedrock:... - For Anthropic:
LLM_MODEL_ID=anthropic:... - For OpenAI:
LLM_MODEL_ID=openai:...
- For AWS Bedrock:
-
Add your API credentials to
.env:- AWS credentials for Bedrock
ANTHROPIC_API_KEYfor ClaudeOPENAI_API_KEYfor ChatGPT
-
(Optional) Connect to your own Airflow:
airflow_api_url=your_airflow_api_url airflow_username=your_airflow_username airflow_password=your_airflow_password -
Start the project:
- With bundled Airflow:
just project - With existing Airflow:
just project_no_airflow
- With bundled Airflow:
-
Open web interfaces:
just open_web_tabs -
Try it out by asking "How many DAGs failed today?" in the Chat UI
📝 Example Usage
- "What DAGs do we have in our Airflow cluster?"
- "Identify all DAGs with failed status in their most recent execution and trigger a new run for each one"
- "What operators are used by the transform_forecast_attendance DAG?"
- "Has the transform_forecast_attendance DAG ever completed successfully?"
Running MCP with LangChain
You can use from langchain_mcp_adapters.client import MultiServerMCPClient in order to add our Airflow MCP as one of your tools in your LangChain app.
Option 1: Separate Container (SSE Transport)
If you run our Airflow MCP as a separate container, use SSE transport:
mcp_host = os.environ.get('mcp_host', 'mcp_sse_server:8000')
mcps = {
"AirflowMCP": {
"url": f"http://{mcp_host}/sse",
"transport": "sse",
"headers": {"Authorization": f"""Bearer {
os.environ.get('MCP_TOKEN')}"""}
}
}
Option 2: Embedded Server (STDIO Transport)
If you want to run our MCP server as part of the LangChain code, without any outside code, use STDIO and make sure you install our library first (airflow-mcp-hipposys = "0.1.0a11"):
mcps = {
"AirflowMCP":
{
'command': "python",
'args': ["-m", "airflow_mcp_hipposys.mcp_airflow"],
"transport": "stdio",
'env': {k: v for k, v in {
'AIRFLOW_ASSISTENT_AI_CONN': os.getenv(
'AIRFLOW_ASSISTENT_AI_CONN'),
'airflow_api_url': os.getenv('airflow_api_url'),
'airflow_username': os.getenv('airflow_username'),
'airflow_password': os.getenv('airflow_password'),
'AIRFLOW_INSIGHTS_MODE':
os.getenv('AIRFLOW_INSIGHTS_MODE'),
'POST_MODE': os.getenv('POST_MODE'),
'TRANSPORT_TYPE': 'stdio',
'_AIRFLOW_WWW_USER_USERNAME':
os.getenv('_AIRFLOW_WWW_USER_USERNAME'),
'_AIRFLOW_WWW_USER_PASSWORD':
os.getenv('_AIRFLOW_WWW_USER_PASSWORD')
}.items() if v is not None}
}
}
Using the Tools
Then in both cases, pass it to the tools:
client = MultiServerMCPClient(mcps)
tools = await client.get_tools()
🤝 Contributing
We enthusiastically invite the community to contribute to this open-source initiative! Whether you're interested in:
- Adding new features
- Improving documentation
- Enhancing compatibility with different LLM providers
- Reporting bugs
- Suggesting improvements
Please feel free to submit pull requests or open issues on our GitHub repository.
🔗 Links
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。