Apache Airflow (Bearer Token) MCP server

Integrates with Apache Airflow through Bearer token authentication to provide DAG operations, task instance management, connection handling, variable management, dataset operations, and monitoring functions with optional read-only mode and automatic UI link generation.
Back to servers
Setup instructions
Provider
Nikhil Ganage
Release date
Jul 16, 2025
Language
Go
Stats
1 star

This MCP server allows you to interact with Apache Airflow through the Model Context Protocol, featuring Bearer token authentication support for Astronomer Cloud and other token-based Airflow deployments.

Installation

You can install the MCP server using pip or uvx:

# Using pip
pip install mcp-server-airflow-token

# Using uvx (recommended)
uvx mcp-server-airflow-token

Configuration

Environment Variables

Set the following environment variables to connect to your Airflow instance:

Token Authentication (Recommended)

AIRFLOW_HOST=<your-airflow-host>        # Optional, defaults to http://localhost:8080
AIRFLOW_TOKEN=<your-airflow-api-token>  # Your Airflow API token
AIRFLOW_API_VERSION=v1                  # Optional, defaults to v1

Basic Authentication (Alternative)

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

Note: If AIRFLOW_TOKEN is provided, it will be used for authentication. Otherwise, the server will fall back to basic authentication using username and password.

Usage

With Claude Desktop

First, clone the repository:

git clone https://github.com/nikhil-ganage/mcp-server-airflow-token

Add to your claude_desktop_config.json:

With Token Authentication (Recommended)

{
  "mcpServers": {
    "apache-airflow": {
      "type": "stdio",
      "command": "uv",
      "args": [
        "--directory",
        "path-to-repo/mcp-server-airflow-token",
        "run",
        "mcp-server-airflow-token"
      ],
      "env": {
        "AIRFLOW_HOST": "https://astro_id.astronomer.run/id",
        "AIRFLOW_TOKEN": "TOKEN"
      }
    }
  }
}

Replace path-to-repo with the actual path where you've cloned the repository.

Astronomer Cloud Configuration Example

For Astronomer Cloud deployments:

{
  "mcpServers": {
    "mcp-server-airflow-token": {
      "command": "uvx",
      "args": ["mcp-server-airflow-token"],
      "env": {
        "AIRFLOW_HOST": "https://your-astronomer-domain.astronomer.run/your-deployment-id",
        "AIRFLOW_TOKEN": "your-astronomer-api-token"
      }
    }
  }
}

Note: The deployment ID is part of your Astronomer Cloud URL path.

Read-Only Mode

You can run the server in read-only mode for safety:

uv run mcp-server-airflow-token --read-only

In read-only mode, the server will only expose tools for reading data, not modifying it.

Selecting Specific API Groups

You can select which API groups to expose:

uv run mcp-server-airflow-token --apis "dag,dagrun"

Available API groups:

  • config
  • connections
  • dag
  • dagrun
  • dagstats
  • dataset
  • eventlog
  • importerror
  • monitoring
  • plugin
  • pool
  • provider
  • taskinstance
  • variable
  • xcom

Manual Execution

Run the server manually:

# Using stdio transport (default)
uv run mcp-server-airflow-token

# Using SSE transport on a specific port
uv run mcp-server-airflow-token --transport sse --port 8000

Combining Options

You can combine multiple options:

# Read-only mode with specific API groups
uv run mcp-server-airflow-token --read-only --apis "dag,variable"

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "apache-airflow" '{"type":"stdio","command":"uv","args":["run","mcp-server-airflow-token"],"env":{"AIRFLOW_HOST":"https://your-airflow-host","AIRFLOW_TOKEN":"your-api-token"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "apache-airflow": {
            "type": "stdio",
            "command": "uv",
            "args": [
                "run",
                "mcp-server-airflow-token"
            ],
            "env": {
                "AIRFLOW_HOST": "https://your-airflow-host",
                "AIRFLOW_TOKEN": "your-api-token"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "apache-airflow": {
            "type": "stdio",
            "command": "uv",
            "args": [
                "run",
                "mcp-server-airflow-token"
            ],
            "env": {
                "AIRFLOW_HOST": "https://your-airflow-host",
                "AIRFLOW_TOKEN": "your-api-token"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later