mcp-server-apache-airflow

The mcp-server-apache-airflow is an implementation of a Model Context Protocol (MCP) server that wraps the REST API of Apache Airflow. This project aims to enable MCP clients to interact with Airflow in a standardized manner. It utilizes the official Apache Airflow client library to ensure compatibility and maintainability.

GitHub Stars

86

User Rating

Not Rated

Favorites

0

Views

28

Forks

24

Issues

10

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Python 3.6以上
Apache Airflow 2.0以上

Installation

Installation

Prerequisites

Required software and versions:
Python: 3.6 or higher
Apache Airflow: 2.0 or higher

Installation Steps

1. Clone Repository

bash
git clone https://github.com/yangkyeongmo/mcp-server-apache-airflow.git
cd mcp-server-apache-airflow

2. Install Dependencies

bash
pip install -r requirements.txt

3. Start Server

bash
python app.py

Troubleshooting

Common Issues

Issue: Server won't start Solution: Check the versions of Python and Apache Airflow.

Configuration

Configuration

Basic Configuration

Server Setup

Edit config.json to configure the MCP server:
json
{
  "api_base_url": "http://localhost:8080/api/v1",
  "airflow_url": "http://localhost:8080"
}

Environment Variables

Set the following environment variables as needed:
bash
export AIRFLOW_URL="http://localhost:8080"
export MCP_PORT="8080"

Security Settings

Store API keys in environment variables or secure configuration files
Set appropriate file access permissions
Adjust logging levels

Examples

Examples

Basic Usage

Programmatic Usage

python
import requests

def call_mcp_tool(tool_name, params):
    response = requests.post(
        'http://localhost:8080/api/v1/call',
        json={
            'tool': tool_name,
            'parameters': params
        }
    )
    return response.json()

Usage example

result = call_mcp_tool('list_dags', {}) print(result)

Automation Script

bash
#!/bin/bash

Script to get the list of DAGs

curl -X GET http://localhost:8080/api/v1/dags

Use Cases

Automating data pipelines by managing DAGs programmatically.
Monitoring the status of specific DAGs and pausing or resuming them as needed.
Retrieving detailed information about DAGs for display on a dashboard.
Creating scripts to update multiple DAGs in bulk.