Airbnb Mcp
🏠 MCP Airbnb Agent - Search for Airbnb listings!
This example shows how to create an agent that uses MCP and Llama 4 to search for Airbnb listings.
Code
1import asyncio2from textwrap import dedent34from kern.agent import Agent5from kern.models.groq import Groq6from kern.tools.mcp import MCPTools7from kern.tools.reasoning import ReasoningTools8910async def run_agent(message: str) -> None:11 async with MCPTools(12 "npx -y @openbnb/mcp-server-airbnb --ignore-robots-txt"13 ) as mcp_tools:14 agent = Agent(15 model=Groq(id="meta-llama/llama-4-scout-17b-16e-instruct"),16 tools=[ReasoningTools(add_instructions=True), mcp_tools],17 instructions=dedent("""\18 ## General Instructions19 - Always start by using the think tool to map out the steps needed to complete the task.20 - After receiving tool results, use the think tool as a scratchpad to validate the results for correctness21 - Before responding to the user, use the think tool to jot down final thoughts and ideas.22 - Present final outputs in well-organized tables whenever possible.23 - Always provide links to the listings in your response.24 - Show your top 10 recommendations in a table and make a case for why each is the best choice.2526 ## Using the think tool27 At every step, use the think tool as a scratchpad to:28 - Restate the object in your own words to ensure full comprehension.29 - List the specific rules that apply to the current request30 - Check if all required information is collected and is valid31 - Verify that the planned action completes the task\32 """),33 add_datetime_to_context=True,34 markdown=True,35 )36 await agent.aprint_response(message, stream=True)373839if __name__ == "__main__":40 task = dedent("""\41 I'm traveling to San Francisco from April 20th - May 8th. Can you find me the best deals for a 1 bedroom apartment?42 I'd like a dedicated workspace and close proximity to public transport.\43 """)44 asyncio.run(run_agent(task))Usage
Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateSet your API key
1export GROQ_API_KEY=xxxInstall dependencies
1uv pip install -U groq mcp kern-aiRun Agent
1python cookbook/01_showcase/01_agents/airbnb_mcp.py1python cookbook/01_showcase/01_agents/airbnb_mcp.py