aeromcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. aeromcp-0.1.0/.claude/settings.local.json +33 -0
  2. aeromcp-0.1.0/.gitignore +6 -0
  3. aeromcp-0.1.0/CLAUDE.md +87 -0
  4. aeromcp-0.1.0/PKG-INFO +10 -0
  5. aeromcp-0.1.0/README.md +152 -0
  6. aeromcp-0.1.0/docs/superpowers/plans/2026-06-07-interpark-mcp.md +1372 -0
  7. aeromcp-0.1.0/pyproject.toml +29 -0
  8. aeromcp-0.1.0/src/interpark_mcp/__init__.py +0 -0
  9. aeromcp-0.1.0/src/interpark_mcp/__main__.py +4 -0
  10. aeromcp-0.1.0/src/interpark_mcp/common/__init__.py +0 -0
  11. aeromcp-0.1.0/src/interpark_mcp/common/config.py +29 -0
  12. aeromcp-0.1.0/src/interpark_mcp/core/__init__.py +0 -0
  13. aeromcp-0.1.0/src/interpark_mcp/core/interfaces.py +19 -0
  14. aeromcp-0.1.0/src/interpark_mcp/core/models.py +68 -0
  15. aeromcp-0.1.0/src/interpark_mcp/dependencies/__init__.py +0 -0
  16. aeromcp-0.1.0/src/interpark_mcp/dependencies/requester.py +7 -0
  17. aeromcp-0.1.0/src/interpark_mcp/infra/__init__.py +0 -0
  18. aeromcp-0.1.0/src/interpark_mcp/infra/build_id.py +32 -0
  19. aeromcp-0.1.0/src/interpark_mcp/infra/parser.py +81 -0
  20. aeromcp-0.1.0/src/interpark_mcp/infra/requester.py +118 -0
  21. aeromcp-0.1.0/src/interpark_mcp/mcp/__init__.py +0 -0
  22. aeromcp-0.1.0/src/interpark_mcp/mcp/banner.py +6 -0
  23. aeromcp-0.1.0/src/interpark_mcp/mcp/server.py +12 -0
  24. aeromcp-0.1.0/src/interpark_mcp/mcp/tools/__init__.py +0 -0
  25. aeromcp-0.1.0/src/interpark_mcp/mcp/tools/domestic.py +70 -0
  26. aeromcp-0.1.0/tests/__init__.py +0 -0
  27. aeromcp-0.1.0/tests/conftest.py +0 -0
  28. aeromcp-0.1.0/tests/core/__init__.py +0 -0
  29. aeromcp-0.1.0/tests/core/test_di.py +14 -0
  30. aeromcp-0.1.0/tests/core/test_interfaces.py +20 -0
  31. aeromcp-0.1.0/tests/core/test_models.py +57 -0
  32. aeromcp-0.1.0/tests/infra/__init__.py +0 -0
  33. aeromcp-0.1.0/tests/infra/test_build_id.py +46 -0
  34. aeromcp-0.1.0/tests/infra/test_parser.py +85 -0
  35. aeromcp-0.1.0/tests/infra/test_requester.py +79 -0
  36. aeromcp-0.1.0/tests/mcp/__init__.py +0 -0
  37. aeromcp-0.1.0/tests/mcp/test_domestic.py +71 -0
  38. aeromcp-0.1.0/uv.lock +1521 -0
