Custom Weather MCP Server
Persists LangGraph workflow checkpoints in MongoDB Atlas by thread ID, retaining conversation state across travel-planning requests.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Custom Weather MCP ServerWhat's the weather forecast for Tokyo this weekend?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TripAI
TripAI is a web-based travel planning assistant that turns a trip request into flight guidance, hotel suggestions, weather details, and an itinerary. It combines a LangGraph workflow with MCP-connected travel services, Groq-powered language models, and MongoDB Atlas checkpoint persistence.
Features
Generate a structured travel plan from a natural-language request.
Provide flight guidance using AviationStack airport and airline data.
Research hotel options with Tavily search.
Include current weather and forecast information from OpenWeather.
Retain LangGraph conversation state in MongoDB Atlas using a thread ID.
View, copy, and download the generated plan as a PDF in the web interface.
Related MCP server: MCP Weather Server
Tech Stack
Python, FastAPI, and Uvicorn
LangGraph and LangChain Core
Groq through
langchain-groq(openai/gpt-oss-20b)Model Context Protocol (MCP) with
langchain-mcp-adaptersMongoDB Atlas, PyMongo, and
langgraph-checkpoint-mongodbTavily, AviationStack, and OpenWeather
HTML, CSS, JavaScript, Jinja2, and Pydantic
Architecture
User
→ FastAPI web UI or API
→ LangGraph travel workflow
→ Flight, hotel, weather, itinerary, and final-response agents
→ MCP tools for AviationStack, Tavily, and OpenWeather
→ MongoDB Atlas checkpoint persistence by thread ID
→ Final travel planThe FastAPI application accepts the trip request and invokes the compiled LangGraph workflow. LangGraph passes shared trip state through each agent and saves workflow checkpoints to MongoDB Atlas. Groq supports destination extraction and generates flight guidance, the itinerary, and the final response.
MCP Integration
AviationStack: A local stdio MCP server, started with
uvx aviationstack-mcp, supplies airport and airline information used to produce flight guidance.Tavily: A remote MCP endpoint provides hotel-related web search.
OpenWeather: A custom local MCP server exposes current-weather and forecast tools backed by the OpenWeather API.
The MCP client initializes each service independently so a failure connecting to one service does not prevent the others from loading.
Project Structure
.
├── app.py # FastAPI application and HTTP endpoints
├── backend.py # LangGraph state and travel-agent workflow
├── mcp_client.py # Tavily, AviationStack, and weather MCP clients
├── custom_weather_mcp_server.py # OpenWeather-backed MCP tools
├── mongodb.py # MongoDB Atlas connection helper
├── requirements.txt # Python dependencies
├── templates/
│ └── index.html # Trip planner page
├── static/
│ ├── script.js # Browser interactions and API requests
│ └── style.css # Interface styling
├── tools/
│ ├── __init__.py
│ └── flight_tool.py # Flight lookup utility
├── excalidraw_files/ # Architecture and MCP diagrams
├── .env.example # Environment variable template
└── .gitignoreHow It Works
A user submits a trip request through the planner page or the travel API.
The flight agent asks AviationStack MCP for airport and airline information and uses Groq to produce flight guidance.
The hotel agent searches for hotel suggestions through Tavily MCP.
The weather agent uses Groq to identify the destination, then requests current conditions and forecast data through the custom OpenWeather MCP server.
The itinerary agent combines the request and gathered information into a practical itinerary.
The final-response agent formats the results into a complete travel plan.
LangGraph checkpoints the workflow state in MongoDB Atlas under the request's thread ID.
Setup
Use Python 3.10 or newer and make sure uvx is available for the AviationStack MCP server. Create a virtual environment and install the project dependencies:
python -m venv .venvActivate it, then install requirements:
# Windows PowerShell
.venv\Scripts\Activate.ps1
# macOS or Linux
source .venv/bin/activate
pip install -r requirements.txtCopy .env.example to .env and fill in the required values. Configure MongoDB Atlas network access and database credentials for your environment.
Run Locally
With the virtual environment active and .env configured, run:
python app.pyOpen the planner at http://127.0.0.1:8000/.
Environment Variables
Set these variable names in .env; replace placeholders with your own values:
MONGODB_URI=<mongodb-atlas-connection-string>
MONGODB_DATABASE=tripmate
GROQ_API_KEY=<groq-api-key>
TAVILY_API_KEY=<tavily-api-key>
AVIATIONSTACK_API_KEY=<aviationstack-api-key>
OPENWEATHER_API_KEY=<openweather-api-key>
DEFAULT_ORIGIN_IATA=DACDEFAULT_ORIGIN_IATA is used by the flight lookup utility. The active LangGraph flight agent currently obtains airport and airline data through AviationStack MCP.
API Endpoints
Method | Path | Description |
|
| Serves the TripAI planner interface. |
|
| Returns the application health status. |
|
| Generates a travel plan from a JSON request. |
Example request:
{
"message": "Plan a 3-day trip to Tokyo with a budget of $1200",
"thread_id": "optional-existing-thread"
}thread_id is optional. When omitted, the application creates a new thread ID.
Key Learning / Implementation
Designed a multi-agent travel workflow with shared state.
Orchestrated sequential agent execution and checkpointing with LangGraph.
Connected remote and local MCP tools for travel research and weather data.
Persisted agent checkpoints in MongoDB Atlas.
Integrated Groq models through LangChain for destination extraction and plan generation.
Coordinated external travel, search, and weather APIs through MCP.
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)
WeatherAPI.com MCP — wraps WeatherAPI.com (api.weatherapi.com)
Weather MCP — wraps Open-Meteo API (free, no auth)
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides current weather information and forecasts for major cities through MCP tools and resources. Supports getting weather data, multi-day forecasts, and listing available cities with mock data for demonstration purposes.-
- AlicenseNot gradedqualityDmaintenanceExposes weather forecast APIs as MCP tools, allowing LLMs to retrieve current weather conditions and multi-day forecasts for any location using latitude and longitude coordinates.15 npmMIT
- AlicenseAqualityBmaintenanceEnables MCP clients to search for locations, fetch weather forecasts, and retrieve forecast meteogram images through the meteoblue Weather API.312 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables AI applications and MCP clients to look up real-time weather data for any specified city through a callable tool.-