MCP Server Airflow Token
Provides comprehensive access to Apache Airflow's REST API, enabling management of DAGs, DAG runs, tasks, variables, connections, pools, XComs, datasets, and monitoring features. Supports both token-based and basic authentication, with special compatibility for Astronomer Cloud deployments.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Server Airflow Token list all DAGs in my production deployment"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-server-airflow-token
A Model Context Protocol (MCP) server for Apache Airflow with Bearer token authentication support, enabling seamless integration with Astronomer Cloud and standalone Airflow instances.
Based on mcp-server-apache-airflow by Gyeongmo Nathan Yang
This fork enhances the original MCP server with Bearer token authentication support, making it compatible with Astronomer Cloud and other token-based Airflow deployments.
Key Enhancements
✅ Bearer Token Authentication - Primary authentication method for modern Airflow deployments
✅ Astronomer Cloud Compatible - Works seamlessly with Astronomer's managed Airflow
✅ Backward Compatible - Still supports username/password authentication
✅ Enhanced URL Handling - Correctly handles deployment paths like
/deployment-id
Related MCP server: Messages MCP Server
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 |
| ✅ |
Get DAG Details |
| ✅ |
Pause DAG |
| ✅ |
Unpause DAG |
| ✅ |
Update DAG |
| ✅ |
Delete DAG |
| ✅ |
Get DAG Source |
| ✅ |
Patch Multiple DAGs |
| ✅ |
Reparse DAG File |
| ✅ |
DAG Runs | ||
List DAG Runs |
| ✅ |
Create DAG Run |
| ✅ |
Get DAG Run Details |
| ✅ |
Update DAG Run |
| ✅ |
Delete DAG Run |
| ✅ |
Get DAG Runs Batch |
| ✅ |
Clear DAG Run |
| ✅ |
Set DAG Run Note |
| ✅ |
Get Upstream Dataset Events |
| ✅ |
Tasks | ||
List DAG Tasks |
| ✅ |
Get Task Details |
| ✅ |
Get Task Instance |
| ✅ |
List Task Instances |
| ✅ |
Update Task Instance |
| ✅ |
Clear Task Instances |
| ✅ |
Set Task Instances State |
| ✅ |
Variables | ||
List Variables |
| ✅ |
Create Variable |
| ✅ |
Get Variable |
| ✅ |
Update Variable |
| ✅ |
Delete Variable |
| ✅ |
Connections | ||
List Connections |
| ✅ |
Create Connection |
| ✅ |
Get Connection |
| ✅ |
Update Connection |
| ✅ |
Delete Connection |
| ✅ |
Test Connection |
| ✅ |
Pools | ||
List Pools |
| ✅ |
Create Pool |
| ✅ |
Get Pool |
| ✅ |
Update Pool |
| ✅ |
Delete Pool |
| ✅ |
XComs | ||
List XComs |
| ✅ |
Get XCom Entry |
| ✅ |
Datasets | ||
List Datasets |
| ✅ |
Get Dataset |
| ✅ |
Get Dataset Events |
| ✅ |
Create Dataset Event |
| ✅ |
Get DAG Dataset Queued Event |
| ✅ |
Get DAG Dataset Queued Events |
| ✅ |
Delete DAG Dataset Queued Event |
| ✅ |
Delete DAG Dataset Queued Events |
| ✅ |
Get Dataset Queued Events |
| ✅ |
Delete Dataset Queued Events |
| ✅ |
Monitoring | ||
Get Health |
| ✅ |
DAG Stats | ||
Get DAG Stats |
| ✅ |
Config | ||
Get Config |
| ✅ |
Plugins | ||
Get Plugins |
| ✅ |
Providers | ||
List Providers |
| ✅ |
Event Logs | ||
List Event Logs |
| ✅ |
Get Event Log |
| ✅ |
System | ||
Get Import Errors |
| ✅ |
Get Import Error Details |
| ✅ |
Get Health Status |
| ✅ |
Get 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:
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 v1Basic 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 v1Note: 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-tokenAdd 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"
}
}
}
}With Basic Authentication
{
"mcpServers": {
"mcp-server-airflow-token": {
"command": "uvx",
"args": ["mcp-server-airflow-token"],
"env": {
"AIRFLOW_HOST": "https://your-airflow-host",
"AIRFLOW_USERNAME": "your-username",
"AIRFLOW_PASSWORD": "your-password"
}
}
}
}For read-only mode (recommended for safety):
Read-only with Token Authentication
{
"mcpServers": {
"mcp-server-airflow-token": {
"command": "uvx",
"args": ["mcp-server-airflow-token", "--read-only"],
"env": {
"AIRFLOW_HOST": "https://your-airflow-host",
"AIRFLOW_TOKEN": "your-api-token"
}
}
}
}Read-only with Basic Authentication
{
"mcpServers": {
"mcp-server-airflow-token": {
"command": "uvx",
"args": ["mcp-server-airflow-token", "--read-only"],
"env": {
"AIRFLOW_HOST": "https://your-airflow-host",
"AIRFLOW_USERNAME": "your-username",
"AIRFLOW_PASSWORD": "your-password"
}
}
}
}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.
Selecting the API groups
You can select the API groups you want to use by setting the --apis flag.
uv run mcp-server-airflow-token --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-airflow-token --read-onlyIn 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-airflow-token --read-only --apis "dag,variable"Manual Execution
You can also run the server manually:
make runmake 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-sseInstallation
You can install the server using pip or uvx:
# Using pip
pip install mcp-server-airflow-token
# Using uvx (recommended)
uvx mcp-server-airflow-tokenDevelopment
Setting up Development Environment
Clone the repository:
git clone https://github.com/nikhil-ganage/mcp-server-airflow-token.git
cd mcp-server-airflow-tokenInstall development dependencies:
uv sync --devCreate a
.envfile for environment variables (optional for development):
touch .envNote: No environment variables are required for running tests. The
AIRFLOW_HOSTdefaults tohttp://localhost:8080for development and testing purposes.
Running Tests
The project uses pytest for testing with the following commands available:
# Run all tests
make testCode Quality
# Run linting
make lint
# Run code formatting
make formatContinuous 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
mainbranch
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.
License
Available Tools
66 toolsclear_dag_runD
Clear a DAG run
Inputs: dag_id (required), dag_run_id (required), dry_run.
clear_task_instancesC
Clear a set of task instances
Inputs: dag_id (required), task_ids, start_date, end_date, +8 more.
create_connectionD
Create a connection
Inputs: conn_id (required), conn_type (required), host, port, +4 more.
create_dataset_eventD
Create dataset event
Inputs: dataset_uri (required), extra.
create_variableD
Create a variable
Inputs: key (required), value (required), description.
delete_connectionC
Delete a connection by ID
Inputs: conn_id (required).
delete_dagC
Delete a DAG
Inputs: dag_id (required).
delete_dag_dataset_queued_eventC
Delete a queued Dataset event for a DAG
Inputs: dag_id (required), uri (required).
delete_dag_dataset_queued_eventsC
Delete queued Dataset events for a DAG
Inputs: dag_id (required), before.
delete_dag_runB
Delete a DAG run by DAG ID and DAG run ID
Inputs: dag_id (required), dag_run_id (required).
delete_dataset_queued_eventsC
Delete queued Dataset events for a Dataset
Inputs: uri (required), before.
delete_poolD
Delete a pool
Inputs: pool_name (required).
delete_variableC
Delete a variable by key
Inputs: key (required).
fetch_dagsC
Fetch all DAGs
Inputs: limit, offset, order_by, tags, +3 more.
get_configD
Get current configuration
Inputs: section.
get_connectionC
Get a connection by ID
Inputs: conn_id (required).
get_dagC
Get a DAG by ID
Inputs: dag_id (required).
get_dag_dataset_queued_eventC
Get a queued Dataset event for a DAG
Inputs: dag_id (required), uri (required).
get_dag_dataset_queued_eventsC
Get queued Dataset events for a DAG
Inputs: dag_id (required).
get_dag_detailsC
Get a simplified representation of DAG
Inputs: dag_id (required), fields.
get_dag_runC
Get a DAG run by DAG ID and DAG run ID
Inputs: dag_id (required), dag_run_id (required).
get_dag_runsD
Get DAG runs by ID
Inputs: dag_id (required), limit, offset, execution_date_gte, +9 more.
get_dag_runs_batchC
List DAG runs (batch)
Inputs: dag_ids, execution_date_gte, execution_date_lte, start_date_gte, +7 more.
get_dag_sourceD
Get a source code
Inputs: file_token (required).
get_dag_statsD
Get DAG stats
Inputs: dag_ids.
get_dag_tasksD
Get tasks for DAG
Inputs: dag_id (required).
get_datasetC
Get a dataset by URI
Inputs: uri (required).
get_dataset_eventsD
Get dataset events
Inputs: limit, offset, order_by, dataset_id, +4 more.
get_dataset_queued_eventsC
Get queued Dataset events for a Dataset
Inputs: uri (required).
get_datasetsD
List datasets
Inputs: limit, offset, order_by, uri_pattern, +1 more.
get_event_logC
Get a specific log entry by ID
Inputs: event_log_id (required).
get_event_logsC
List log entries from event log
Inputs: limit, offset, order_by, dag_id, +10 more.
get_healthC
Get instance status
Inputs: no named parameters.
get_import_errorC
Get a specific import error by ID
Inputs: import_error_id (required).
get_import_errorsC
List import errors
Inputs: limit, offset, order_by.
get_pluginsC
Get a list of loaded plugins
Inputs: limit, offset.
get_poolC
Get a pool by name
Inputs: pool_name (required).
get_poolsD
List pools
Inputs: limit, offset, order_by.
get_providersC
Get a list of loaded providers
Inputs: limit, offset.
get_taskC
Get a task by ID
Inputs: dag_id (required), task_id (required).
get_task_instanceC
Get a task instance by DAG ID, task ID, and DAG run ID
Inputs: dag_id (required), task_id (required), dag_run_id (required).
get_tasksC
Get tasks for DAG
Inputs: dag_id (required), order_by.
get_upstream_dataset_eventsC
Get dataset events for a DAG run
Inputs: dag_id (required), dag_run_id (required).
get_valueC
Get a specific option from configuration
Inputs: section (required), option (required).
get_variableC
Get a variable by key
Inputs: key (required).
get_versionC
Get version information
Inputs: no named parameters.
get_xcom_entriesD
Get all XCom entries
Inputs: dag_id (required), dag_run_id (required), task_id (required), map_index, +3 more.
get_xcom_entryD
Get an XCom entry
Inputs: dag_id (required), dag_run_id (required), task_id (required), xcom_key (required), +3 more.
list_connectionsC
List all connections
Inputs: limit, offset, order_by.
list_task_instancesC
List task instances by DAG ID and DAG run ID
Inputs: dag_id (required), dag_run_id (required), execution_date_gte, execution_date_lte, +13 more.
list_variablesD
List all variables
Inputs: limit, offset, order_by.
patch_dagD
Update a DAG
Inputs: dag_id (required), is_paused, tags.
patch_dagsC
Update multiple DAGs
Inputs: dag_id_pattern, is_paused, tags.
patch_poolC
Update a pool
Inputs: pool_name (required), slots, description, include_deferred.
pause_dagC
Pause a DAG by ID
Inputs: dag_id (required).
post_dag_runC
Trigger a DAG by ID
Inputs: dag_id (required), dag_run_id, data_interval_end, data_interval_start, +8 more.
post_poolD
Create a pool
Inputs: name (required), slots (required), description, include_deferred.
reparse_dag_fileC
Request re-parsing of a DAG file
Inputs: file_token (required).
set_dag_run_noteC
Update the DagRun note
Inputs: dag_id (required), dag_run_id (required), note (required).
set_task_instances_stateD
Set a state of task instances
Inputs: dag_id (required), state (required), task_ids, execution_date, +5 more.
test_connectionD
Test a connection
Inputs: conn_type (required), host, port, login, +3 more.
unpause_dagC
Unpause a DAG by ID
Inputs: dag_id (required).
update_connectionC
Update a connection by ID
Inputs: conn_id (required), conn_type, host, port, +4 more.
update_dag_run_stateC
Update a DAG run state by DAG ID and DAG run ID
Inputs: dag_id (required), dag_run_id (required), state.
update_task_instanceC
Update a task instance by DAG ID, DAG run ID, and task ID
Inputs: dag_id (required), dag_run_id (required), task_id (required), state.
update_variableC
Update a variable by key
Inputs: key (required), value, description.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 66 tools
Most tools have distinct purposes targeting specific resources and actions, such as clear_dag_run vs. delete_dag_run. However, some overlap exists, like get_dag_details and get_dag, which could cause confusion about which to use for DAG information, and get_tasks and get_dag_tasks appear redundant.
Tool names follow a highly consistent verb_noun pattern throughout, using snake_case uniformly. Examples include create_connection, delete_dag, get_config, and update_variable, making them predictable and easy to parse.
With 66 tools, the count is excessive for typical MCP server use, likely overwhelming for agents and indicating poor scoping. While Airflow is complex, this many tools suggests fragmentation rather than a streamlined interface.
The tool set provides comprehensive CRUD and lifecycle coverage for Airflow's domain, including DAGs, tasks, connections, variables, datasets, and more. No obvious gaps are present; it supports full management workflows from creation to deletion and monitoring.
Maintenance
Related MCP Connectors
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- AlicenseBqualityFmaintenanceA Model Context Protocol server that allows AI assistants to interact with Prefect's workflow automation platform through natural language, enabling users to manage flows, deployments, tasks, and other Prefect resources via conversational commands.4615Apache 2.0
- -licenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol server that provides access to messages from an external API endpoint using Bearer token authentication for integration with Claude Desktop.-
- AlicenseAqualityDmaintenanceA production-ready Model Context Protocol server that enables AI assistants and applications to interact with Airtable bases through a standardized interface with secure OAuth 2.0 authentication.103MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Apache Airflow through the Model Context Protocol, allowing users to manage DAGs, task instances, variables, connections, pools, XComs, and datasets.MIT