这是一个用于与 Google 地图和旅行规划服务交互的旅行规划模型上下文协议 (MCP) 服务器实现。该服务器使 LLM 能够执行与旅行相关的任务,如地点搜索、地点详情查询和旅行时间计算。
要通过 Smithery 自动为 Claude Desktop 安装旅行规划器:
npx -y @smithery/cli install @GongRzhe/TRAVEL-PLANNER-MCP-Server --client claude
# Using npx (recommended)
npx @gongrzhe/server-travelplanner-mcp
# With environment variable for Google Maps API
GOOGLE_MAPS_API_KEY=your_api_key npx @gongrzhe/server-travelplanner-mcp

或者全局安装:
# Install globally
npm install -g @gongrzhe/server-travelplanner-mcp
# Run after global installation
GOOGLE_MAPS_API_KEY=your_api_key @gongrzhe/server-travelplanner-mcp

searchPlaces
query
(字符串): 地点搜索查询location
(可选): 用于偏置结果的纬度和经度radius
(可选): 搜索半径(米)getPlaceDetails
placeId
(字符串): 用于检索详情的 Google Place IDcalculateRoute
origin
(字符串): 出发地destination
(字符串): 目的地mode
(可选): 旅行模式(驾车、步行、骑自行车、公共交通)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"
}
}
}
}

或者,如果您已安装了包,可以直接使用节点命令:
{
"mcpServers": {
"travel-planner": {
"command": "node",
"args": ["path/to/dist/index.js"],
"env": {
"GOOGLE_MAPS_API_KEY": "your_google_maps_api_key"
}
}
}
}

npm install
npm run build
GOOGLE_MAPS_API_KEY
(必需): 您的 Google 地图 API 密钥,并启用以下 API:
此 MCP 服务器采用 MIT 许可证。有关更多详细信息,请参阅项目存储库中的 LICENSE 文件。