Skip to content

Commit 317f6b0

Browse files
authored
Merge branch 'main' into glama-badge
2 parents 379fe1e + 3ca0d5f commit 317f6b0

26 files changed

+1763
-821
lines changed

Diff for: Makefile

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1+
.PHONY: run build publish lint format
2+
3+
PYTHON=uv run --env-file .env python
4+
5+
PARAMS=
6+
run:
7+
$(PYTHON) src $(PARAMS)
8+
run-sse:
9+
$(PYTHON) src --transport sse $(PARAMS)
110
build:
2-
uv run python -m build
11+
uv build
312
publish:
4-
uv run python -m twine upload --config-file .pypirc dist/*
13+
uv publish
514
lint:
6-
uv run ruff check . --fix
15+
$(PYTHON) -m ruff check . --fix
716
format:
8-
uv run ruff format .
17+
$(PYTHON) -m ruff format .

Diff for: README.md

+104-22
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A Model Context Protocol (MCP) server implementation for Apache Airflow, enablin
88

99
## About
1010

11-
This project implements a [Model Context Protocol](https://modelcontextprotocol.io/introduction) server that wraps Apache Airflow's REST API, allowing MCP clients to interact with Airflow in a standardized way.
11+
This project implements a [Model Context Protocol](https://modelcontextprotocol.io/introduction) 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.
1212

1313
## Feature Implementation Status
1414

@@ -19,40 +19,87 @@ This project implements a [Model Context Protocol](https://modelcontextprotocol.
1919
| Get DAG Details | `/api/v1/dags/{dag_id}` ||
2020
| Pause DAG | `/api/v1/dags/{dag_id}` ||
2121
| Unpause DAG | `/api/v1/dags/{dag_id}` ||
22-
| Update DAG | `/api/v1/dags/{dag_id}` ||
23-
| Delete DAG | `/api/v1/dags/{dag_id}` ||
22+
| Update DAG | `/api/v1/dags/{dag_id}` ||
23+
| Delete DAG | `/api/v1/dags/{dag_id}` ||
24+
| Get DAG Source | `/api/v1/dagSources/{file_token}` ||
25+
| Patch Multiple DAGs | `/api/v1/dags` ||
26+
| Reparse DAG File | `/api/v1/dagSources/{file_token}/reparse` ||
2427
| **DAG Runs** | | |
2528
| List DAG Runs | `/api/v1/dags/{dag_id}/dagRuns` ||
2629
| Create DAG Run | `/api/v1/dags/{dag_id}/dagRuns` ||
27-
| Get DAG Run Details | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}` ||
28-
| Update DAG Run | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}` ||
29-
| Delete DAG Run | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}` ||
30+
| Get DAG Run Details | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}` ||
31+
| Update DAG Run | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}` ||
32+
| Delete DAG Run | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}` ||
33+
| Get DAG Runs Batch | `/api/v1/dags/~/dagRuns/list` ||
34+
| Clear DAG Run | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/clear` ||
35+
| Set DAG Run Note | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/setNote` ||
36+
| Get Upstream Dataset Events | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents` ||
3037
| **Tasks** | | |
3138
| List DAG Tasks | `/api/v1/dags/{dag_id}/tasks` ||
32-
| Get Task Details | `/api/v1/dags/{dag_id}/tasks/{task_id}` | |
39+
| Get Task Details | `/api/v1/dags/{dag_id}/tasks/{task_id}` | |
3340
| Get Task Instance | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}` ||
3441
| List Task Instances | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances` ||
35-
| Update Task Instance | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}` ||
42+
| Update Task Instance | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}` ||
43+
| Clear Task Instances | `/api/v1/dags/{dag_id}/clearTaskInstances` ||
44+
| Set Task Instances State | `/api/v1/dags/{dag_id}/updateTaskInstancesState` ||
45+
| **Variables** | | |
46+
| List Variables | `/api/v1/variables` ||
47+
| Create Variable | `/api/v1/variables` ||
48+
| Get Variable | `/api/v1/variables/{variable_key}` ||
49+
| Update Variable | `/api/v1/variables/{variable_key}` ||
50+
| Delete Variable | `/api/v1/variables/{variable_key}` ||
51+
| **Connections** | | |
52+
| List Connections | `/api/v1/connections` ||
53+
| Create Connection | `/api/v1/connections` ||
54+
| Get Connection | `/api/v1/connections/{connection_id}` ||
55+
| Update Connection | `/api/v1/connections/{connection_id}` ||
56+
| Delete Connection | `/api/v1/connections/{connection_id}` ||
57+
| Test Connection | `/api/v1/connections/test` ||
58+
| **Pools** | | |
59+
| List Pools | `/api/v1/pools` ||
60+
| Create Pool | `/api/v1/pools` ||
61+
| Get Pool | `/api/v1/pools/{pool_name}` ||
62+
| Update Pool | `/api/v1/pools/{pool_name}` ||
63+
| Delete Pool | `/api/v1/pools/{pool_name}` ||
64+
| **XComs** | | |
65+
| List XComs | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries` ||
66+
| Get XCom Entry | `/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}` ||
67+
| **Datasets** | | |
68+
| List Datasets | `/api/v1/datasets` ||
69+
| Get Dataset | `/api/v1/datasets/{uri}` ||
70+
| Get Dataset Events | `/api/v1/datasetEvents` ||
71+
| Create Dataset Event | `/api/v1/datasetEvents` ||
72+
| Get DAG Dataset Queued Event | `/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents/{uri}` ||
73+
| Get DAG Dataset Queued Events | `/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents` ||
74+
| Delete DAG Dataset Queued Event | `/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents/{uri}` ||
75+
| Delete DAG Dataset Queued Events | `/api/v1/dags/{dag_id}/dagRuns/queued/datasetEvents` ||
76+
| Get Dataset Queued Events | `/api/v1/datasets/{uri}/dagRuns/queued/datasetEvents` ||
77+
| Delete Dataset Queued Events | `/api/v1/datasets/{uri}/dagRuns/queued/datasetEvents` ||
78+
| **Monitoring** | | |
79+
| Get Health | `/api/v1/health` ||
80+
| **DAG Stats** | | |
81+
| Get DAG Stats | `/api/v1/dags/statistics` ||
82+
| **Config** | | |
83+
| Get Config | `/api/v1/config` ||
84+
| **Plugins** | | |
85+
| Get Plugins | `/api/v1/plugins` ||
86+
| **Providers** | | |
87+
| List Providers | `/api/v1/providers` ||
88+
| **Event Logs** | | |
89+
| List Event Logs | `/api/v1/eventLogs` ||
90+
| Get Event Log | `/api/v1/eventLogs/{event_log_id}` ||
3691
| **System** | | |
3792
| Get Import Errors | `/api/v1/importErrors` ||
3893
| Get Import Error Details | `/api/v1/importErrors/{import_error_id}` ||
3994
| Get Health Status | `/api/v1/health` ||
4095
| Get Version | `/api/v1/version` ||
41-
| **Variables** | | |
42-
| List Variables | `/api/v1/variables` ||
43-
| Create Variable | `/api/v1/variables` ||
44-
| Get Variable | `/api/v1/variables/{variable_key}` ||
45-
| Update Variable | `/api/v1/variables/{variable_key}` ||
46-
| Delete Variable | `/api/v1/variables/{variable_key}` ||
47-
| **Connections** | | |
48-
| List Connections | `/api/v1/connections` ||
49-
| Create Connection | `/api/v1/connections` ||
50-
| Get Connection | `/api/v1/connections/{connection_id}` ||
51-
| Update Connection | `/api/v1/connections/{connection_id}` ||
52-
| Delete Connection | `/api/v1/connections/{connection_id}` ||
5396

5497
## Setup
5598

99+
### Dependencies
100+
101+
This project depends on the official Apache Airflow client library (`apache-airflow-client`). It will be automatically installed when you install this package.
102+
56103
### Environment Variables
57104

58105
Set the following environment variables:
@@ -107,21 +154,56 @@ Alternative configuration using `uv`:
107154

108155
Replace `/path/to/mcp-server-apache-airflow` with the actual path where you've cloned the repository.
109156

157+
### Selecting the API groups
158+
159+
You can select the API groups you want to use by setting the `--apis` flag.
160+
161+
```bash
162+
uv run mcp-server-apache-airflow --apis "dag,dagrun"
163+
```
164+
165+
The default is to use all APIs.
166+
167+
Allowed values are:
168+
169+
- config
170+
- connections
171+
- dag
172+
- dagrun
173+
- dagstats
174+
- dataset
175+
- eventlog
176+
- importerror
177+
- monitoring
178+
- plugin
179+
- pool
180+
- provider
181+
- taskinstance
182+
- variable
183+
- xcom
184+
110185
### Manual Execution
111186

112187
You can also run the server manually:
113188
```bash
114-
python src/server.py
189+
make run
115190
```
116191

192+
`make run` accepts following options:
193+
117194
Options:
118195
- `--port`: Port to listen on for SSE (default: 8000)
119196
- `--transport`: Transport type (stdio/sse, default: stdio)
120197

198+
Or, you could run the sse server directly, which accepts same parameters:
199+
```bash
200+
make run-sse
201+
```
202+
121203
## Contributing
122204

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

125207
## License
126208

127-
[Add your license information here]
209+
[MIT License](LICENSE)

Diff for: pyproject.toml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mcp-server-apache-airflow"
3-
version = "0.1.3"
3+
version = "0.2.1"
44
description = "Model Context Protocol (MCP) server for Apache Airflow"
55
authors = [
66
{ name = "Gyeongmo Yang", email = "[email protected]" }
@@ -9,6 +9,7 @@ dependencies = [
99
"httpx>=0.24.1",
1010
"click>=8.1.7",
1111
"mcp>=0.1.0",
12+
"apache-airflow-client>=2.7.0",
1213
]
1314
requires-python = ">=3.10"
1415
readme = "README.md"
@@ -56,3 +57,8 @@ include = [
5657
[tool.ruff]
5758
select = ["E", "W", "F", "B", "I"]
5859
line-length = 120
60+
61+
[dependency-groups]
62+
dev = [
63+
"ruff>=0.11.0",
64+
]

Diff for: src/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
22

3-
from src.server import main
3+
from src.main import main
44

55
sys.exit(main())

0 commit comments

Comments
 (0)