Skip to main content
Glama
mzorz

bikerouter-mcp

by mzorz

bikerouter-mcp

一个 MCP 服务器,使用 bikerouter.de 规划自行车路线——bikerouter.de 是 Norbert Renner 基于 BRouter 引擎(作者 Arndt Brenschede)开发的 BRouter-Web 前端,在 OpenStreetMap 数据上进行路由。

将任何 MCP 客户端(Claude Code、Claude Desktop 等)指向它,然后提出类似 “沿莱茵河规划一条从科隆到波恩的砾石路线,并给我 GPX” 的请求。

它能做什么

工具

用途

plan_route

通过 2 个及以上途经点(坐标或地名)规划路线,并返回距离、爬升/下降、预计骑行时间、路面和道路类型细分、转弯指令、可分享的 bikerouter.de 链接,以及可选的保存 GPX/GeoJSON/KML/CSV 文件。

compare_profiles

使用多个配置文件(例如 trekking 对比 gravel 对比 fastbike)为相同途经点规划路线,并并排比较距离、时间、爬升和铺装路面占比。

geocode_place

将地名、地址或兴趣点转换为坐标(通过 Photon,即 bikerouter.de 使用的地理编码器)。

list_profiles

列出已知的路由配置文件,并可选择验证路由主机实际提供哪些配置文件。

get_profile_options

读取配置文件的 .brf 源码,并列出其暴露的参数(avoid_unsafeallow_ferriestotalMassbikerPower 等),供 plan_routeprofile_options 使用。

plan_route 输出示例:

**Route** (profile: `trekking`)
Alexanderplatz, Berlin → Brandenburger Tor, Berlin

- Distance: **5.2 km**
- Estimated riding time: **20 min** (⌀ 15.6 km/h, from the profile's physics model)
- Ascent: **80 m** / descent: **60 m**
- Elevation: 35–55 m (start 35 m, end 55 m)

- Surfaces: asphalt 76.9% (4 km), gravel 23.1% (1.2 km)
- Way types: cycleway 38.5% (2 km), residential 38.5% (2 km), track 23.1% (1.2 km)

Open in bikerouter.de: https://bikerouter.de/#map=14/52.518154/13.396327/standard&lonlats=…&profile=trekking

Related MCP server: Hiking MCP Server

安装

cd bikerouter-mcp
npm install     # also builds via the prepare script
npm test

使用 Claude Code 注册它:

claude mcp add bikerouter -- node /absolute/path/to/bikerouter-mcp/dist/index.js

或将其添加到 claude_desktop_config.json / 任何其他 MCP 客户端:

{
  "mcpServers": {
    "bikerouter": {
      "command": "node",
      "args": ["/absolute/path/to/bikerouter-mcp/dist/index.js"]
    }
  }
}

无需 API 密钥——该服务免费且无需身份验证。

配置

全部可选,通过环境变量设置:

变量

默认值

含义

BIKEROUTER_HOST

https://brouter.de

提供 BRouter /brouter 路由端点的主机。bikerouter.de 只是 Web 前端,在此处会返回 404,因此默认值为 brouter.de。将其指向 http://localhost:17777 以使用您自己的 BRouter 服务器。

BIKEROUTER_WEB_URL

https://bikerouter.de

用于可分享地图链接的 Web UI。

BIKEROUTER_PROFILES_URL

<host>/brouter/profiles2/,然后是 <host>/profiles/,然后是 <web>/profiles/

.brf 配置文件源码所在位置(供 get_profile_options 使用)。

BIKEROUTER_GEOCODER_URL

https://photon.komoot.io/api

兼容 Photon 的地理编码器。

BIKEROUTER_DEFAULT_PROFILE

trekking

当调用方未指定时使用的配置文件。

BIKEROUTER_TIMEOUT_MS

60000

HTTP 超时。长路线可能需要一些时间。

BIKEROUTER_USER_AGENT

bikerouter-mcp/0.1.0

随每个请求发送。

如何映射到 BRouter API

请求是普通的 GET /brouter 调用,与 BRouter 的 ServerHandler.java 中记录的完全一致:

/brouter?lonlats=lon,lat|lon,lat&nogos=lon,lat,radius,weight|…&profile=trekking
        &alternativeidx=0&format=geojson&timode=1&straight=0&profile:avoid_unsafe=true
  • waypointslonlats(先对地名进行地理编码,并偏向于上一个途经点)

  • avoid_areasnogos(省略 weight 表示硬性禁行区)

  • straight_fromstraight(直线路段)

  • profile_optionsprofile:NAME=VALUE

  • alternative_indexalternativeidx(1–3 表示备选路线)

  • turn_instructionstimode(GeoJSON 响应中的语音提示)

GeoJSON 响应在本地进行汇总:轨迹长度、filtered ascendtotal-timetotal-energy 来自轨迹属性,下降由过滤后的爬升和净高度变化推导得出,路面 / 道路类型 / 平整度细分则从 messages 表中聚合(WayTagsDistance 加权)。

值得了解的局限性

  • 路由质量即 OpenStreetMap 质量。 缺少路面或通行标签会产生奇怪的绕路;骑行前务必在返回的地图链接上检查路线是否合理。

  • BRouter 没有街道名称,因此转弯指令显示为“1.2 公里后右转”,没有道路名称。这是引擎本身的属性,而非此服务器的属性。

  • 预计骑行时间来自配置文件的物理模型(骑行者质量、功率、阻力)。通过 profile_options 覆盖 totalMassbikerPowermaxSpeed 以获得更实际的数值。

  • 海拔需要 SRTM 覆盖;在约 ~60°N/S 以上,轨迹返回时没有海拔数据,摘要中会说明这一点。

  • 公共服务是一个免费、社区运行的实例——请保持适度的请求量,或者运行您自己的 BRouter 服务器并设置 BIKEROUTER_HOST

  • 不同服务器的配置文件有所不同。list_profiles 附带一份标准 BRouter/BRouter-Web 配置文件目录;传入 verify: true 可检查给定主机实际提供哪些配置文件。

测试

npm test 构建服务器并运行 node --test

  • 针对 URL 构建、途经点验证、.brf 参数解析和 GeoJSON 汇总器的单元测试

  • 一个端到端测试,通过 stdio 与真实服务器二进制文件进行 MCP 通信,并针对一个桩 BRouter 主机,涵盖路由、GPX 导出、配置文件列表和 BRouter 的纯文本错误响应

测试从不访问公共服务,因此可以离线运行。

致谢与许可证

服务器代码:MIT。它仅是一个客户端——路由由 BRouter(MIT)通过 BRouter-Web / bikerouter.de 完成,地图数据 © OpenStreetMap 贡献者(ODbL)。

Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Routing, isochrones, matrix, snap, elevation, geocode via Openrouteservice.

  • Basque Country hyperlocal mobility: ES/EU semantic search, routing, open-data POIs, peak-bagging.

  • Geoapify MCP — wraps the Geoapify Location Platform (geoapify.com)

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mzorz/bikerouter-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server