MrBilit

io.github.sepehr071v0.1.1更新于 Oct 5, 2026

Unofficial read-only MrBilit: Iranian flights, trains, buses, taxis and hotels, seats and prices.

概览

AI 生成的概览

让助手查询伊朗的航班、火车、大巴、出租车和酒店,获取座位、价格与规则,且为只读。

功能
这是一个基于 MrBilit 公开旅行接口的非官方只读 MCP 服务器。它提供 22 个工具:地点与公司代码查询、航班搜索与票价日历、火车班次与舱位余票、大巴与私人出租车搜索及座位图、酒店搜索与房型评价,以及公告、帮助文档和旅行指南(R47-R81)。所有工具都标注 readOnlyHint,并返回紧凑的结构化 JSON(R82)。价格以托曼返回(R84)。
适用场景
当你希望助手比较伊朗境内的出行方案时使用,例如查询两城之间最便宜的航班、火车或大巴日期,查看余票、行李与退改规则,或比较酒店的确切房价(R2、R40-R42)。它只用于查询和比较,订票需在 MrBilit 网站完成(R103)。
运行要求
以 uvx(或 pip install mrbilit-mcp)在本地运行的进程,需要 Python 与 uv(R27、R38)。无需账号、登录或 API 密钥(R46)。需要能访问 MrBilit 的 API 主机;在伊朗境外或连接超时时,可设置可选环境变量 MRBILIT_MCP_PROXY 指向 HTTP 代理(R29、R97-R98)。仅支持桌面端。
安装前请注意
设计上只读:不登录、不锁座、不预订、不付款(R25、R101-R102、R118)。它会向 MrBilit 的公开接口发送请求,因此查询内容和路线信息会离开本机(R44-R46)。MRBILIT_MCP_PROXY 的 URL 可能包含代理凭据(R116);系统代理变量会被忽略(R99)。各类 id 会过期,必须来自新的搜索(R90)。非官方项目,与 MrBilit 无关联,接口可能随时变化(R135-R136)。

安装

在 SourceWeft 中

  1. 打开 控制台中的 MrBilit,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[mrbilit-mcp: let your AI agent find the cheapest way to travel in Iran]

✈️ mrbilit-mcp

Let your AI agent plan trips in Iran with MrBilit.
Find the cheapest flight, train, bus or private taxi on a date or over a month, see seats, baggage and refund rules,
and compare hotels with exact room prices, all from Claude, Cursor or Copilot.

[PyPI] [Python] [CI] [MCP Registry] [License: MIT]

[Install in Cursor] [Install in VS Code]

Quick start · What it can do · Tools · FAQ · فارسی


Why

MrBilit (mrbilit.com, مستربلیط) sells flights, trains, intercity buses, private taxis and hotels in one place, but each one has its own search, calendar and rules. Comparing "plane or train or bus, which day, which seat" means a dozen page loads. An agent with mrbilit-mcp does it in one go:

You: Cheapest way to get from Tehran to Mashhad on 20 October?

Agent: calls mb_search_flights(origin="THR", destination="MHD", date="2026-10-20"), mb_train_price_calendar(origin=1, destination=191), mb_search_buses(origin=11320000, destination=31310000, date="2026-10-20", sort="cheapest")

ModeCheapest optionDepartsPrice (Toman)
BusPeyk Saba VIP, Tehran South terminal, 17 seats left21:00, arrives 09:001,313,000
Traincheapest seat that day760,000
FlightMehr Air MEH 4200, Mehrabad, 2 seats left08:30, arrives 09:3011,856,000

The train is cheapest; want me to list that day's trains and free seats with mb_search_trains?

Real tool output from 2026-10-04; prices and seats change all the time. Prices are in Toman.

What it can do

  • ✈️ Flights: domestic and international, one-way or round trip, party prices, cabin/airline/direct/time filters
  • 📅 Cheapest day for flights, trains and buses over weeks, and the cheapest nights of a hotel
  • 🚆 Trains: every class with free seats, exact price for children, infants or a whole compartment, every stop
  • 🚌 Buses and taxis: terminals, companies, VIP, seat maps with women/men seats, private door-to-door cars
  • 🔀 Alternatives when trains are full: one-change trips, nearby stations, bus routes and airports
  • 🏨 Hotels: available stays with prices, every hotel of a city, guest ratings and reviews, rooms and exact prices
  • 📢 Context: current site notices, official refund and baggage rules, help-center guides, route guides
  • 🔒 Read-only by design: no login, no seat hold, no booking, no payment

Quick start

You need uv.

Claude Code
bash
claude mcp add mrbilit -- uvx mrbilit-mcp

Outside Iran, if MrBilit's API does not answer, add a proxy:

bash
claude mcp add mrbilit -e MRBILIT_MCP_PROXY=http://127.0.0.1:8080 -- uvx mrbilit-mcp
Claude Desktop

