Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fa37bc7

Browse filesBrowse files
committed
Refactor MCP-Airflow-API to use mcp_main.py as the main entry point, replacing airflow_api.py and updating related configurations and scripts. Affected files: .github/copilot-instructions.md, README.md, mcp-config.json.stdio, pyproject.toml, run-mcp-inspector-local.sh, run-mcp-inspector-pypi.sh, scripts/mcp-server-docker-cmd.sh, src/mcp_airflow_api/__init__.py, src/mcp_airflow_api/prompt_template.md, tests/test_prompt_template.py, src/mcp_airflow_api/mcp_main.py. Generated by Copilot.
1 parent 404e4f1 commit fa37bc7
Copy full SHA for fa37bc7

File tree

Expand file treeCollapse file tree

11 files changed

+18
-12
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

11 files changed

+18
-12
lines changed
Open diff view settings
Collapse file

‎.github/copilot-instructions.md‎

Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+3-3Lines changed: 3 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- `src/mcp_airflow_api/airflow_api.py`: 40+ `@mcp.tool()` decorators defining Airflow operations
88
- `src/mcp_airflow_api/functions.py`: Global session management with connection pooling
99
- `src/mcp_airflow_api/prompt_template.md`: Canonical English instructions for LLMs
10-
- `pyproject.toml`: Entry point `mcp-airflow-api = "mcp_airflow_api.airflow_api:main"`
10+
- `pyproject.toml`: Entry point `mcp-airflow-api = "mcp_airflow_mcp_main:main"`
1111

1212
**Transport Logic:** Environment variable `FASTMCP_TYPE` controls stdio vs http mode:
1313
```python
@@ -33,7 +33,7 @@ def list_dags(limit=20, offset=0):
3333
```
3434

3535
**Configuration Files:** Multiple configs for different deployment modes:
36-
- `mcp-config.json.stdio`: Local `python -m mcp_airflow_api.airflow_api`
36+
- `mcp-config.json.stdio`: Local `python -m mcp_airflow_mcp_main`
3737
- `mcp-config.json.http`: Docker `"url": "http://host.docker.internal:18002/mcp"`
3838

3939
## Docker Multi-Service Pattern
@@ -60,7 +60,7 @@ Tests in `tests/test_prompt_template.py` are "resilient to template content chan
6060
**Airflow Version:** Tested with 2.10.2 API v1 - all endpoints assume this version
6161

6262
## Development Workflow
63-
1. Local testing: `python -m mcp_airflow_api.airflow_api` (stdio mode)
63+
1. Local testing: `python -m mcp_airflow_mcp_main` (stdio mode)
6464
2. Docker development: `docker-compose up -d` then check http://localhost:8002/docs
6565
3. Testing: `pytest tests/` (uses resilient template validation)
6666

Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ docker-compose up -d
201201

202202
---
203203

204-
## Use Cases in Action
204+
`src/mcp_airflow_api/mcp_main.py`
205205

206206
![Capacity Management for Operations Teams](img/screenshot-001.png)
207207
---
@@ -299,7 +299,7 @@ cd MCP-Airflow-API
299299
pip install -e .
300300

301301
# Run in stdio mode
302-
python -m mcp_airflow_api.airflow_api
302+
python -m mcp_airflow_api.mcp_main
303303
```
304304

305305
---
Collapse file

‎mcp-config.json.stdio‎

Copy file name to clipboardExpand all lines: mcp-config.json.stdio
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"mcpServers": {
33
"airflow-api": {
44
"command": "python",
5-
"args": ["-m", "mcp_airflow_api.airflow_api"],
5+
"args": ["-m", "mcp_airflow_api.mcp_main"],
66
"env": {
77
"PYTHONPATH": "/app/src",
88
"AIRFLOW_API_VERSION": "v1",
Collapse file

‎pyproject.toml‎

Copy file name to clipboardExpand all lines: pyproject.toml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies = [
1414
]
1515

1616
[project.scripts]
17-
mcp-airflow-api = "mcp_airflow_api.airflow_api:main"
17+
mcp-airflow-api = "mcp_airflow_api.mcp_main:main"
1818

1919
[tool.hatch.build.targets.sdist]
2020
include = [
Collapse file

‎run-mcp-inspector-local.sh‎

Copy file name to clipboardExpand all lines: run-mcp-inspector-local.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ npx -y @modelcontextprotocol/inspector \
1212
-e AIRFLOW_API_PASSWORD='airflow' \
1313
-e MCP_LOG_LEVEL='INFO' \
1414
-e PYTHONPATH='./src' \
15-
-- uv run python -m mcp_airflow_api.airflow_api
15+
-- uv run python -m mcp_airflow_api.mcp_main
Collapse file

‎run-mcp-inspector-pypi.sh‎

Copy file name to clipboardExpand all lines: run-mcp-inspector-pypi.sh
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ set -euo pipefail
88

99
# (NOTE) 로컬 개발 소스로 기동됨.
1010

11+
npx -y @modelcontextprotocol/inspector \
12+
-e AIRFLOW_API_URL='http://localhost:38080/api/v1' \
13+
-e AIRFLOW_API_USERNAME='airflow' \
14+
-e AIRFLOW_API_PASSWORD='airflow' \
15+
-e MCP_LOG_LEVEL='INFO' \
16+
-- python -m mcp_airflow_api.mcp_main
1117
npx -y @modelcontextprotocol/inspector \
1218
-e AIRFLOW_API_URL='http://localhost:38080/api/v1' \
1319
-e AIRFLOW_API_USERNAME='airflow' \
Collapse file

‎scripts/mcp-server-docker-cmd.sh‎

Copy file name to clipboardExpand all lines: scripts/mcp-server-docker-cmd.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ echo " MCP_LOG_LEVEL: ${MCP_LOG_LEVEL}"
2323
echo " AIRFLOW_API_URL: ${AIRFLOW_API_URL}"
2424
echo " AIRFLOW_API_USERNAME: ${AIRFLOW_API_USERNAME}"
2525

26-
python -m mcp_airflow_api.airflow_api --type ${FASTMCP_TYPE} --host ${FASTMCP_HOST} --port ${FASTMCP_PORT}
26+
python -m mcp_airflow_api.mcp_main --type ${FASTMCP_TYPE} --host ${FASTMCP_HOST} --port ${FASTMCP_PORT}
Collapse file

‎src/mcp_airflow_api/__init__.py‎

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""MCP Airflow API package."""
2-
from .airflow_api import mcp
2+
from .mcp_main import mcp
33

44
__all__ = ["mcp"]
Collapse file

‎src/mcp_airflow_api/prompt_template.md‎

Copy file name to clipboardExpand all lines: src/mcp_airflow_api/prompt_template.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ dag_task_duration("my_dag", "latest_run_id")
289289

290290
## 10. References
291291

292-
- **MCP Server Main**: `src/mcp_airflow_api/airflow_api.py`
292+
- **MCP Server Main**: `src/mcp_airflow_api/mcp_main.py`
293293
- **Common Tools**: `src/mcp_airflow_api/tools/common_tools.py` (43 shared functions)
294294
- **API v1 Tools**: `src/mcp_airflow_api/tools/v1_tools.py` (imports common tools)
295295
- **API v2 Tools**: `src/mcp_airflow_api/tools/v2_tools.py` (common tools + 2 asset tools)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.