AI-Travel-Agent-using-MCP-Semantic-Kernel

lavasai14/AI-Travel-Agent-using-MCP-Semantic-Kernel

3.1

If you are the rightful owner of AI-Travel-Agent-using-MCP-Semantic-Kernel and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

This document provides a structured summary of a travel assistant system using an MCP server and a Semantic Kernel-based Gemini agent.

Tools
3
Resources
0
Prompts
0

This code implements a travel assistant system using an MCP server and a Semantic Kernel-based Gemini agent. The Travel MCP Server exposes three main tools: fetching live flight details via the Amadeus API, retrieving weather data from OpenWeather, and generating multi-day city itineraries as PDFs using OpenTripMap and ReportLab. Environment variables store API keys for all external services. Each tool is registered with the MCP server using the @mcp.tool decorator, and the server runs asynchronously with mcp.run_stdio_async().

The agent client connects to this server and uses Semantic Kernel with a Gemini LLM to autonomously plan actions. It lists available tools dynamically, maintains memory of past actions, and constructs system prompts combining memory and tool descriptions. When the user inputs a query, the agent asks Gemini to return a JSON plan specifying which tools to call and with what arguments. It then executes the plan via the MCP session, collecting results and updating memory.

The design is fully asynchronous, supports error handling for missing API keys or API failures, and outputs results in clean, readable text or as a PDF for itineraries. The system is easily extensible, allowing new tools to be added to the MCP server without modifying the agent logic. Overall, the workflow is: user query → Gemini agent plans → MCP server tools execute → results returned to user, enabling autonomous multi-step travel assistance.