Token导航 LogoToken导航TokenDH.com
Airflow Token logo
AI代理stdio官方级别未说明来源级核验

Airflow Token

MCP Server

一个支持Bearer令牌认证的Apache Airflow模型上下文协议(MCP)服务器,实现与Astronomer Cloud及独立Airflow实例的无缝集成。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
工作流管理PythonClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

nikhil-ganage

提供方

nikhil-ganage

最后核验

2026/5/17 20:23

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

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

详细介绍

mcp服务器气流令牌

Apache Airflow的模型上下文协议(MCP)服务器,支持承载令牌身份验证,可与Astronomer Cloud和独立Airflow实例无缝集成。

基于 mcp服务器apache气流 作者:杨 此分叉增强了原始MCP服务器 承载令牌身份验证支持,使其与Astronomer Cloud和其他基于令牌的Airflow部署兼容。

关键增强功能

  • 承载令牌身份验证 -现代Airflow部署的主要身份验证方法
  • 天文学家云兼容 -与天文学家管理的气流无缝协作
  • 向后兼容 -仍然支持用户名/密码身份验证
  • 增强的URL处理 -正确处理部署路径,如 /deployment-id

关于

该项目实现了 模型上下文协议 服务器,包装Apache Airflow的REST API,允许MCP客户端以标准化的方式与Airflow交互。它使用官方的Apache Airflow客户端库来确保兼容性和可维护性。

功能实现状态

功能API路径状态
DAG管理
列出DAGs/api/v1/dags
获取DAG详细信息/api/v1/dags/{dag_id}
暂停DAG/api/v1/dags/{dag_id}
未授权DAG/api/v1/dags/{dag_id}
更新DAG/api/v1/dags/{dag_id}
删除DAG/api/v1/dags/{dag_id}
获取DAG源/api/v1/dagSources/{file_token}
修补多个DAGs/api/v1/dags
重新解析DAG文件/api/v1/dagSources/{file_token}/reparse
DAG运行
列出DAG运行/api/v1/dags/{dag_id}/dagRuns
创建DAG运行/api/v1/dags/{dag_id}/dagRuns
获取DAG运行详细信息/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}
更新DAG运行/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}
删除DAG运行/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}
获取DAG运行批处理/api/v1/dags/~/dagRuns/list
清除DAG运行/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/clear
设置DAG运行说明/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/setNote
获取上游数据集事件/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents
任务
列出DAG任务/api/v1/dags/{dag_id}/tasks
获取任务详细信息/api/v1/dags/{dag_id}/tasks/{task_id}
获取任务实例/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}
列出任务实例/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances
更新任务实例/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}
清除任务实例/api/v1/dags/{dag_id}/clearTaskInstances
设置任务实例状态/api/v1/dags/{dag_id}/updateTaskInstancesState
变量
列出变量/api/v1/variables
创建变量/api/v1/variables
获取变量/api/v1/variables/{variable_key}
更新变量/api/v1/variables/{variable_key}
删除变量/api/v1/variables/{variable_key}
连接
列出连接/api/v1/connections
创建连接/api/v1/connections
获取连接/api/v1/connections/{connection_id}
更新连接/api/v1/connections/{connection_id}
删除连接/api/v1/connections/{connection_id}
测试连接/api/v1/connections/test
水池
列出池/api/v1/pools
创建池/api/v1/pools
获取游泳池/api/v1/pools/{pool_name}
更新池/api/v1/pools/{pool_name}
删除池/api/v1/pools/{pool_name}
XComs
列出XComs/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries
获取XCom条目/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}
数据集
列出数据集/api/v1/datasets
获取数据集/api/v1/datasets/{uri}
获取数据集事件/api/v1/datasetEvents
创建数据集事件/api/v1/datasetEvents
获取DAG数据集排队事件/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents/{uri}
获取DAG数据集排队事件/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents
删除DAG数据集排队事件/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents/{uri}
删除DAG数据集排队事件/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents
获取数据集排队事件/api/v1/datasets/{uri}/dagRuns/queued/datasetEvents
删除数据集排队事件/api/v1/datasets/{uri}/dagRuns/queued/datasetEvents
监控
获得健康/api/v1/health
DAG统计信息
获取DAG统计信息/api/v1/dags/statistics
配置
获取配置/api/v1/config
插件
获取插件/api/v1/plugins
提供商
列出提供商/api/v1/providers
事件日志
列出事件日志/api/v1/eventLogs
获取事件日志/api/v1/eventLogs/{event_log_id}
系统
获取导入错误/api/v1/importErrors
获取导入错误详细信息/api/v1/importErrors/{import_error_id}
获取健康状态/api/v1/health
获取版本/api/v1/version

