mcp-server-apache-airflow

mcp-server-apache-airflow avatar

by yangkyeongmo

Community Servers

pypi.org/project/mcp-server-apache-airflow/

What is mcp-server-apache-airflow

mcp-server-apache-airflow

smithery badge

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.

Feature Implementation Status

Feature API Path Status
DAG Management
List DAGs /api/v1/dags โœ…
Get DAG Details /api/v1/dags/{dag_id} โœ…
Pause DAG /api/v1/dags/{dag_id} โœ…
Unpause DAG /api/v1/dags/{dag_id} โœ…
Update DAG /api/v1/dags/{dag_id} โœ…
Delete DAG /api/v1/dags/{dag_id} โœ…
Get DAG Source /api/v1/dagSources/{file_token} โœ…
Patch Multiple DAGs /api/v1/dags โœ…
Reparse DAG File /api/v1/dagSources/{file_token}/reparse โœ…
DAG Runs
List DAG Runs /api/v1/dags/{dag_id}/dagRuns โœ…
Create DAG Run /api/v1/dags/{dag_id}/dagRuns โœ…
Get DAG Run Details /api/v1/dags/{dag_id}/dagRuns/{dag_run_id} โœ…
Update DAG Run /api/v1/dags/{dag_id}/dagRuns/{dag_run_id} โœ…
Delete DAG Run /api/v1/dags/{dag_id}/dagRuns/{dag_run_id} โœ…
Get DAG Runs Batch /api/v1/dags/~/dagRuns/list โœ…
Clear DAG Run /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/clear โœ…
Set DAG Run Note /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/setNote โœ…
Get Upstream Dataset Events /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents โœ…
Tasks
List DAG Tasks /api/v1/dags/{dag_id}/tasks โœ…
Get Task Details /api/v1/dags/{dag_id}/tasks/{task_id} โœ…
Get Task Instance /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id} โœ…
List Task Instances /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances โœ…
Update Task Instance /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id} โœ…
Clear Task Instances /api/v1/dags/{dag_id}/clearTaskInstances โœ…
Set Task Instances State /api/v1/dags/{dag_id}/updateTaskInstancesState โœ…
Variables
List Variables /api/v1/variables โœ…
Create Variable /api/v1/variables โœ…
Get Variable /api/v1/variables/{variable_key} โœ…
Update Variable /api/v1/variables/{variable_key} โœ…
Delete Variable /api/v1/variables/{variable_key} โœ…
Connections
List Connections /api/v1/connections โœ…
Create Connection /api/v1/connections โœ…
Get Connection /api/v1/connections/{connection_id} โœ…
Update Connection /api/v1/connections/{connection_id} โœ…
Delete Connection /api/v1/connections/{connection_id} โœ…
Test Connection /api/v1/connections/test โœ…
Pools
List Pools /api/v1/pools โœ…
Create Pool /api/v1/pools โœ…
Get Pool /api/v1/pools/{pool_name} โœ…
Update Pool /api/v1/pools/{pool_name} โœ…
Delete Pool /api/v1/pools/{pool_name} โœ…
XComs
List XComs /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries โœ…
Get XCom Entry /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key} โœ…
Datasets
List Datasets /api/v1/datasets โœ…
Get Dataset /api/v1/datasets/{uri} โœ…
Get Dataset Events /api/v1/datasetEvents โœ…
Create Dataset Event /api/v1/datasetEvents โœ…
Get DAG Dataset Queued Event /api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents/{uri} โœ…
Get DAG Dataset Queued Events /api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents โœ…
Delete DAG Dataset Queued Event /api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents/{uri} โœ…
Delete DAG Dataset Queued Events /api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents โœ…
Get Dataset Queued Events /api/v1/datasets/{uri}/dagRuns/queued/datasetEvents โœ…
Delete Dataset Queued Events /api/v1/datasets/{uri}/dagRuns/queued/datasetEvents โœ…
Monitoring
Get Health /api/v1/health โœ…
DAG Stats
Get DAG Stats /api/v1/dags/statistics โœ…
Config
Get Config /api/v1/config โœ…
Plugins
Get Plugins /api/v1/plugins โœ…
Providers
List Providers /api/v1/providers โœ…
Event Logs
List Event Logs /api/v1/eventLogs โœ…
Get Event Log /api/v1/eventLogs/{event_log_id} โœ…
System
Get Import Errors /api/v1/importErrors โœ…
Get Import Error Details /api/v1/importErrors/{import_error_id} โœ…
Get Health Status /api/v1/health โœ…
Get Version /api/v1/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:

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:

{
  "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:

{
  "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.

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:

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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

Leave a Comment

Comments section will be available soon. Stay tuned!

Frequently Asked Questions

What is MCP?

MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.

What are MCP Servers?

MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.

How do MCP Servers work?

MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.

Are MCP Servers secure?

Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.