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.
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
Set the following environment variables to connect to your Airflow instance:
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
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.
First, clone the repository:
git clone https://github.com/nikhil-ganage/mcp-server-airflow-token
Add to your claude_desktop_config.json
:
{
"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.
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.
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.
You can select which API groups to expose:
uv run mcp-server-airflow-token --apis "dag,dagrun"
Available API groups:
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
You can combine multiple options:
# Read-only mode with specific API groups
uv run mcp-server-airflow-token --read-only --apis "dag,variable"
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.
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.
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"
}
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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