Settings → Developer → Edit Config, then add:

json
{  "mcpServers": {    "mrbilit": { "command": "uvx", "args": ["mrbilit-mcp"] }  }}

Need a proxy? Add "env": { "MRBILIT_MCP_PROXY": "http://127.0.0.1:8080" } next to args.

Cursor

Click Install in Cursor above, or add the Claude Desktop block to ~/.cursor/mcp.json.

VS Code (Copilot agent mode)

Click Install in VS Code above, or add to .vscode/mcp.json:

json
{  "servers": {    "mrbilit": { "type": "stdio", "command": "uvx", "args": ["mrbilit-mcp"] }  }}
Anything else

It's a standard stdio MCP server: run uvx mrbilit-mcp, or pip install mrbilit-mcp and run mrbilit-mcp.

Then just ask:

  • "Cheapest day to fly Tehran to Kish in the next month, and the baggage on that flight?"
  • "Train from Tehran to Mashhad next Friday for 2 adults and a child: which classes have seats and what's the total?"
  • "4-star hotels in Shiraz for 3 nights from the 20th under 3 million Toman a night, with their reviews."
  • ارزان‌ترین اتوبوس VIP تهران به اصفهان فردا شب و صندلی‌های خالی آن؟

How it works

text
  AI agent  (Claude, Cursor, Copilot, ...)      │      │  MCP over stdio      ▼  mrbilit-mcp  (runs on your machine)      │      │  HTTPS (REST, optional proxy)      ├──────▶  flight.atighgasht.com, train.mrbilit.com, masir.mrbilit.com, bus.mrbilit.ir, hotel.mrbilit.ir      └──────▶  content.mrbilit.ir, directus.mrbilit.ir, mrbilit.com (site lists, magazine)

mrbilit-mcp runs locally and calls the same public endpoints the mrbilit.com website uses. There's no hosted server in between, no API key, and nothing about you is sent anywhere else.

Tools

Every search takes the codes from mb_find_place: IATA codes for flights (THR, MHD, ISTALL), station ids for trains (Tehran 1, Mashhad 191), 8-digit city ids for buses and taxis (Tehran 11320000), slugs for hotels (mashhad, mashhad/enghelab).

📍 Places and companies (2)
ToolWhat it does
mb_find_placeCity, airport, station or hotel name → the code each search takes (flight, train, bus, taxi, hotel)
mb_companiesAirlines, rail operators, bus companies and taxi classes with their codes
✈️ Flights (3)
ToolWhat it does
mb_search_flightsFlights on a date, one-way or round trip, domestic or international: price per adult and party total, seats, baggage; cabin, airline, direct and time filters
mb_flight_price_calendarCheapest fare per day over up to 180 days
mb_flight_fare_detailsOne flight or round-trip package's fares: refund penalties, checked baggage, fare rules, notes, adult/child/infant prices
🚆 Trains (5)
ToolWhat it does
mb_search_trainsTrains on a date with every class, price per adult and fresh free-seat counts; men/women/general/car quotas
mb_train_price_calendarCheapest bookable train per day
mb_train_priceExact price of a class for adults, children, infants, foreigners and empty berths, with the total
mb_train_stopsEvery stop of a train with date and time
mb_alternative_routesTrips with one change (any mix of train and bus) and nearby train, bus and flight routes
🚌 Buses and taxis (4)
ToolWhat it does
mb_search_busesBuses on a date: company, terminal, times, price per seat, free seats, VIP, stops, refund penalties
mb_bus_price_calendarCheapest bus seat per day
mb_bus_seatsSeat map: free seats, seats sold to women and men, row layout with the aisle
mb_search_taxisPrivate door-to-door intercity taxis, price per car, by class and pick-up slot
🏨 Hotels (5)
ToolWhat it does
mb_search_hotelsAvailable hotels in a city for dates with the cheapest stay price; stars, type, price and refund filters
mb_hotelOne hotel: rating, latest reviews with per-criterion scores, location, landmarks, rules, amenities
mb_hotel_roomsEvery room with its exact price for the dates, per night, rooms left, meals
mb_hotel_calendarCheapest one-night price per night, up to ~48 nights ahead
mb_city_hotelsEvery hotel of a city, sold out ones included, filtered by stars, type or name (no prices)
📢 Notices and help (3)
ToolWhat it does
mb_noticesNotices MrBilit shows right now for a service or route
mb_helpSearch the official rules, FAQ and help-center guides (refunds, baggage, auto-reserve, ...)
mb_travel_guideRoute or city guide (summary, FAQ, article) and travel-magazine posts

All 22 tools are annotated readOnlyHint: true and return compact structured JSON, so they don't flood the agent's context.

