这是一个与 Google Maps 和旅行规划服务交互的旅行规划模型上下文协议 (MCP) 服务器实现。它能让大型语言模型 (LLMs) 执行旅行相关任务,如位置搜索、地点详细信息查找和旅行时间计算。
本服务器可助力大型语言模型处理各类旅行相关任务,以下为您介绍安装与使用方法。
通过 Smithery 可自动安装 Claude Desktop 的旅行规划器:
npx -y @smithery/cli install @GongRzhe/TRAVEL-PLANNER-MCP-Server --client claude
# 使用 npx(推荐)
npx @gongrzhe/server-travelplanner-mcp
# 配合环境变量使用 Google Maps API
GOOGLE_MAPS_API_KEY=your_api_key npx @gongrzhe/server-travelplanner-mcp
或者全局安装:
# 全局安装
npm install -g @gongrzhe/server-travelplanner-mcp
# 全局安装后运行
GOOGLE_MAPS_API_KEY=your_api_key @gongrzhe/server-travelplanner-mcp
searchPlaces
query (字符串):搜索地点的查询词。location (可选):经纬度以偏向结果。radius (可选):搜索半径(单位:米)。getPlaceDetails
placeId (字符串):Google 地点 ID,用于检索详细信息。calculateRoute
origin (字符串):起始位置。destination (字符串):结束位置。mode (可选):出行方式(驾驶、步行、骑行、 transit)。getTimeZone
location:经纬度坐标。timestamp (可选):用于计算时区的时间戳。要在 Claude Desktop 应用中使用此服务器,请在 claude_desktop_config.json 的 "mcpServers" 部分添加以下配置:
{
"mcpServers": {
"travel-planner": {
"command": "npx",
"args": ["@gongrzhe/server-travelplanner-mcp"],
"env": {
"GOOGLE_MAPS_API_KEY": "your_google_maps_api_key"
}
}
}
}
git clone https://github.com/yourusername/your-repository.git
cd your-repository
npm install
npm start
# 必要的环境变量示例
GOOGLE_MAPS_API_KEY=your_api_key_here
此项目遵循 LICENSE 协议。