摘要
通过 Trenitalia 的 Le Frecce 移动 API 搜索意大利高速和区域列车。按出发地/目的地/日期查找行程,读取优惠和价格,查看实时首页提醒和出行信息。3 个工具,无需认证:基于对 Le Frecce iOS 应用的逆向工程。
试试这样问
Trenitalia 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
仅限自托管。 Trenitalia 会拒绝来自数据中心 IP 地址的请求,而 AnythingMCP Cloud 运行在数据中心,因此该连接器无法在 AnythingMCP Cloud 上使用。它可以在你自己运行的 AnythingMCP 实例上工作,前提是该实例所在的电脑或服务器使用普通的家庭或办公网络。
Trenitalia + ChatGPT
通过 Trenitalia 的 Le Frecce 移动 API 搜索意大利高速和区域列车。按出发地/目的地/日期查找行程,读取优惠和价格,查看实时首页提醒和出行信息。3 个工具,无需认证:基于对 Le Frecce iOS 应用的逆向工程。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
(none — public API)
步骤 1 — 获取凭证
This connector wraps the Trenitalia Le Frecce mobile app's internal API (app.lefrecce.it, channel Channels.Mobile.BFF).
Setup: nothing. The endpoints exposed here are the same the Le Frecce iOS app uses for trip discovery.
What it does NOT do: complete bookings. The booking flow requires a logged-in session and the Trenitalia payment hub. Use this connector to find trains and prices; book in the Le Frecce app or trenitalia.com.
…(continued in the in-app connector instructions)
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
- 打开
http://localhost:3000并注册。第一个账户会成为管理员。 - 打开连接器商店(
http://localhost:3000/connectors/store),选择 Trenitalia,填写它要求的凭证(有些连接器不需要),然后安装。 - 在 MCP Servers 中创建一个服务器,并把 Trenitalia 连接器分配给它。在该服务器的页面上复制 MCP endpoint(
http://localhost:4000/mcp/<server-id>),并在 API keys 下生成一个密钥。
快速启动只监听 localhost。如果需要一个其他人或云端 AI 客户端也能访问的实例,请克隆仓库并运行 ./setup.sh,它会配置域名、HTTPS 和 OAuth(部署指南)。
步骤 3 — 在 ChatGPT 中添加连接器
ChatGPT 从 OpenAI 的云端连接 MCP 服务器,因此无法访问快速启动的 localhost endpoint。你需要一个具有公网 HTTPS 地址的 AnythingMCP 实例(见上文的 ./setup.sh),并且它所在的网络要被 Trenitalia 接受;在下面的步骤中填入该实例的 MCP endpoint,而不是 Cloud 地址。
ChatGPT 通过开发者模式(Developer mode)将 MCP 服务器作为自定义应用接入,仅付费套餐可用,免费套餐不可用。在 Business 和 Enterprise 工作区中,可能需要管理员先开启。
- 在 ChatGPT 中打开 Settings → Security and login,开启 Developer mode。
- 前往 chatgpt.com/plugins,点击 +。
- 填写名称和简短描述,例如 Name:
Trenitalia。 - 在 Connection 下填入 MCP 服务器 URL
https://<your-anythingmcp-domain>/mcp/<server-id>,然后创建连接。 - ChatGPT 提示时,登录 AnythingMCP(OAuth)并允许访问。
如果无法提供公网实例,请改用在你电脑上运行的客户端:Claude Code、Cursor 或 Gemini CLI 可以直接访问 localhost。
可用工具
| Tool | What it does |
|---|---|
trenitalia_search_trips | Search Trenitalia trains between two stations on a date |
trenitalia_get_home_alerts | Get current service alerts and mobility info from Trenitalia's home feed — strikes, delays, line-wide notices |
trenitalia_get_mobility_info | Get general mobility info — strikes (scioperi), planned outages, network status — from Trenitalia's home info feed |
FAQ
ChatGPT 免费套餐能用自定义 MCP 连接器吗? 不能。自定义 MCP 连接需要开发者模式,只有付费套餐提供。
为什么 AnythingMCP Cloud 上没有 Trenitalia? Trenitalia 会拒绝来自数据中心 IP 地址的请求。AnythingMCP Cloud 运行在数据中心,因此每次调用都会失败。部署在家庭或办公网络上的 AnythingMCP 实例通常可以正常使用。
下一步
这份指南对你有帮助吗?