Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /agno-agi_agno /cookbook /91_tools /mcp /airbnb.py
| """MCP Airbnb Agent - Search for Airbnb listings! | |
| This example shows how to create an agent that uses MCP and Gemini 2.5 Pro to search for Airbnb listings. | |
| Run: `uv pip install google-genai mcp agno` to install the dependencies | |
| """ | |
| import asyncio | |
| from agno.agent import Agent | |
| from agno.models.openai.chat import OpenAIChat | |
| from agno.tools.mcp import MCPTools | |
| # --------------------------------------------------------------------------- | |
| # Create Agent | |
| # --------------------------------------------------------------------------- | |
| async def run_mcp_agent(message: str): | |
| # Initialize the MCP tools | |
| mcp_tools = MCPTools("npx -y @openbnb/mcp-server-airbnb --ignore-robots-txt") | |
| # Connect to the MCP server | |
| await mcp_tools.connect() | |
| # Use the MCP tools with an Agent | |
| agent = Agent( | |
| model=OpenAIChat(id="gpt-5.6-luna"), | |
| tools=[mcp_tools], | |
| markdown=True, | |
| ) | |
| await agent.aprint_response(message) | |
| # Close the MCP connection | |
| await mcp_tools.close() | |
| # --------------------------------------------------------------------------- | |
| # Run Agent | |
| # --------------------------------------------------------------------------- | |
| if __name__ == "__main__": | |
| asyncio.run(run_mcp_agent("Show me listings in Barcelona, for 2 people.")) | |
Xet Storage Details
- Size:
- 1.29 kB
- Xet hash:
- 4687f8b6da8f4636267bc098ad6779c37fa2ed8aed30b046096c4fe8ca33d3f6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.