Airbnb MCP agent
Using the Airbnb MCP server to create an Agent that can search for Airbnb listings:
1"""🏠 MCP Airbnb Agent - Search for Airbnb listings!23This example shows how to create an agent that uses MCP and Gemini 2.5 Pro to search for Airbnb listings.45Run: `uv pip install google-genai mcp kern-ai` to install the dependencies6"""78import asyncio910from kern.agent import Agent11from kern.models.google import Gemini12from kern.tools.mcp import MCPTools13from kern.utils.pprint import apprint_run_response141516async def run_agent(message: str) -> None:17 async with MCPTools(18 "npx -y @openbnb/mcp-server-airbnb --ignore-robots-txt"19 ) as mcp_tools:20 agent = Agent(21 model=Gemini(id="gemini-2.5-pro-exp-03-25"),22 tools=[mcp_tools],23 markdown=True,24 )2526 response_stream = await agent.arun(message, stream=True)27 await apprint_run_response(response_stream, markdown=True)282930if __name__ == "__main__":31 asyncio.run(32 run_agent(33 "What listings are available in San Francisco for 2 people for 3 nights from 1 to 4 August 2025?"34 )35 )