@@ -0,0 +1,33 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "mcp__chrome-devtools__new_page",
5
+ "mcp__chrome-devtools__take_screenshot",
6
+ "mcp__chrome-devtools__navigate_page",
7
+ "mcp__chrome-devtools__take_snapshot",
8
+ "mcp__chrome-devtools__click",
9
+ "mcp__chrome-devtools__wait_for",
10
+ "mcp__chrome-devtools__list_network_requests",
11
+ "mcp__chrome-devtools__get_network_request",
12
+ "Bash(python3 *)",
13
+ "Bash(pip install *)",
14
+ "Bash(uv venv *)",
15
+ "Bash(uv pip *)",
16
+ "Bash(uv run *)",
17
+ "Bash(git init *)",
18
+ "Bash(git add *)",
19
+ "Bash(git commit *)",
20
+ "Bash(python *)",
21
+ "Bash(.venv/bin/python *)",
22
+ "Bash(/opt/homebrew/bin/python3 *)",
23
+ "Bash(/Users/comodoflow/Documents/project/interpark-mcp/.venv/bin/python *)",
24
+ "Bash(/Users/comodoflow/Documents/project/interpark-mcp/.venv/bin/python3 *)",
25
+ "Bash(git remote *)",
26
+ "Bash(git push *)",
27
+ "mcp__chrome-devtools__evaluate_script",
28
+ "Bash(curl -s \"https://tour-web-assets.interparkcdn.net/applications/air/9415a7/_next/static/chunks/4356-005cbd16f663850e.js\")",
29
+ "Bash(curl -s \"https://tour-web-assets.interparkcdn.net/applications/air/9415a7/_next/static/chunks/pages/_app-493a23ebdbc358a9.js\")",
30
+ "Bash(uv build *)"
31
+ ]
32
+ }
33
+ }
@@ -0,0 +1,6 @@
1
+ .interpark/**
2
+ __pycache__/
3
+ *.py[cod]
4
+ .venv/
5
+ dist/
6
+ *.egg-info/
@@ -0,0 +1,87 @@
1
+ # interpark-mcp
2
+
3
+ 인터파크 항공권 조회 MCP 서버 (오픈소스).
4
+
5
+ ## 목적
6
+
7
+ fastmcp 기반 MCP 서버. 인터파크 항공 API를 래핑해 AI 에이전트가 국내선/국제선 항공권을 조회할 수 있게 함.
8
+
9
+ ## 아키텍처
10
+
11
+ ```
12
+ mcp/ - MCP 도구 정의 (fastmcp @mcp.tool 데코레이터)
13
+ core/ - 도메인 모델 (dataclass), 추상 인터페이스
14
+ infra/ - 인터파크 API 호출 구현체
15
+ common/ - 공통 유틸, config, 상수
16
+ dependencies/ - 컴포지트 루트. 함수 기반 의존성 주입 팩토리
17
+ ```
18
+
19
+ 의존 방향: `mcp → core ← infra`. infra가 core 추상 클래스를 구현.
20
+ `dependencies`는 core + infra 모두 참조 가능. 다른 레이어는 `dependencies`만 바라봄.
21
+
22
+ ## 의존성 주입 컨벤션
23
+
24
+ `dependencies/`에 팩토리 함수 정의, 기본값으로 주입:
25
+
26
+ ```python
27
+ # dependencies/requester.py
28
+ def get_requester() -> Requester:
29
+ return InterparkRequester()
30
+
31
+ # mcp/tools/search.py
32
+ async def search_flights(
33
+ origin: str,
34
+ destination: str,
35
+ date: str,
36
+ requester: Requester = get_requester(),
37
+ ) -> list[Flight]:
38
+ ...
39
+ ```
40
+
41
+ - 기본값이 구체 구현체 바인딩 → 호출 측은 core 추상 타입만 앎
42
+ - 테스트 시 인자로 mock 주입 가능
43
+ - `get_*` 함수는 순수 팩토리. 상태 없음, 매번 새 인스턴스 또는 싱글턴 반환
44
+
45
+ ## 인터파크 API 플로우 (국내선)
46
+
47
+ 검색 세션 키 획득 → 상태 폴링 → 결과 조회 순서.
48
+
49
+ **1단계: 검색 세션 키 (`DOMESTIC::uuid`) 획득**
50
+
51
+ Next.js SSR 엔드포인트 호출:
52
+ ```
53
+ GET https://travel.interpark.com/air/_next/data/{buildId}/search/{routes}.json
54
+ ?cabin=ALL&adult=1&child=0&infant=0&schedules={encoded_routes}
55
+ ```
56
+
57
+ - `buildId`: HTML `<script id="__NEXT_DATA__">` 파싱으로 추출
58
+ - `routes` path 형식: `c:SEL-a:PUS-20260620/a:PUS-c:SEL-20260622`
59
+ - 편도: `a:GMP-a:CJU-20260620`
60
+ - SEL만 `c:` prefix (GMP/ICN 두 공항 포괄하는 도시코드). 나머지 국내 공항은 모두 `a:` prefix.
61
+ - 응답 경로: `pageProps.dehydratedState.queries[0].state.data.key`
62
+
63
+ **2단계: 상태 폴링**
64
+
65
+ ```
66
+ GET /air/air-api/inpark-air-web-api/domestic/flights/search/{key}/status
67
+ → { "status": "PENDING" | ... }
68
+ ```
69
+
70
+ **3단계: 결과 조회**
71
+
72
+ ```
73
+ POST /air/air-api/inpark-air-web-api/domestic/flights/search/{key}
74
+ Body: { "pageNumber": 1, "pageSize": 20, "filter": { "byAirline": null, ... } }
75
+ ```
76
+
77
+ 자세한 응답 스키마: `.interpark/domestic-flight-search.md` 참조.
78
+
79
+ ## 핵심 규칙
80
+
81
+ - `core`는 인터파크 의존성 없음. 순수 Python dataclass + ABC.
82
+ - `common`은 인터파크 의존성 없음. 범용 유틸만.
83
+ - `infra`에서 HTTP 호출 시 `User-Agent` 브라우저 헤더 필수 (없으면 차단됨).
84
+ - `buildId`는 캐시하되 HTTP 4xx 시 재추출.
85
+ - 모든 가격 단위: 원(KRW) 정수.
86
+ - 시각 필드: ISO 8601, TZ 없음 (한국 로컬 시각).
87
+ - DI 팩토리 함수명: `get_{추상클래스명_snake_case}` 형식.
aeromcp-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 2.4
2
+ Name: aeromcp
3
+ Version: 0.1.0
4
+ Requires-Python: >=3.11
5
+ Requires-Dist: fastmcp>=2.0.0
6
+ Requires-Dist: httpx>=0.27.0
7
+ Provides-Extra: dev
8
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
9
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
10
+ Requires-Dist: respx>=0.21.0; extra == 'dev'
@@ -0,0 +1,152 @@
1
+ # AeroMCP
2
+
3
+ 인터파크 국내선 항공권 조회 MCP 서버.
4
+
5
+ AI 에이전트(Claude, Cursor 등)가 인터파크 항공 API를 통해 국내선 항공편을 검색할 수 있게 해주는 [fastmcp](https://github.com/jlowin/fastmcp) 기반 오픈소스 MCP 서버.
6
+
7
+ ## 기능
8
+
9
+ - 국내선 편도/왕복 항공권 검색
10
+ - 전체 항공사 조회 (티웨이, 에어부산, 대한항공 등)
11
+ - 운임 상세 정보 (운임, 유류할증료, 공항세, 카드 캐시백 혜택)
12
+ - 실시간 잔여석 조회
13
+
14
+ ## 설치
15
+
16
+ ### uvx (권장)
17
+
18
+ ```bash
19
+ uvx aeromcp
20
+ ```
21
+
22
+ ### pip
23
+
24
+ ```bash
25
+ pip install aeromcp
26
+ ```
27
+
28
+ ### 직접 실행
29
+
30
+ ```bash
31
+ git clone https://github.com/bssm-oss/AeroMCP.git
32
+ cd AeroMCP
33
+ pip install -e .
34
+ interpark-mcp
35
+ ```
36
+
37
+ ## MCP 클라이언트 설정
38
+
39
+ ### Claude Desktop / Cursor
40
+
41
+ `claude_desktop_config.json` 또는 `mcp.json`:
42
+
43
+ ```json
44
+ {
45
+ "mcpServers": {
46
+ "interpark": {
47
+ "command": "uvx",
48
+ "args": ["aeromcp"]
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ pip 설치 시:
55
+
56
+ ```json
57
+ {
58
+ "mcpServers": {
59
+ "interpark": {
60
+ "command": "interpark-mcp"
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ ## 사용 가능한 도구
67
+
68
+ ### `search_domestic_flights`
69
+
70
+ 국내선 항공권을 검색합니다.
71
+
72
+ | 파라미터 | 타입 | 필수 | 설명 |
73
+ |---------|------|------|------|
74
+ | `origin` | string | ✓ | 출발 IATA 코드 (예: `GMP`, `SEL`) |
75
+ | `destination` | string | ✓ | 도착 IATA 코드 (예: `CJU`, `PUS`) |
76
+ | `departure_date` | string | ✓ | 출발일 `YYYY-MM-DD` |
77
+ | `return_date` | string | | 귀국일 `YYYY-MM-DD` (왕복 시) |
78
+ | `adult` | int | | 성인 수 (기본값 1) |
79
+ | `child` | int | | 소아 수 (기본값 0) |
80
+ | `infant` | int | | 유아 수 (기본값 0) |
81
+
82
+ **응답 필드:**
83
+
84
+ ```json
85
+ {
86
+ "id": "TW0933L",
87
+ "total_price": 68900,
88
+ "departure": "GMP",
89
+ "arrival": "CJU",
90
+ "departure_at": "2026-06-20T11:50:00",
91
+ "arrival_at": "2026-06-20T12:55:00",
92
+ "carrier": "TW",
93
+ "flight_number": "0933",
94
+ "flight_time_minutes": 65,
95
+ "free_baggage_kg": 15,
96
+ "seat_availability": 9,
97
+ "cabin": "ECONOMY",
98
+ "discount_type": "DISCOUNT",
99
+ "cashback": {
100
+ "card_name": "삼성카드",
101
+ "rate": 1.5,
102
+ "amount": 1010,
103
+ "discounted_price": 67890
104
+ }
105
+ }
106
+ ```
107
+
108
+ ## 공항 코드
109
+
110
+ | 코드 | 도시/공항 | 비고 |
111
+ |------|-----------|------|
112
+ | `SEL` | 서울 | 도시 코드 (GMP + ICN 통합) |
113
+ | `GMP` | 서울/김포 | |
114
+ | `ICN` | 서울/인천 | |
115
+ | `CJU` | 제주 | |
116
+ | `PUS` | 부산/김해 | |
117
+ | `KWJ` | 광주 | |
118
+ | `MWX` | 무안 | |
119
+ | `KUV` | 군산 | |
120
+ | `TAE` | 대구 | |
121
+ | `HIN` | 진주/사천 | |
122
+ | `RSU` | 여수 | |
123
+ | `USN` | 울산 | |
124
+ | `WJU` | 원주 | |
125
+ | `CJJ` | 청주 | |
126
+ | `KPO` | 포항 | |
127
+ | `YNY` | 양양 | |
128
+
129
+ ## 아키텍처
130
+
131
+ ```
132
+ mcp/ - FastMCP 도구 정의
133
+ core/ - 도메인 모델 (dataclass), 추상 인터페이스
134
+ infra/ - 인터파크 API 호출 구현체
135
+ common/ - 설정 상수, 브라우저 헤더
136
+ dependencies/ - 의존성 주입 팩토리
137
+ ```
138
+
139
+ 의존 방향: `mcp → core ← infra`
140
+
141
+ ## 개발
142
+
143
+ ```bash
144
+ git clone https://github.com/bssm-oss/AeroMCP.git
145
+ cd AeroMCP
146
+ pip install -e ".[dev]"
147
+ pytest
148
+ ```
149
+
150
+ ## 라이선스
151
+
152
+ MIT