Good to know

  • Prices are in Toman in every tool (the API sends Rial; values are divided by 10), always in fields named *_toman. Flight price_toman is per adult and total_toman the whole party; trains per adult; buses per seat; taxis per car; hotels the whole stay for one room.
  • Dates in and out are Gregorian YYYY-MM-DD; past dates are rejected. Times are local to the place: a flight time at a foreign airport is that airport's local time, although the API puts +03:30 on every flight time.
  • Ratings are 0–5; null means not rated. The site shows hotel ratings ×2 out of 10.
  • Ids expire: flight_id, class_id and bus_id come from a fresh search.
  • Sales windows: trains open about 18 days ahead, buses about a month. An empty result often just means "not on sale yet".
  • Round trips: domestic flights are two separate tickets (two lists); international round trips are priced as one package.
  • Hotel prices do not depend on the guest count: pick rooms whose sleeps fits, and add rooms up for a group.
  • Domestic airports and train stations come from the site's own bundled lists, fetched once per run with a copy shipped in the package as a fallback.

FAQ

Do I need a proxy?

Usually not: direct calls from an Iranian connection work. If your network cannot reach MrBilit's API servers (connections time out or are reset), set MRBILIT_MCP_PROXY to an HTTP proxy that can reach them. System proxy variables (HTTPS_PROXY, ...) are ignored on purpose.

Can it book a ticket for me?

No, and that's deliberate. It has no login and never holds a seat, reserves, orders or pays. The agent finds the best option; you book on mrbilit.com.

I get "did not answer in time" or "Could not reach"

The server retries a reset connection once. If it keeps failing, set MRBILIT_MCP_PROXY (see above). The one-change trip search (mb_alternative_routes) is known to hang now and then; it is retried and its other parts are still returned.

Why does a sold-out train class still have a price in mb_train_price?

The pricing endpoint prices any class; availability comes from mb_search_trains (seats_left, bookable).

Claude Desktop says uvx is not found

Use the full path to uvx (where uvx on Windows, which uvx on macOS/Linux) as command.

How do I debug what the agent sees?
bash
npx @modelcontextprotocol/inspector uvx mrbilit-mcp

Configuration

VariableDefaultMeaning
MRBILIT_MCP_PROXYunsetHTTP proxy for every request, e.g. http://user:pass@host:port. Usually not needed in Iran

Safety

  • Read-only: no login or OTP, no seat hold, reservation, order, payment, wallet, price alert or review posting. The only POSTs are searches and price lookups the site itself makes before booking.
  • Admin fields (created_by, updated_by) of the content CMS are never passed through.
  • Always sends a browser User-Agent and at most two requests at a time, since the API hosts share one server.

فارسی

mrbilit-mcp به دستیار هوش مصنوعی شما (Claude، Cursor، Copilot و ...) اجازه می‌دهد در مستربلیط ارزان‌ترین پرواز، قطار، اتوبوس یا تاکسی دربستی را برای یک روز یا یک ماه پیدا کند، صندلی‌های خالی، بار مجاز و قوانین استرداد را ببیند و هتل‌ها را با قیمت دقیق اتاق و نظرات مسافران مقایسه کند.

  • فقط خواندنی است: وارد حساب نمی‌شود و صندلی رزرو یا بلیط صادر نمی‌کند.
  • همه قیمت‌ها به تومان است.
  • روی سیستم خود شما اجرا می‌شود و به هیچ سرور واسطی داده نمی‌فرستد.
  • در ایران معمولاً نیازی به پروکسی نیست؛ اگر سرورهای مستربلیط پاسخ ندادند، MRBILIT_MCP_PROXY را تنظیم کنید.

نصب در Claude Code:

bash
claude mcp add mrbilit -- uvx mrbilit-mcp

بعد بپرسید: «ارزان‌ترین راه رفتن از تهران به مشهد در ۲۸ مهر چیست؟»

Development

bash
git clone https://github.com/sepehr071/mrbilit-mcp && cd mrbilit-mcpuv syncuv run pytest            # offline, against recorded responsesuv run pytest -m live    # real API (set MRBILIT_MCP_PROXY if needed)uv run ruff check .

Tools live in src/mrbilit_mcp/places.py, flights.py, trains.py, buses.py, hotels.py and content.py; each is a typed async function with a docstring that tells the agent when to use it. Issues and PRs are welcome, especially new tools and fixes for API changes.

Releases: bump the version in pyproject.toml and server.json, then push a v* tag. GitHub Actions tests, publishes to PyPI and the MCP Registry, and creates the GitHub Release.

Disclaimer

Unofficial and not affiliated with or endorsed by MrBilit. It uses the public endpoints of the mrbilit.com website, which can change without notice. Please keep request rates reasonable.

License

MIT

来源:README.md,提交 741a226

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v0.1.1最新Oct 5, 2026