avia-mcp
# avia-mcp
MCP-сервер для поиска дешёвых авиабилетов через Aviasales Data API (Travelpayouts).
Цены берутся из кэша поисков Aviasales примерно за 48 часов — это не живой поиск.
Актуальную цену подтверждает ссылка на Aviasales из ответа. Покупки и бронирования
через сервер нет.
## Инструменты
| Инструмент | Что делает |
|---|---|
| `search_places` | IATA-код города или аэропорта по названию. Токен не нужен. |
| `search_flights` | Самые дешёвые билеты по маршруту на дату или месяц. |
| `price_calendar` | Минимальная цена по дням месяца и три самых дешёвых дня. |
| `cheapest_destinations` | Самые дешёвые направления из города, с потолком цены. |
## Токен
Бесплатный токен: [travelpayouts.com](https://www.travelpayouts.com) → «Инструменты» → API.
Без токена работает только `search_places`.
## Подключение
Нужен Node.js 22 или новее. Сервер запускается через `npx`, ставить вручную ничего не надо.
Claude Code:
~~~bash
claude mcp add avia --scope user -e TRAVELPAYOUTS_TOKEN=ваш_токен -- npx -y avia-mcp
~~~
Claude Desktop, Cursor и другие клиенты — в конфиге MCP-серверов
(для Claude Desktop это `claude_desktop_config.json`):
~~~json
{
"mcpServers": {
"avia": {
"command": "npx",
"args": ["-y", "avia-mcp"],
"env": { "TRAVELPAYOUTS_TOKEN": "ваш_токен" }
}
}
}
~~~
### Переменные окружения
| Переменная | По умолчанию | Что задаёт |
|---|---|---|
| `TRAVELPAYOUTS_TOKEN` | — | Токен Travelpayouts. |
| `AVIA_CURRENCY` | `rub` | Валюта цен. |
## Разработка
~~~bash
git clone https://github.com/danyasnov/avia-mcp.git
cd avia-mcp
npm install
npm run build
cp .env.example .env # впишите токен
~~~
При запуске из клона сервер читает `.env` в корне проекта; переменные окружения
процесса важнее файла. Подключить локальную сборку:
~~~bash
claude mcp add avia --scope user -- node /путь/к/avia-mcp/dist/index.js
~~~
### Проверка
~~~bash
npm test
npm run smoke
~~~
`npm run smoke` запускает собранный сервер и вызывает каждый инструмент по разу.
Без токена отвечает только `search_places`, остальные возвращают подсказку про токен.
## Лицензия
MIT
TDQS
Scored across 4 tools
Each tool targets a distinct task: IATA code lookup (search_places), route pricing (search_flights), destination discovery (cheapest_destinations), and date-flexibility search (price_calendar). There is mild overlap between search_flights by month and price_calendar, and between search_flights and cheapest_destinations, but descriptions clarify the boundaries well.
All names are snake_case and descriptive, but the convention is not uniform: two use a search_ verb prefix while cheapest_destinations and price_calendar are noun phrases. Still readable and predictable enough to distinguish at a glance.
Four tools is a lean but well-scoped set covering code resolution, route pricing, destination discovery, and calendar pricing. Each earns its place, though the surface is on the thin side for a full flight-search domain.
The surface covers the core discovery workflow: resolve location, search a route, explore cheap destinations, and find cheap dates. Notable gaps include multi-city/round-trip specifics beyond trip_duration and no booking or price-alert operation, but these are workarounds rather than dead ends.