Cover image
Try Now
2025-04-14

3 years

Works with Finder

1

Github Watches

0

Github Forks

1

Github Stars

✈️ Multi Context Protocol (MCP) Server

🌟 Overview

This is a generalized travel mcp server that allows you to ask complex travel planning questions. Try the following

  • I need to be at the Google office tomorrow by 4pm. What is the latest flight I need to take?
  • I would like to stay at a reasonably priced hotel 15 minutes walk from the Eiffel tower, recommend some options.

🔧 Supported Functions

🛫 search-flights

Searches for available flights between two airports via Booking.com's API.

📅 today

Provides the current date to the LLM, ensuring it has up-to-date temporal context.

🏨 search-hotels

Search for available hotels and accommodations.

🔮 Features to Come

🚗 search-car-rentals

Find car rental options at your destination.

hotel-reviews

Access reviews for hotels and accommodations.

🚕 search-taxis

Find taxi and transfer services at your destination.

📦 Installation

This MCP server can be used with either Claude Desktop or your own client.

Pre-requisites

  1. Go to RapidAPI, and look for the booking.com API. Issue yourself a key
  2. Go to google cloud and issue yourself a Google Maps API key.

Use with Claude Desktop

In order to work with Claude Desktop, use the below claude_desktop_config.json

{
  "mcpServers": {
    "travel": {
      "command": "npx",
      "args": ["travel-mcp-server"],
      "env": {
        "BOOKING_COM_API_KEY": "<YOUR_BOOKING_DOT_COM_API_KEY>"
      }
    },
    "google-maps": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GOOGLE_MAPS_API_KEY",
        "mcp/google-maps"
      ],
      "env": {
        "GOOGLE_MAPS_API_KEY": "<YOUR_GOOGLE_MAPS_API_KEY>"
      }
    }
  }
}

You will need to go get a google maps API key in order to use this.

Programmatic Use

If you want to use this programmatically, here is a code snippet.

class TravelClient {
  private flightsClient: Client;
  private mapsClient: Client;
  private toolDefinitions: any[] = [];

  constructor() {
    this.flightsClient = new Client(
      { name: "FlightsApp", version: "1.0.0" },
      { capabilities: { tools: {}, resources: {}, prompts: {} } }
    );
    this.mapsClient = new Client(
      { name: "MapsApp", version: "1.0.0" },
      { capabilities: { tools: {}, resources: {}, prompts: {} } }
    );
  }

  async initialize() {
    console.log("Initializing MCP clients...");
    try {
      const flightsTransport = new StdioClientTransport({
        command: "node",
        args: ["../../node_modules/travel-mcp-server/build/index.js"],
      });

      console.log("GOOGLE MAPS API KEY", process.env.GOOGLE_MAPS_API_KEY);
      const mapsTransport = new StdioClientTransport({
        command: process.execPath,
        args: [
          "../../node_modules/@modelcontextprotocol/server-google-maps/dist/index.js",
        ],
        env: {
          GOOGLE_MAPS_API_KEY: process.env.GOOGLE_MAPS_API_KEY || "",
        },
      });

      await Promise.all([
        this.flightsClient.connect(flightsTransport),
        this.mapsClient.connect(mapsTransport),
      ]);

      // Discover tools from both servers
      console.log("Discovering tools...");
      const [flightsTools, mapsTools] = await Promise.all([
        this.flightsClient.listTools(),
        this.mapsClient.listTools(),
      ]);

      // Combine tools from both servers
      this.toolDefinitions = [
        ...flightsTools.tools.map((tool) => ({
          name: tool.name,
          description: tool.description || `Tool: ${tool.name}`,
          input_schema: tool.inputSchema,
        })),
        ...mapsTools.tools.map((tool) => ({
          name: tool.name,
          description: tool.description || `Tool: ${tool.name}`,
          input_schema: tool.inputSchema,
        })),
      ];

      console.log(`Discovered ${this.toolDefinitions.length} tools`);
      return this;
    } catch (error) {
      console.error("Error initializing MCP clients:", error);
      throw error;
    }
  }

  async callTool(toolName: string, parameters: any) {
    const tool = this.toolDefinitions.find((t) => t.name === toolName);
    if (!tool) {
      throw new Error(`Tool ${toolName} not found`);
    }

    // Determine which client to use based on the tool name
    const client = toolName.includes("maps")
      ? this.mapsClient
      : this.flightsClient;

    const toolRequest = {
      name: toolName,
      arguments: parameters,
    };

    const result = await client.callTool(toolRequest);
    return result;
  }

  async getToolDefinitions() {
    return this.toolDefinitions;
  }
}

export default TravelClient;

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • Byaidu
  • PDF科学纸翻译带有保留格式的pdf -基于ai完整保留排版的pdf文档全文双语翻译

  • lasso-security
  • 基于插件的网关,可协调其他MCP,并允许开发人员在IT企业级代理上构建。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • modelscope
  • 开始以更轻松的方式开始构建具有LLM授权的多代理应用程序。

    Reviews

    3 (5)
    Avatar
    user_gcoyVbXo
    2025-04-26

    The searchAPI-mcp by RikGmee is an impressive tool that has significantly streamlined my search operations. Its intuitive interface and robust functionality have made it an indispensable resource in my workflow. The responsive customer support and regular updates ensure a smooth user experience. Highly recommended for anyone in need of a reliable search API.

    Avatar
    user_7inYPMnm
    2025-04-26

    As a dedicated user of searchAPI-mcp, I can confidently say it's an exceptional tool developed by RikGmee. The seamless integration and intuitive design are impressive. It's reliable and efficient, making complex searches straightforward. Highly recommended for anyone looking to enhance their search capabilities!

    Avatar
    user_3iriApYV
    2025-04-26

    As a dedicated user of searchAPI-mcp by RikGmee, I can confidently say it's a game-changer for developers. Its efficient and seamless integration into any project makes searching data faster and more reliable. The clear documentation and user-friendly interface make it accessible for both beginners and advanced users. Highly recommend!

    Avatar
    user_Edt9y2vL
    2025-04-26

    As a dedicated user of searchAPI-mcp, I can confidently say it has significantly enhanced my search capabilities. The seamless integration and efficient performance make it an indispensable tool in my tech arsenal. Kudos to RikGmee for developing such a robust API! If you're looking for a reliable search solution, searchAPI-mcp is definitely worth trying.

    Avatar
    user_VfrO0BC3
    2025-04-26

    As a dedicated user of searchAPI-mcp, I am thoroughly impressed with its performance and efficiency. Developed by RikGmee, this tool provides accurate and fast search results, making it an invaluable asset for my projects. Easy to integrate, it has significantly boosted my productivity. Highly recommended!