Chelaile MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Chelaile MCP 71路还有多久到站?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
车来了 MCP
一个基于 MCP 的车来了实时公交服务器,让大语言模型可以查询国内的公交、地铁实时数据 —— 包括线路时刻表、车辆实时位置、附近站点、关键词搜索、以及公交+地铁的换乘路线规划。
回答 "我的公交还有多久到站" 这类问题。无需登录、无需任何账号配置,开箱即用。
Fork 说明 本仓库 fork 自 PeanutSplash/chelaile-mcp(MIT), 修复了
bus_get_timetable在服务日尾部查不到班次的问题,并新增at_time参数。 完整改动见 CHANGELOG_FORK.md,差异概览见下文。 上游版本仍发布在 npm 上(chelaile-mcp-server),本 fork 未发布到 npm。
目录
Related MCP server: chelaile-api-server
特性
15 个工具覆盖城市、线路、站点、实时车辆、时刻表、换乘规划全链路
两种输出格式:每个工具都支持
response_format: "markdown" | "json",JSON 模式同时附带structuredContent供程序化消费坐标系统明确:WGS-84 与 GCJ-02 在工具描述中逐个标注,避免坐标混用
发车预测含末班车:回落到前两个服务日的实际班次,回答不再随查询时刻漂移
无需账号:直接复用车来了的公开接口,无 API Key、无登录态
纯 TypeScript:零运行时依赖(除 MCP SDK 与 zod),
tsc编译即可
安装
本 fork 未发布到 npm,直接从 GitHub 构建:
git clone https://github.com/misakacloud/chelaile-mcp.git
cd chelaile-mcp
bun install
npm run build然后在 MCP 客户端里指向 dist/index.js 的绝对路径:
{
"mcpServers": {
"chelaile": {
"command": "node",
"args": ["/absolute/path/to/chelaile-mcp/dist/index.js"]
}
}
}Claude Code 等价写法:
claude mcp add chelaile -- node /absolute/path/to/chelaile-mcp/dist/index.js也可以先 npm link,之后直接 chelaile-mcp 启动。
重启客户端后,工具会以 chelaile 为前缀出现。
Docker
docker build -t chelaile-mcp .
docker run -i --rm chelaile-mcp镜像以 stdio 方式运行,直接挂到 MCP 客户端上即可。
工具一览
工具 | 用途 |
| 列出支持的城市及其 ID |
| 某城市的刷新间隔限制与展示策略 |
| 基于调用方 IP 估算位置(精度到城市级) |
| WGS-84 经纬度 → 中文地址 |
| 按关键词混合搜索:线路 + 站点 + POI |
| 按某一分类分页"查看更多" |
| 某 GPS 坐标附近的站点及到站预计时间 |
| 某站点经过的所有线路 + 附近的地铁 |
| 某线路的完整站点列表 + 当前车辆 |
| 某线路的地图轨迹坐标 |
| 某线路即将到达某站点的车辆实时信息 |
| 某线路上所有车辆的位置与载客率 |
| 首站发车预测(含末班车,支持 |
| 一次性批量刷新多个 (线路, 站点) 对 |
| 两个 GCJ-02 坐标之间的公交+地铁换乘规划 |
每个工具都支持 response_format: "markdown" | "json"(默认 markdown),返回 JSON 时同时附带 structuredContent。
典型用法
用户:71 路还有多久到站?
→ bus_search { city_id, keyword: "71路" } # 拿到 lineId 与方向
→ bus_get_nearby_stops { lat, lng } # 找到附近该线路的站点
→ bus_get_line_realtime { line_id, station_id } # 该站点的实时车辆 ETA用户:明天早上 7 点后下一班从始发站几点发?
→ bus_get_timetable { city_id, line_id, line_no, direction, at_time: "07:00" }发车预测说明(本 fork 的改动)
bus_get_timetable 回答「始发站下一班几点发车」。
上游 bus/line!preStartTimetableNew.action 有两个坑,原版都没处理:
传入
tabType=0会让上游只返回当天预测,屏蔽另外两份完整数据。当天预测只覆盖未来约 1.5–2 小时的滚动窗口,服务日尾部(如 21:00 末班)永远不在其中。
实测同一线路不同时刻的窗口末端:
查询时刻 | 当天预测班数 | 当天预测末班 | 官方末班 |
16:02 | 31 | 17:35 | 21:00 |
18:10 | 35 | 20:00 | 21:00 |
窗口随当前时间前移,所以「19:10 之后下一班」在下午查不到、在傍晚查得到 —— 但回答必须一致,不能取决于查询时刻。
本 fork 的处理:
不再传
tabType—— 上游因此额外返回yesterdayTimetable/beforeYesterdayTimetable,即前两个服务日的完整实际班次(到 21:00)。解析上游嵌套结构
timetable.timetable[](原版用Array.isArray判断,恒为null)。新增
at_time参数,按「指定时刻之后的第一班」计算nextDeparture; 当天预测够不到时自动回落到昨日实际班次,nextDepartureSource标明数据来源。
示例
// bus_get_timetable { city_id: "<cityId>", line_id: "<lineId>", line_no: "<lineNo>",
// direction: "1", at_time: "19:10" }
{
"nextDeparture": "20:00",
"nextDepartureSource": "yesterday-actual", // 或 today-prediction,见下表
"lastPredictedDeparture": "20:00",
"yesterdayDepartures": ["06:30", "...", "19:10", "20:00", "21:00"],
"segments": [{ "fromTime": "06:30", "toTime": "10:00", "intervalMin": 18 }]
}「19:10 之后第一班 = 20:00」这个结论稳定,只有来源标签随查询时刻变化 (当天预测是滚动窗口,覆盖到哪算到哪):
查询时刻 | 当天预测末班 |
|
|
16:02 | 17:35 | 20:00 |
|
18:10 | 20:00 | 20:00 |
|
at_time 超出所有数据覆盖范围时返回 null 而非猜一个值:
|
|
|
|
|
|
|
|
不传 at_time 时按当前北京时间取下一班。
配置
无需任何环境变量或配置文件。所有工具的参数都通过 MCP 调用传入。
唯一的外部依赖是上游接口的车来了签名参数,它们固化在 src/constants.ts 中。
上游接口并非公开 API,可能随时变更或失效;出现大面积 status:400 通常意味着上游调整了签名算法,需要同步上游仓库的最新实现。
开发
bun install
npm run build # tsc 编译到 dist/
bun test tests/unit # 单元测试(171 个,不联网)
npm run dev # tsx watch 调试端到端测试会真实请求上游接口,默认跳过:
CHELAILE_E2E=1 bun test tests/e2e # 15 个用例,检测上游 schema 漂移用 MCP Inspector 交互式调试:
npm run inspect项目结构
src/
index.ts # MCP server 入口,注册全部工具
constants.ts # 上游签名、请求头、超时
http-client.ts # 签名、加密信封解密、gzip/br 解压、请求封装
format.ts # 输出格式化、截断、坐标取整、距离清洗
types.ts # 上游响应与精简响应的类型定义
tools/
city.ts # 城市列表与城市配置
geo.ts # IP 定位、逆地理编码
search.ts # 关键词搜索、分类分页
stops.ts # 附近站点、站点详情
lines.ts # 线路详情、实时车辆、轨迹、时刻表、批量刷新
transit.ts # 公交+地铁换乘规划
tests/
unit/ # 171 个单元测试,纯离线
e2e/ # 15 个真实上游契约测试,需 CHELAILE_E2E=1提交规范
项目使用 Conventional Commits,由 release-it + conventional-changelog 生成 changelog:
feat(timetable): add at_time argument
fix(timetable): fall back to yesterday's schedule
docs(readme): clarify coordinate systems贡献
欢迎参与改进。
提交 PR —— 请先阅读 CONTRIBUTING.md,其中说明了开发环境、 提交规范,以及「上游是唯一事实来源」「WGS-84 / GCJ-02 坐标约定」等必须遵守的约定。
报告 Bug —— 请使用 Bug 报告模板。 提交前请把真实坐标、IP、住址替换成大致位置。
上游接口变更 —— 车来了接口不是公开 API,随时可能变动。 若所有工具同时大面积返回
status:400,请用 上游接口变更模板 反馈。报告安全漏洞 —— 不要开公开 Issue,请按 SECURITY.md 的流程私下提交。
致谢
上游作者 PeanutSplash —— 原始实现与全部工具,本 fork 基于其
2ba26c3Model Context Protocol —— MCP 协议与 TypeScript SDK
车来了 —— 数据来源
免责声明
本项目为非官方的第三方工具,与车来了官方无任何隶属关系。
数据全部来自车来了的公开接口,其准确性、时效性、可用性由上游负责,本项目不作任何保证。
本项目仅作技术研究与个人学习用途。请遵守上游服务的使用条款,不要用于高频调用或商业用途。
换乘规划结果仅供参考,出行请以现场实际运营为准。
使用者需自行确保其使用行为符合当地法律法规。
License
Available Tools
15 toolsbus_get_city_configGet city operating configARead-onlyIdempotent
Get a city's runtime config: max poll interval and "arriving" time threshold.
This is mostly relevant if you are deciding how aggressively to refresh — not for end-user questions about lines or stops.
Args:
city_id (string, required): e.g. '034' (Shanghai), '027' (Beijing)
response_format ('markdown' | 'json')
Returns (json): { "maxInterval": 30, "arrivingStationLimitSeconds": 180, "busDisplayConfig": { "lineDetail": "time#order#distance", "other": "time#order" } }
Inputs: city_id (required), response_format.
bus_get_line_detailGet full line detail (stops + live buses)ARead-onlyIdempotent
Full info for a line: rider-facing fields (name, first/last/price, stationsNum), the full ordered station list, the reverse-direction lineId, and every bus currently on the line.
Use this — not bus_get_timetable — to answer "is line X still running" or "first/last bus time" questions. The timetable tool only has data for a small minority of lines.
Subway lines are NOT supported. If bus_search returned a line with isSubway=true (e.g. lineId=1057 for 地铁2号线), this endpoint returns an empty payload — the response will carry empty: true and a hint field pointing at bus_get_nearby_stops / bus_plan_transit. Don't retry; route to those tools instead.
Args:
city_id (string, required)
line_id (string, required): from bus_search.lines[*].lineId
lat / lng (string, optional): caller's WGS-84 coordinates
response_format ('markdown' | 'json')
Returns (json): { "line": { "lineId":"...", "name":"71", "lineNo":"r95817", "direction":0, "startSn":"...", "endSn":"...", "firstTime":"05:30", "lastTime":"23:30", "price":"2元", "stationsNum":24 }, "stations": [{ "order":1, "sId":"...", "sn":"...", "wgsLat":..., "wgsLng":..., "physicalStId":"...", "namesakeStId":"...", "metros":[{"name":"地铁14号线","lineNo":"14号线","color":"97,96,32"}] }, ...], "buses": [{ "busId":"...", "order":2, "lat":..., "lng":..., "speed":5.7, "capacity":0, "distanceToWaitStn":...}], "reverseDirection": { "lineId":"...", "startSn":"...", "endSn":"...", "firstTime":"04:30", "lastTime":"22:30", "price":"2元" } | null, "depDesc": "...", "preArrivalTime": "...", "targetOrder": 24, "empty": true, "hint": "..." // present only when upstream returned no data (subway / retired line) }
Each station carries:
'order' → feed into bus_get_line_realtime / bus_list_line_buses as target_order
'sId' → feed into bus_get_line_realtime as station_id (NOT into bus_get_stop_detail!)
'physicalStId' + 'namesakeStId' → feed into bus_get_stop_detail to see every line through that stop
Inputs: city_id (required), line_id (required), lat, lng, +1 more.
bus_get_line_realtimeGet realtime buses for a (line, stop) pairARead-onlyIdempotent
Canonical "when will my bus arrive" tool. Returns every bus currently on the line, with the nearest one carrying an ETA to the waiting stop.
Important: the upstream predicts an ETA for only the nearest bus heading to your stop. Buses farther up the route are returned (with position/speed/capacity) but their eta field is null. That's not a bug.
Args:
city_id (string, required)
line_id (string, required): from bus_search
target_order (string, required): the waiting stop's order on the line. Source: bus_get_line_detail.stations[i].order, or bus_get_nearby_stops.stops[].lines[].targetOrder.
station_id (string, required): sId of the waiting stop
lat / lng (string, required): WGS-84 — the user's location is best; if unavailable, use the waiting stop's wgsLat/wgsLng (from line_detail.stations[i]).
response_format ('markdown' | 'json')
Returns (json): { "line": { "lineId":"...", "name":"71", "direction":0, "endSn":"..." }, "targetOrder": 2, "realData": true, "buses": [ { "busId":"...", "licence":"...", "order":2, "lat":..., "lng":..., "speed":5.7, "capacity":0, "distanceToWaitStn":90, "eta":{"travelTime":25,"arrivalTime":1779070466055,"displayTime":"10:14"} }, { "busId":"...", "order":3, "lat":..., "lng":..., "speed":3, "capacity":0, "eta":null }, ... ], "note": "..." }
Field notes:
The 'line' sub-object intentionally omits startSn — upstream does not return it on this endpoint. Read it from bus_get_line_detail if needed.
eta.travelTime is seconds remaining
eta.arrivalTime is a ms timestamp
eta.displayTime is a "HH:MM" hint from upstream
capacity: 0=light, 1=moderate, 2=crowded
Inputs: lat (required), lng (required), city_id (required), line_id (required), +3 more.
bus_get_line_routeGet line polyline coordinatesARead-onlyIdempotent
Polyline coordinates for drawing a line on a map. Points with 'stopOrder' are actual stops; others are shape points between stops.
Args:
city_id (string, required)
line_id (string, required)
include_shape (boolean, default false): false returns only stop markers (~25 points); true returns all shape points (~400-500). Skip unless you actually need to draw the line.
response_format ('markdown' | 'json')
Returns (json): { "pointCount": 480, // total shape points upstream returned "stopCount": 23, // stop markers among them "points": [{ "lat":..., "lng":..., "stopOrder":1 }, ...] } 'points' is the filtered list — stops only by default, full polyline when include_shape=true.
Known caveat: upstream sometimes omits the terminus stop from the polyline, so 'stopCount' may be one less than bus_get_line_detail's 'stationsNum' (e.g. 23 vs 24). Trust bus_get_line_detail for the authoritative station list; line_route is just for drawing.
Markdown mode only summarises counts; request JSON to read coordinates.
Inputs: city_id (required), line_id (required), include_shape, response_format.
bus_get_my_locationGet the caller's approximate location via IPARead-onlyIdempotent
Resolve the caller's approximate location from their public IP — useful when the user asks something like "what's near me" without providing coordinates.
Precision is city-level (typically a few kilometres). Good enough to identify the city and seed bus_get_nearby_stops with a starting guess. NOT precise enough to find the user's actual bus stop — for that, ask for a landmark/address and resolve it via bus_search.
Caveats:
Resolves via ip-api.com (free tier; rate-limited but no auth).
VPN / corporate proxy → result reflects the proxy exit IP, not the user.
Cellular IPs often land on a provincial centroid.
Args:
ip (string, optional): a specific IPv4/IPv6 to look up. Omit to use the mcp server process's own outbound IP (= the caller's machine when running locally).
response_format ('markdown' | 'json')
Returns (json): { "lat": 31.2222, "lng": 121.4581, "gpsType": "wgs", "city": "上海", "region": "上海市", "country": "中国", "ip": "116.236.0.1", "isp": "China Telecom", "precision": "city-level (~10 km); not suitable for stop-level queries" }
Suggested workflow:
Call this tool to identify the user's city (match 'city' field against bus_list_cities to get a cityId).
Pass lat/lng into bus_get_nearby_stops for a rough nearby list, OR ask the user to confirm a landmark and use bus_search.pois for sharper coordinates.
Inputs: ip, response_format.
bus_get_nearby_stopsGet nearby bus stopsARead-onlyIdempotent
List bus stops near a WGS-84 GPS coordinate, each annotated with the lines that pass through and the realtime buses approaching.
If you don't have coordinates: call bus_get_my_location first (city-level precision via IP), or ask the user for a landmark and resolve it via bus_search.pois — the resulting lat/lng goes into this tool's lat/lng args.
Args:
city_id (string, required): e.g. '034'
lat / lng (string, required): WGS-84 decimal coordinates
limit (number, default 5): how many of the closest stops to return (max 20)
response_format ('markdown' | 'json')
Returns (json): { "stops": [ { "sId": "021-15232", "sn": "西藏中路", "distance": 87, "isSubway": false, "physicalStId": "...", "namesakeStId": "...", "firstLineId": "...", "lines": [ { "lineId": "...", "name": "71", "direction": 0, "endSn": "...", "status": "等待发车" | "不在运营时间" | "" (running), "preArrivalTime": "10:10" | undefined, "targetOrder": 2, "targetStationId": "021-15232", "buses": [ { "busId": "...", "order": 2, "arrivalTime": 1779070466055, "travelTime": 25, "distanceToDest": 90, "capacity": 0 } ] } ], "subwayLines": [ { "name": "地铁2号线", "shortName": "2号线", "color": "140,194,32", "directions": [{ "destName": "...", "firstTime": "05:31", "lastTime": "23:24" }] } ] } ] }
Field notes:
buses[].arrivalTime is a ms timestamp; -1 = unknown
buses[].travelTime is seconds remaining; -1 = unknown
buses[].capacity: 0=light, 1=moderate, 2=crowded
If no realtime buses but the line is starting soon, 'preArrivalTime' will hold the next predicted dispatch ("10:12")
Inputs: lat (required), lng (required), city_id (required), limit, +1 more.
bus_get_stop_detailGet stop detail with all linesARead-onlyIdempotent
Full detail for a stop: precise WGS-84 coordinates, every line that passes through (with first/last/price), realtime buses, and nearby metro lines.
Args:
city_id (string, required)
physical_st_id (string, required): from bus_get_nearby_stops / bus_search
namesake_st_id (string, optional): recommended; from the same source
first_line_id (string, optional): a line to highlight
lat / lng (string, optional): caller's WGS-84 location, used to populate 'distance'
response_format ('markdown' | 'json')
Returns (json): { "stations": [ { "sId": "...", "sn": "...", "lat": ..., "lng": ..., "distance": ..., "lines": [{ "lineId": "...", "name": "71", "direction": 0, "startSn": "...", "endSn": "...", "firstTime": "05:30", "lastTime": "23:30", "price": "2元", "targetOrder": 2, "buses": [...] }], "metros": [{ "name": "地铁14号线", "lineNo": "14号线", "color": "97,96,32" }] } ] }
Multiple entries in stations[] mean the stop name maps to several physical platforms.
Inputs: city_id (required), physical_st_id (required), lat, lng, +3 more.
bus_get_timetableGet first-stop departure predictions (incl. late-evening trips)ARead-onlyIdempotent
Per-trip departures from the line's FIRST stop — answers "when does the next bus leave the origin terminal".
Today's predicted departures are a rolling window covering only roughly the next two hours, so the last trip of the service day is never included. This tool therefore also returns yesterdayDepartures / dayBeforeDepartures, the previous two service days' complete actual schedules, and resolves nextDeparture against them so late-evening queries still get an answer.
Pass at_time ("HH:MM", Beijing time) to ask "what is the next departure after 19:10" instead of using the current clock.
Args:
city_id (string, required)
line_id (string, required)
line_no (string, required): rider-facing short name from bus_search.lines[].name (e.g. '71'). NOT the internal lineNo like 'r95817'.
direction ('0'|'1'): the line direction
at_time ('HH:MM', optional): reference clock; defaults to now in Asia/Shanghai
response_format ('markdown' | 'json')
Returns (json): { "line": { "lineId":"...", "name":"71", "direction":1, "startSn":"...", "endSn":"..." }, "mode": "scheduled", "nextDeparture": "20:00", "nextDepartureSource": "yesterday-actual", "lastPredictedDeparture": "20:00", "firstStopDepartures": ["06:30", "06:45", "..."], "segments": [{ "fromTime":"06:30", "toTime":"10:00", "intervalMin":18, "departures":[...] }, ...], "yesterdayDepartures": ["06:30", ..., "21:00"], "dayBeforeDepartures": ["06:30", ..., "20:59"], "depTitle": "首站发车预测" }
Some lines run at a fixed headway with no per-trip data (mode='interval'); for those use bus_get_line_detail to read firstTime/lastTime.
Inputs: city_id (required), line_id (required), line_no (required), direction (required), +2 more.
bus_list_citiesList supported citiesARead-onlyIdempotent
List cities supported by the realtime bus data service.
Args:
hot_only (boolean, default true): return only the upstream's curated 'hot' set (~20 cities). Set false to dump the full ~480-city list (token-heavy, use sparingly).
response_format ('markdown' | 'json'): defaults to 'markdown'
Returns (json): { "cities": [ { "cityId": "034", "cityName": "上海", "pinyin": "ShangHai", "supportSubway": true, "hot": true }, ... ] }
Use when: the user mentions a city name and you don't have its ID. The hot set covers the top-tier cities the user almost certainly means.
Inputs: hot_only, response_format.
bus_list_line_busesGet the nearest approaching bus on a lineARead-onlyIdempotent
Returns the nearest bus heading to the anchor stop, with ETA and the bus's next stop name.
This is narrower than the name suggests. Despite the upstream endpoint being called "busList", in practice it returns at most 1-2 buses (the imminent ones). For the FULL roster of every bus currently on the line, call bus_get_line_detail — its 'buses' array lists all live vehicles with positions.
Use this tool when you want a quick "what's about to arrive" answer for a specific stop.
Args:
city_id (string, required)
line_id (string, required)
target_order (string, required): the waiting stop's order on the line
station_name (string, required): display name of that anchor stop
response_format ('markdown' | 'json')
Returns (json): { "targetOrder": 2, "buses": [ { "busId":"...", "licence":"...", "order":2, "lat":..., "lng":..., "speed":8.2, "capacity":0, "nextStop":"西藏中路", "eta":{"travelTime":214,"arrivalTime":..., "displayTime":"10:14"} } ] }
Inputs: city_id (required), line_id (required), station_name (required), target_order (required), +1 more.
bus_plan_transitPlan a public-transit routeARead-onlyIdempotent
Plan a public-transit (bus + metro) route between two points. Returns alternative plans sorted by recommendation, each broken into walking and ride segments.
Coordinate system: this tool expects GCJ-02. The easiest source is bus_search.pois[*].lat/lng — those are already GCJ-02 and carry a name. If you only have WGS-84 (e.g. from a phone GPS), convert it before calling.
Args:
city_id (string, required)
origin_name, origin_lat, origin_lng (string, required): origin in GCJ-02
dest_name, dest_lat, dest_lng (string, required): destination in GCJ-02
strategy ('0'|'1'|'2'|'3'): 0=recommended (default; surfaces metro), 1=fewest transfers, 2=least walking, 3=shortest time (BUS-ONLY — upstream often drops metro plans here, so for general "fastest route" questions use 0)
response_format ('markdown' | 'json')
Returns (json): { "origin": "lng,lat", "destination": "lng,lat", "distance": 17982, "plans": [ { "duration": 3056, "walkingDistance": 1466, "distance": 19086, "tag": "直达", "transitCount": 1, "segments": [ { "type": "walking", "distance": 837, "duration": 717 }, { "type": "bus", "name": "地铁2号线", "lineType": 1, "departureStop": "人民广场", "arrivalStop": "虹桥2号航站楼", "viaStops": 8, "duration": 1800, "distance": 17620, "startTime": "05:37", "endTime": "23:30" } ] } ] } lineType: 0=bus, 1=metro. Durations in seconds, distances in meters.
A top-level 'note' field is emitted when the response shape is suspicious — e.g. strategy=3 returned no metro plans despite this being a likely metro trip.
Inputs: city_id (required), dest_lat (required), dest_lng (required), dest_name (required), +5 more.
bus_refresh_linesBatch refresh realtime info for multiple (line, stop) pairsARead-onlyIdempotent
Refresh realtime bus info for several (line, stop) pairs in one round-trip. Useful for a 'favourites' dashboard.
Args:
city_id (string, required)
line_stn (string, required): semicolon-separated quadruples Format: lineId,stopId,nextId,targetOrder;lineId,stopId,nextId,targetOrder;... 'nextId' may be empty between the two commas.
response_format ('markdown' | 'json')
Example: '21283603183,021-15232,,2;21283604388,021-8685,,4'
Returns (json): { "lines": [ { "line": { "lineId":"...", "name":"71", "direction":0, "endSn":"..." }, "depDesc": "...", "buses": [ { "busId":"...", "order":2, "capacity":0, "distanceToDest":881, "eta":{"travelTime":221,"arrivalTime":...} } ] } ] }
Soft cap: up to 10 quadruples per call.
Inputs: city_id (required), line_stn (required), response_format.
bus_reverse_geocodeReverse geocode GPS to addressARead-onlyIdempotent
Convert WGS-84 lat/lng to a Chinese postal address (province, city, district, township, formatted address).
Useful when you have raw GPS coordinates and need a human-readable place name, or the citycode/adcode to pass to other tools.
Args:
lat (string, required): WGS-84 latitude, decimal, e.g. '31.230416'
lng (string, required): WGS-84 longitude, decimal, e.g. '121.473701'
response_format ('markdown' | 'json')
Returns (json): { "formatted": "上海市黄浦区...", "province": "上海市", "city": "上海市", "district": "黄浦区", "township": "南京东路街道", "citycode": "021", "adcode": "310101" }
For municipalities (Shanghai/Beijing/Tianjin/Chongqing) the upstream emits an empty 'city' value; this tool back-fills it with 'province' so the field is always a usable string.
Inputs: lat (required), lng (required), response_format.
bus_searchSearch lines, stations, and POIsARead-onlyIdempotent
Search inside a city by keyword. Returns matching lines, stations, and POIs in one call.
Use this as the primary entry point when the user gives a line number, station name, or destination name without IDs.
Keyword tip: plain "71", "71路", "地铁2号线", "陆家嘴" all work — the upstream is reasonably forgiving. If a short numeric returns empty, try appending "路".
Coordinate systems:
'pois' coords are GCJ-02 (use directly with bus_plan_transit)
'stations' coords are WGS-84 (use with bus_get_nearby_stops / bus_get_line_realtime) Both are also marked with a 'gpsType' field.
Args:
city_id (string, required): e.g. '034'
keyword (string, required)
response_format ('markdown' | 'json')
Returns (json): { "highlightKey": "71路", "lines": [ { "name": "71", "lineNo": "r95817", "isSubway": false, "directions": [ { "direction": 0, "lineId": "21283603183", "startSn": "延安东路外滩", "endSn": "申昆路枢纽站" }, { "direction": 1, "lineId": "21283603182", "startSn": "申昆路枢纽站", "endSn": "延安东路外滩" } ], // Compat top-level fields mirror directions[0] (or first available). "lineId": "21283603183", "direction": 0, "startSn": "延安东路外滩", "endSn": "申昆路枢纽站" }, ... ], "stations": [{ "sId":"...", "sn":"西藏中路", "lat":31.231006, "lng":121.474316, "gpsType":"wgs", "physicalStId":"...", "namesakeStId":"...", "isSubway":false }, ...], "pois": [{ "name":"71路", "address":"...", "tag":"公交线路", "district":"黄浦区", "lat":31.233021, "lng":121.49073, "gpsType":"gcj" }, ...] }
Line folding: each entry in 'lines' is one logical line (e.g. "71路"). The two travel directions live in 'directions[]'. Pick the lineId matching your desired direction.
Subway hint: when 'isSubway' is true, the entry carries a 'hint' field — bus_get_line_detail will return empty for these lineIds. Use bus_get_stop_detail (metros field) or bus_plan_transit instead.
Follow-ups:
directions[i].lineId → bus_get_line_detail (full stop list, first/last/price) — non-subway only
stations[*].physicalStId + namesakeStId → bus_get_stop_detail (NOTE: a few stations lack physicalStId — typically metro-only entries with subwayV2=1. For those, use bus_get_nearby_stops to resolve the bus platform IDs nearby.)
pois[*].lat/lng (GCJ) → bus_plan_transit as origin/destination
Inputs: city_id (required), keyword (required), response_format.
bus_search_moreSearch more results of one categoryARead-onlyIdempotent
Paginated 'see more' for one category from bus_search.
Args:
city_id (string, required)
keyword (string, required): same keyword used in bus_search
type ('1'|'2'|'3'): 1=more lines, 2=more stations, 3=more POIs (default '1')
response_format ('markdown' | 'json')
Returns: same shape as bus_search but only the requested category is populated.
Inputs: city_id (required), keyword (required), type, response_format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Most tools target a clearly distinct resource+action (city, search, stop, line, route, timetable, plan), and the descriptions actively cross-reference each other with explicit warnings about where NOT to use a tool. The one real overlap is bus_get_line_realtime vs bus_list_line_buses, which take nearly the same arguments and both return the imminent bus's ETA; the list_line_buses description admits it is 'narrower than the name suggests' and redirects to bus_get_line_detail, which mitigates but does not eliminate the confusion.
Every tool is snake_case with a uniform bus_ prefix and an almost uniform verb_noun shape (get_line_detail, list_cities, plan_transit, refresh_lines). The only deviations are bus_search and bus_search_more, which carry no noun, but they are still readable and predictable.
15 tools is at the upper edge of comfortable but each maps to a distinct transit task (discovery, search, stop/line detail, realtime, timetable, routing, batching). A couple are marginal — bus_get_city_config is an internal tuning knob, and bus_list_line_buses largely duplicates bus_get_line_realtime's output.
The surface covers the full rider lifecycle: locate city, search, inspect stops/lines, check realtime arrivals and terminal departures, batch refresh, and plan a bus+metro trip. The main gap is subway line detail, which is explicitly unsupported (empty payload) and must be worked around via plan_transit or nearby_stops metros; there is also no alert/notification or saved-favorites persistence.
Maintenance
Related MCP Connectors
Read-only public transit departures, stop search, and city coverage for bus and train users.
Provide real-time transportation data including bus arrivals, train service alerts, carpark availa…
660+ data tools for agents: TikTok, Douyin, Instagram, YouTube, X, weather, GitHub. Pay per call.
Mobility, geocoding and nearby urban services for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to access real-time public transport data for Moscow and the Moscow region, aggregating and reconciling information from multiple sources. Provides tools for finding stops, live arrival boards, vehicle tracking, route details, and ETA calculations.MIT
- AlicenseNot gradedqualityBmaintenanceEnables realtime bus arrival queries, route and stop searches, nearby station lookups, and transit planning for Chelaile-supported cities through MCP tools.11MIT

transcapi-mcpofficial
AlicenseAqualityBmaintenanceConnects AI assistants to live public transport data across Great Britain, enabling searches for stops and stations, real-time bus and rail departures, live vehicle positions, service disruptions, and door-to-door journey planning. All tools are read-only and require an API key.10MIT- AlicenseNot gradedqualityBmaintenanceEnables agents to query live public transport status, alerts, line maps and vehicle positions across worldwide networks through tools such as search, network_status, line_status, disruptions, airport and vehicles_near.MIT