返回市场
旅行规划师-MCP-服务器

旅行规划师-MCP-服务器

作者:GongRzhe90 星标更新:2025-03-12

项目介绍

Travel Planner MCP Server (@gongrzhe/server-travelplanner-mcp)

smithery 徽章

这是一个用于与Google Maps和旅行规划服务交互的Travel Planner模型上下文协议(MCP)服务器实现。此服务器使大型语言模型能够执行与旅行相关的任务,如地点搜索、场所详情查询和旅行时间计算。

<a href="https://glama.ai/mcp/servers/y3u6yjiiq1"> <img width="380" height="200" src="https://gips1.baidu.com/it/u=467842305,4005892092&fm=3081&app=3_081&f=PNG?w=760&h=400" alt="Travel Planner Server MCP 服务器" /> </a>

安装及使用

通过 Smithery 安装

要通过 Smithery 自动安装 Travel Planner for 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

    • 使用 Google Places API 搜索地点
    • 输入:
      • query (字符串):地点搜索查询
      • location (可选):偏置结果的纬度和经度
      • radius (可选):搜索半径(米)
  • getPlaceDetails

    • 获取特定地点的详细信息
    • 输入:
      • placeId (字符串):要检索详细信息的 Google 地点ID
  • calculateRoute

    • 计算两个地点之间的路线
    • 输入:
      • origin (字符串):起始地点
      • destination (字符串):结束地点
      • mode (可选):旅行方式(驾驶、步行、骑自行车、公共交通)
  • getTimeZone

    • 获取地点的时间区信息
    • 输入:
      • location:纬度和经度坐标
      • timestamp (可选):用于计算时区的时间戳

配置

与 Claude Desktop 结合使用

要在 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"
      }
    }
  }
}

或者,如果您已安装该包,可以直接使用 node 命令:

{
  "mcpServers": {
    "travel-planner": {
      "command": "node",
      "args": ["path/to/dist/index.js"],
      "env": {
        "GOOGLE_MAPS_API_KEY": "your_google_maps_api_key"
      }
    }
  }
}

开发

从源码构建

  1. 克隆仓库
  2. 安装依赖项:
    npm install
    
  3. 构建项目:
    npm run build
    

环境变量

  • GOOGLE_MAPS_API_KEY(必需):您的 Google Maps API 密钥,需要启用以下 API:
    • Places API
    • Directions API
    • Geocoding API
    • Time Zone API

许可证

此 MCP 服务器采用 MIT 许可证。更多详情,请参阅项目仓库中的 LICENSE 文件。