Skip to content

Integrations · LangChain

Flight tools for your agent, via MCP

LangChain's MCP adapters load the hosted FlightPowers servers as ordinary tools. Your agent searches live fares and quotes Google's verdict; you write no HTTP code.

Free tier on RapidAPI. No card to try.

pip install langchain-mcp-adapters
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain.agents import create_agent

client = MultiServerMCPClient({
    "flights": {
        "transport": "http",
        "url": "https://flights.flightpowers.com/mcp",
        "headers": {"x-rapidapi-key": "YOUR_KEY"},
    },
    "hotels": {
        "transport": "http",
        "url": "https://hotels.flightpowers.com/mcp",
        "headers": {"x-rapidapi-key": "YOUR_KEY"},
    },
})

tools = await client.get_tools()
agent = create_agent(model, tools)  # any chat model

The REST alternative

No MCP? Wrap one endpoint as a tool

The API is one POST with flat JSON, so a hand-rolled tool is a few lines.

a plain langchain tool over the REST API
import os, requests
from langchain_core.tools import tool

@tool
def search_flights(from_airport: str, to_airport: str, departure_date: str) -> list:
    """Live one-way fares with Google's price band and low|typical|high verdict."""
    r = requests.post(
        "https://api.flightpowers.com/v1/flights/oneway",
        headers={"x-api-key": os.environ["RAPIDAPI_KEY"]},
        json={"from_airport": from_airport, "to_airport": to_airport,
              "departure_date": departure_date},
    )
    return r.json()

The response includes price_insights_low / high and the verdict field, so the agent can reason about whether a fare is worth booking, not just list it.

Questions, answered plainly

Is there a first-party LangChain package?
No, and none is needed. LangChain’s own MCP adapters load the hosted servers’ tools directly, and the plain REST API wraps into a @tool in a few lines. Both paths are shown on this page; there is nothing else to install from us.
What tools does the agent get?
What the MCP servers expose: one-way and round-trip flight search on the flights server, hotel search and hotel-by-name on the hotels server. Each returns the same JSON as the REST API, including the price band and verdict.
Where does the key go?
In the headers block of the server config, as x-rapidapi-key. It rides on every tool call and bills to your own RapidAPI plan. Flights and hotels are separate subscriptions.
Does this work with LangGraph?
Yes. get_tools() returns ordinary LangChain tools; pass them to create_agent or any LangGraph graph the same way you pass any tool list.

Give your agent a fare verdict

Live Google Flights and Booking.com data, with the price band and verdict attached to every result. Free tier on RapidAPI, no card to try.

Free tier: 10 requests/month. No card to try.