设置

依赖项

该项目依赖于官方的Apache Airflow客户端库(apache-airflow-client).安装此软件包时,它将自动安装。

环境变量

设置以下环境变量:

令牌身份验证(推荐)

AIRFLOW_HOST=        # Optional, defaults to http://localhost:8080
AIRFLOW_TOKEN=  # Your Airflow API token
AIRFLOW_API_VERSION=v1                  # Optional, defaults to v1

基本身份验证(备选)

AIRFLOW_HOST=        # Optional, defaults to http://localhost:8080
AIRFLOW_USERNAME=
AIRFLOW_PASSWORD=
AIRFLOW_API_VERSION=v1                  # Optional, defaults to v1

注:如果 AIRFLOW_TOKEN 如果提供了,它将用于身份验证。否则,服务器将退回到使用用户名和密码的基本身份验证。

使用Claude Desktop

首先,克隆存储库:

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

添加到您的 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"
      }
    }
  }
}

使用基本身份验证

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

对于只读模式(出于安全考虑建议):

使用令牌身份验证的只读

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

使用基本身份验证进行只读

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

替换 path-to-repo 使用克隆存储库的实际路径。

天文学家云配置示例

对于天文学家云部署:

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

注意:部署ID是Astronomer Cloud URL路径的一部分。

选择API组

您可以通过设置 --apis 旗帜。

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

默认设置是使用所有API。

允许的值为:

  • 配置
  • 连接
  • 有向无环图
  • dagrun
  • 日状态
  • 数据集
  • 事件记录
  • 输入错误
  • 监控
  • 插件
  • 提供者
  • 任务实例
  • 变量
  • xcom

只读模式

您可以使用以下命令以只读模式运行服务器 --read-only 旗帜。这将只公开执行读取操作(GET请求)的工具,并排除创建、更新或删除资源的任何工具。

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

在只读模式下,服务器将只公开以下工具:

  • 列出DAG、DAG运行、任务、变量、连接等。
  • 获取特定资源的详细信息
  • 读取配置和监控信息
  • 测试连接(非破坏性)

在只读模式下,创建、更新、删除DAG、变量、连接、触发DAG运行等写入操作将不可用。

您可以将只读模式与API组选择相结合:

uv run mcp-server-airflow-token --read-only --apis "dag,variable"

手动执行

您还可以手动运行服务器:

make run

make run 接受以下选项:

选项:

  • --port:监听SSE的端口(默认值:8000)
  • --transport:传输类型(stdio/sse,默认值:stdio)

或者,您可以直接运行sse服务器,它接受相同的参数:

make run-sse

安装

您可以使用pip或uvx安装服务器:

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

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

发展

建立开发环境

  1. 克隆存储库:
git clone https://github.com/nikhil-ganage/mcp-server-airflow-token.git
cd mcp-server-airflow-token
  1. 安装开发依赖项:
uv sync --dev
  1. 创建一个 .env 环境变量文件(开发时可选):
touch .env
备注:运行测试不需要环境变量。这 AIRFLOW_HOST 默认为 http://localhost:8080 用于开发和测试目的。

运行测试

该项目使用pytest进行测试,并使用以下可用命令:

# Run all tests
make test

代码质量

# Run linting
make lint

# Run code formatting
make format

持续集成

该项目包括GitHub Actions工作流(.github/workflows/test.yml)自动:

  • 在Python 3.10、3.11和3.12上运行测试
  • 使用ruff执行绒毛检查
  • 对每个推送和拉取请求运行 main 分支

CI管道确保在合并任何更改之前,跨受支持的Python版本的代码质量和兼容性。

贡献

欢迎投稿!请随时提交拉取请求。

当project.version在中更新时,该包会自动部署到PyPI pyproject.toml. 按照semver进行版本控制。

请在PR中包含版本更新,以便将更改应用于核心逻辑。

许可证

MIT许可证

目录标签

目录标签

工作流管理PythonClaudeApacheAirflow本地部署令牌认证RESTAPIAstronomer集成

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP