Repository: Arindam200/awesome-ai-apps
Pull request #17: Add Couchbase MCP example with OpenAI SDK and NebiusAI + Mastra AI example
Author: login: shivaylamba
Created: 2025-05-23T00:09:03Z | Merged: 2025-05-23T12:33:08Z



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added a comprehensive README with setup and usage instructions for integrating an AI agent with Couchbase via MCP.
  - Introduced a Jupyter notebook demo that showcases an AI agent answering natural language queries using Couchbase data.
  - Developed a weather information agent using Mastra AI integrated with the Nebius OpenAI-compatible API, capable of fetching and interpreting real-time weather data.

- **Documentation**
  - Provided detailed explanations of project workflow, prerequisites, and step-by-step guidance for running the Couchbase AI agent demo.
  - Added README and example environment configuration for the Mastra AI weather agent, including setup and usage instructions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/mcp_ai_agents/couchbase_mcp_server/README.md b/mcp_ai_agents/couchbase_mcp_server/README.md
new file mode 100644
index 00000000..7a52ce6c
--- /dev/null
+++ b/mcp_ai_agents/couchbase_mcp_server/README.md
@@ -0,0 +1,118 @@
+# Couchbase MCP OpenAI Agents SDK Demo with Nebius 
+
+## 1. Project Overview
+
+This project demonstrates the integration of a Large Language Model (LLM) with a Couchbase database using the Model Context Protocol (MCP) and the OpenAI Agents SDK. It showcases how an AI agent can understand natural language queries, interact with a Couchbase instance to retrieve or manipulate data, and provide meaningful responses. This demo specifically focuses on querying a sample database `travel-sample` containing information about hotels, airports, airlines, routes, and landmarks, primarily within an `inventory` scope.
+
+Users can ask questions like:
+*   "List out the top 5 hotels by the highest aggregate rating?"
+*   "Recommend me a flight and hotel from New York to San Francisco."
+
+The project uses a Jupyter notebook (`main.ipynb`) to define and run the AI agent, which communicates with a Couchbase database via an MCP server.
+
+## 2. Introduction to Model Context Protocol (MCP)
+
+The Model Context Protocol (MCP) is an open standard designed to standardize how AI assistants and applications connect to and interact with external data sources, tools, and systems. Think of MCP as a universal adapter that allows AI models to seamlessly access the context they need to produce more relevant, accurate, and actionable responses.
+
+**Key Goals and Features of MCP:**
+
+*   **Standardized Communication:** MCP provides a common language and structure for AI models to communicate with diverse backend systems, replacing the need for numerous custom integrations.
+*   **Enhanced Context Management:** It helps manage the limited context windows of LLMs efficiently, enabling them to maintain longer, more coherent interactions and leverage historical data.
+*   **Secure Data Access:** MCP emphasizes secure connections, allowing developers to expose data through MCP servers while maintaining control over their infrastructure.
+*   **Tool Use and Actionability:** It enables LLMs to not just retrieve information but also to use external tools and trigger actions in other systems.
+*   **Interoperability:** Fosters an ecosystem where different AI tools, models, and data sources can work together more cohesively.
+*   **Client-Server Architecture:** MCP typically involves:
+    *   **MCP Hosts/Clients:** Applications (like AI assistants, IDEs, or other AI-powered tools) that want to access data or capabilities.
+    *   **MCP Servers:** Lightweight programs that expose specific data sources or tools (e.g., a database, an API) through the standardized MCP.
+
+MCP aims to break down data silos, making it easier for AI to integrate with real-world applications and enterprise systems, leading to more powerful and context-aware AI solutions. It is an open-source initiative, often supported by SDKs in various programming languages to facilitate the development of MCP clients and servers.
+
+## 3. Implementation Overview
+
+This project leverages MCP to allow an AI agent to query and understand data within a Couchbase database.
+
+### 3.1. Core Components:
+
+*   **`main.ipynb`:**
+    *   The main Jupyter notebook that orchestrates the demonstration.
+    *   It imports necessary libraries, including `agents` and `agents.mcp`.
+    *   Defines the AI agent's configuration and the questions to be asked.
+    *   Manages the lifecycle of the MCP server connection.
+*   **`agents` library (custom/external):**
+    *   Provides the `Agent` class to define the AI agent's behavior, instructions, and model (e.g., "meta-llama/Meta-Llama-3.1-8B-Instruct").
+    *   Provides the `Runner` class to execute interactions with the agent.
+    *   Includes `gen_trace_id` and `trace` for observability.
+*   **`agents.mcp.MCPServerStdio`:**
+    *   A component used to establish and manage a connection to an MCP server running as a separate process, communicating via standard input/output (stdio).
+    *   In this demo, it's configured to run an external Python script (`mcp-server-couchbase/src/mcp_server.py`) which acts as the MCP server for Couchbase.
+*   **`mcp-server-couchbase` (External MCP Server):**
+    *   This is a separate Python application (located [here](https://github.com/Couchbase-Ecosystem/mcp-server-couchbase)) that implements the MCP server logic for Couchbase.
+    *   It exposes Couchbase operations (like running SQL++ queries, fetching documents, listing scopes/collections) as tools that the AI agent can call via MCP.
+    *   It requires its own environment configuration (e.g., via a `.env` file specified by the `--env-file` argument) to connect to the actual Couchbase instance.
+
+### 3.2. Workflow:
+
+1.  **MCP Server Initialization:**
+    *   The `main.ipynb` script starts by launching the `mcp-server-couchbase` process using `MCPServerStdio`.
+    *   The command to start the server is configured with the path to a `uv` executable (a Python project and virtual environment manager), the `mcp-server-couchbase` project directory, and the path to an `.env` file for its database credentials.
+    *   This server listens for MCP requests from the agent.
+
+2.  **Agent Configuration:**
+    *   An `Agent` instance (named "Assistant") is created with:
+        *   **System Prompt/Instructions:** Detailed instructions are provided to the LLM on how to interact with the Couchbase database. These instructions include:
+            *   The hierarchical structure of Couchbase (Cluster, Bucket, Scope, Collection, Document).
+            *   Specific guidance that the data of interest is within the `inventory` scope.
+            *   Rules for generating SQL++ queries (e.g., only the collection name in the `FROM` clause, and enclosing all identifiers like fields, collections, scopes, or bucket names in backticks `` ` ``).
+        *   **LLM Model:** Specifies the underlying language model to be used (e.g., "meta-llama/Meta-Llama-3.1-8B-Instruct").
+        *   **MCP Server Connection:** The `mcp_servers` parameter links the agent to the initialized `MCPServerStdio` instance, enabling it to discover and use the Couchbase tools exposed by the MCP server.
+
+3.  **Querying the Agent:**
+    *   The `qna` asynchronous function defines a series of natural language questions.
+    *   For each question, `Runner.run(starting_agent=agent, input=message)` sends the message to the "Assistant" agent.
+
+4.  **Agent Processing and MCP Tool Use:**
+    *   The agent (LLM) receives the user's question.
+    *   Based on its instructions and the question, it determines if it needs to interact with the Couchbase database.
+    *   If database interaction is required, the agent formulates a request to use one of the available Couchbase tools provided by the `mcp-server-couchbase` (e.g., `mcp_couchbase_run_sql_plus_plus_query`, `mcp_couchbase_get_scopes_and_collections_in_bucket`).
+    *   This tool request is sent over MCP to the `mcp-server-couchbase`.
+    *   The `mcp-server-couchbase` executes the requested database operation (e.g., runs a SQL++ query against the `inventory` scope).
+    *   The results from the database operation are returned to the agent via MCP.
+
+5.  **Response Generation:**
+    *   The agent uses the information retrieved from Couchbase (if any) and its own reasoning capabilities to formulate a natural language response to the user's original question.
+    *   The final output from the agent is then printed in the notebook.
+
+### 3.3. Database Interaction Details:
+
+*   **Target Database:** The agent is configured to primarily work with the `inventory` scope.
+*   **Collections:** The demo implies the existence of collections such as `airport`, `airline`, `route`, `landmark`, and `hotel` within the `inventory` scope.
+*   **Query Language:** The agent is instructed to generate SQL++ (N1QL) queries for Couchbase.
+
+
+### 3.4. Setting Up and Running the Demo:
+
+**Prerequisites:**
+
+*   Python
+*   Jupyter Notebook or JupyterLab.
+*   Access to a running Couchbase Server instance populated with the relevant sample data (especially in the `inventory` scope with the mentioned collections).
+*   The `mcp-server-couchbase` project must be available at the specified path (set as the `--directory` flag) or the path in `main.ipynb` updated accordingly.
+*   A `.env` file containing the necessary Couchbase connection details for the `mcp-server-couchbase`. This file should define variables like:
+    ```env
+    COUCHBASE_HOST=your_couchbase_host
+    COUCHBASE_BUCKET_NAME=your_bucket_name # e.g., travel-sample if that's what inventory scope is in
+    COUCHBASE_USERNAME=your_couchbase_username
+    COUCHBASE_PASSWORD=your_couchbase_password
+    NEBIUS_API_KEY=your_nebius_api_key
+    OPENAI_API_KEY=your_openai_api_key
+    # Add any other variables required by mcp-server-couchbase
+    ```
+*   The `agents` library and its dependencies must be installed in the Python environment used by the Jupyter notebook.
+
+**Running the Demo:**
+
+1.  Ensure all prerequisites are met, especially the Couchbase instance and the `mcp-server-couchbase` setup.
+2.  Verify that the paths in `main.ipynb` for the `uv` command, `mcp-server-couchbase` directory, and the `.env` file are correct for your environment.
+3.  Open `main.ipynb` in Jupyter Notebook or JupyterLab.
+4.  Run the cells in the notebook sequentially.
+5.  Observe the output, which will include the questions asked and the AI agent's responses based on its interaction with the Couchbase database.
diff --git a/mcp_ai_agents/couchbase_mcp_server/main.ipynb b/mcp_ai_agents/couchbase_mcp_server/main.ipynb
new file mode 100644
index 00000000..94afc165
--- /dev/null
+++ b/mcp_ai_agents/couchbase_mcp_server/main.ipynb
@@ -0,0 +1,340 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "id": "b64f1212",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import asyncio\n",
+    "import os\n",
+    "import shutil\n",
+    "\n",
+    "from agents import Agent, Runner, gen_trace_id, trace, OpenAIChatCompletionsModel\n",
+    "from agents.mcp import MCPServer, MCPServerStdio\n",
+    "from openai import AsyncOpenAI\n",
+    "from dotenv import load_dotenv\n",
+    "load_dotenv()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "5b63ccc3",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "api_key = os.environ[\"NEBIUS_API_KEY\"]\n",
+    "base_url = \"https://api.studio.nebius.ai/v1\" \n",
+    "client = AsyncOpenAI(base_url=base_url, api_key=api_key)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "id": "0c3a957e",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "async def qna(agent):\n",
+    "    message = \"Tell me about the database that you are connected to.\"\n",
+    "    print(f\"Running: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"List out the top 5 hotels by the highest aggregate rating?\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"Recommend me a flight and hotel from New York to San Francisco\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"I'm going to the UK for 1 week. Recommend some great spots to visit for sightseeing. Also mention the respective prices of those places for adults and kids.\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"My budget is around 30 pounds a night. What will be the best hotel to stay in?\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "id": "c8ed2f11",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+async def run(mcp_server: MCPServer):
+    agent = Agent(
+        name="Assistant",
+        instructions="""Couchbase organizes data with the following hierarchy (from top to bottom):
+
+                        1. Cluster
+
+                        The overall container of all Couchbase data and services.
+
+                        2. Bucket
+
+                        A bucket is similar to a database in traditional systems.
+
+                        Each bucket contains multiple scopes.
+
+                        Example: "users", "analytics", "products"
+
+                        3. Scope
+
+                        A scope is a namespace within a bucket that groups collections.
+
+                        Scopes help isolate data for different microservices or tenants.
+
+                        Default scope name: _default
+
+                        4. Collection
+
+                        The equivalent of a table in relational databases.
+
+                        Collections store JSON documents.
+
+                        Default collection name: _default
+
+                        5. Document
+
+                        The atomic data unit (usually JSON) stored in a collection.
+
+                        Each document has a unique key within its collection.
+
+                        Use the tools to read the database answer questions based on this database.
+                        The data is inside `inventory` scope, so use only that scope.
+                        Any query you generate needs to have only the collection name in the FROM clause.
+                        Every field, collection, scope or bucket name inside the query should be inside backticks.""",
+        model=OpenAIChatCompletionsModel(
+            model="meta-llama/Meta-Llama-3.1-8B-Instruct",
+            openai_client=client
+        ),
+        mcp_servers=[mcp_server],
+    )
+
+    await qna(agent=agent)
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "id": "e08f8d4c",
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Starting CouchbaseDemo\n",
+      "View trace: https://platform.openai.com/traces/trace?trace_id=trace_ab0900977661443e926dd61304dc06e0\n",
+      "\n",
+      "Running: Tell me about the database that you are connected to.\n",
+      "I am connected to a database that has the following organizational structure:\n",
+      "\n",
+      "- There are multiple scopes (namespaces), each containing collections (similar to tables in a SQL database).\n",
+      "- The main scope containing data of interest is called inventory.\n",
+      "\n",
+      "Within the inventory scope, there are five collections:\n",
+      "1. airport\n",
+      "2. airline\n",
+      "3. route\n",
+      "4. landmark\n",
+      "5. hotel\n",
+      "\n",
+      "Each collection stores data as JSON documents, and these collections likely cover information related to airports, airlines, travel routes, notable landmarks, and hotels.\n",
+      "\n",
+      "Other scopes, such as tenant_agent_00 to tenant_agent_04, seem to have collections related to users and bookings, possibly for a multi-tenant application. There are also default and system-specific scopes and collections.\n",
+      "\n",
+      "If you want to know about the structure or data in any particular collection, please specify which one!\n",
+      "\n",
+      "\n",
+      "Running: List out the top 5 hotels by the highest aggregate rating?\n",
+      "The top 5 hotels by highest aggregate (average) rating are:\n",
+      "\n",
+      "1. Belle Cour Hotel & SPA - 5.0\n",
+      "2. Lovett House Guest House - 5.0\n",
+      "3. Hotel del Coronado - 5.0\n",
+      "4. Hôtel Acacias Etoile - 5.0\n",
+      "5. Handlery Hotel - 5.0\n",
+      "\n",
+      "All of these hotels have an average \"Overall\" review rating of 5.0.\n",
+      "\n",
+      "\n",
+      "Running: Recommend me a flight and hotel from New York to San Francisco\n"
+     ]
+    },
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "Errored MCP tool result: meta=None content=[] isError=False\n"
+     ]
+    },
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Here are my recommendations for your trip from New York to San Francisco:\n",
+      "\n",
+      "Flight:\n",
+      "- Airline: Alaska Airlines (AS)\n",
+      "- Route: Nonstop from JFK (New York) to SFO (San Francisco)\n",
+      "- Sample Flight: AS717, departing at 01:41 UTC (other time options available through the week)\n",
+      "- Distance: Approx. 4,152 km\n",
+      "\n",
+      "Hotel in San Francisco:\n",
+      "- Name: Inn on Castro\n",
+      "- Address: 321 Castro St, San Francisco, California, United States\n",
+      "- Description: An upscale bed and breakfast in a restored house, located at 16th street.\n",
+      "- Amenities: Free internet, free parking, pet-friendly, no free breakfast.\n",
+      "- Website: [Inn on Castro](http://www.innoncastro.com/)\n",
+      "- Price range: $95–$190\n",
+      "- Phone: +1 415 861-0321\n",
+      "\n",
+      "Would you like more details or assistance with booking?\n",
+      "\n",
+      "\n",
+      "Running: I'm going to the UK for 1 week. Recommend some great spots to visit for sightseeing. Also mention the respective prices of those places for adults and kids.\n",
+      "Here are some great sightseeing spots in the UK (Glasgow) for your 1-week trip, along with prices for adults and kids where available:\n",
+      "\n",
+      "1. Glasgow Cathedral\n",
+      "   - Description: A magnificent Gothic cathedral dating from medieval times, built on a site first consecrated in 397AD. Nearby is the Necropolis, a historic and grand cemetery.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "2. City Chambers (George Square)\n",
+      "   - Description: An Italian Renaissance style building, headquarters of the City Council. Free daily tours showing stunning interiors.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "3. St Enoch Subway Station\n",
+      "   - Description: Historic subway station in a quaint building, currently used as a coffee shop, located in St Enoch Square.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "4. Glasgow Central Station\n",
+      "   - Description: Glasgow’s principal railway terminus, noted for its grand interior and the impressive glass-walled bridge known as the Hielanman's Umbrella.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "5. Glasgow School of Art (Mackintosh at the GSA Tour)\n",
+      "   - Description: One of Britain’s most important art schools. Although the original building is closed, external tours are available focusing on Mackintosh’s architecture.\n",
+      "   - Price: £9.75 adults, £8 students/seniors, £4.75 youth\n",
+      "\n",
+      "6. Mitchell Library\n",
+      "   - Description: The largest municipal public reference library in Europe with a stunning reading room. Great for book lovers.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "7. Glasgow University (Hunterian Museum and Art Gallery)\n",
+      "   - Description: Historic university (founded 1451), includes the excellent Hunterian Museum and Art Gallery, and impressive neo-Gothic architecture.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "8. Scotland Street School (Museum)\n",
+      "   - Description: Designed by Charles Rennie Mackintosh, features an excellent museum about Mackintosh and educational history.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "9. House for an Art Lover\n",
+      "   - Description: Built to Mackintosh’s original 1901 designs, with an excellent museum and beautiful surroundings. Includes audio handset guide.\n",
+      "   - Price: £4.50 adults, £3 youth/students\n",
+      "\n",
+      "10. Holmwood House\n",
+      "   - Description: A stunning example of Alexander ‘Greek’ Thomson’s work, run by the National Trust and currently being renovated.\n",
+      "   - Price: £6.50 adults, £16.50 family, £5 concession\n",
+      "\n",
+      "These attractions cover culture, history, and architecture—with many offering free entry! Be sure to check for updated prices and opening hours before your visit. If you need spots in other cities (like London), let me know!\n",
+      "\n",
+      "\n",
+      "Running: My budget is around 30 pounds a night. What will be the best hotel to stay in?\n",
+      "Here are some of the best hotel options in the UK for around £30 a night, along with notable features and guest feedback:\n",
+      "\n",
+      "---\n",
+      "### **1. Anis Louise Guest House, Chesterfield**\n",
+      "- **Price:** £27 per night\n",
+      "- **Address:** 34 Clarence Road, Chesterfield, United Kingdom\n",
+      "- **Facilities:** Free breakfast, free internet, pets not allowed, no free parking\n",
+      "- **Reviews:** Not many available, but it's the best fit for your budget in the UK and appears clean and straightforward.\n",
+      "\n",
+      "**Recommendation:** If your priority is value, cleanliness, and location over luxury, this is your best choice for under £30/night.\n",
+      "\n",
+      "---\n",
+      "\n",
+      "### **2. Tan yr Eglwys Cottages, Pontardawe (Budget option, but with strong caveats)**\n",
+      "- **Price:** £ (exact amount unclear, but marked as pound-priced and likely budget—verify final price before booking)\n",
+      "- **Address:** Church Road, Cilybebyll, Pontardawe, SA8 3JR, United Kingdom\n",
+      "- **Facilities:** Free breakfast, free parking, pets allowed, no free internet\n",
+      "- **Reviews:** Mixed, averaging very poor to average. Some guests report cleanliness and facilities issues, others felt it was tolerable given the price.\n",
+      "\n",
+      "**Recommendation:** Only choose if you are highly budget-restricted and everywhere else is unavailable—but reviews warn about subpar conditions!\n",
+      "\n",
+      "---\n",
+      "\n",
+      "### **3. Other Notable Options (Above Budget)**\n",
+      "If you're able to stretch a bit above £30:\n",
+      "- **La Reserve Hotel Chelsea, London** – £95, great staff and facilities according to reviews.\n",
+      "- **Hotel Sergul, London** – £40, but mixed reviews on comfort and amenities.\n",
+      "- **Magazine Wood B&B, Norfolk** – £40, nice environment and guest comfort, but just over your budget.\n",
+      "\n",
+      "---\n",
+      "\n",
+      "### **Summary**\n",
+      "Your best bet **under £30 is Anis Louise Guest House in Chesterfield**—it fits your budget, offers free breakfast and WiFi, and has no significant negative reviews.\n",
+      "\n",
+      "If you book here, you’ll have a reliable, no-nonsense stay within your budget. If you need something in London or other big cities, consider stretching your budget a little or look for hostels/guesthouses with similar pricing but read reviews carefully.\n",
+      "\n",
+      "Would you like more details or booking info for any hotel above?\n"
+     ]
+    }
+   ],
+   "source": [
+    "async with MCPServerStdio(\n",
+    "    params={\n",
+    "        \"command\": \"/Users/shivaylamba/miniconda3/bin/uv\",\n",
+    "        \"args\": [\"--directory\", \"/Users/shivaylamba/Documents/work/mcp-server-couchbase\",\n",
+    "                    \"run\",\n",
+    "                    \"--env-file\", \"/Users/shivaylamba/Documents/work/MCPCouchbaseDemo/src/.env\",\n",
+    "                \"src/mcp_server.py\"],\n",
+    "    }\n",
+    ") as server:\n",
+    "    trace_id = gen_trace_id()\n",
+    "    with trace(trace_id=trace_id, workflow_name=\"CouchbaseDemo\"):\n",
+    "        print(\"Starting CouchbaseDemo\")\n",
+    "        print(f\"View trace: https://platform.openai.com/traces/trace?trace_id={trace_id}\\n\")\n",
+    "        await run(server)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "33a36e43",
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "base",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.12.8"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/simple_ai_agents/mastra_ai_weather_agent/.env.example b/simple_ai_agents/mastra_ai_weather_agent/.env.example
new file mode 100644
index 00000000..cfd00300
--- /dev/null
+++ b/simple_ai_agents/mastra_ai_weather_agent/.env.example
@@ -0,0 +1,2 @@
+NEBIUS_API_KEY=
+OPENAI_API_KEY=
diff --git a/simple_ai_agents/mastra_ai_weather_agent/README.md b/simple_ai_agents/mastra_ai_weather_agent/README.md
new file mode 100644
index 00000000..3e63ecd6
--- /dev/null
+++ b/simple_ai_agents/mastra_ai_weather_agent/README.md
@@ -0,0 +1,36 @@
+# Using a tool with Mastra AI and Nebius 
+
+A simple example showing how to use a tool.
+
+## Prerequisites
+
+- Node.js v20.0+
+- pnpm (recommended) or npm
+- OpenAI API key
+- Nebius AI Key
+
+## Getting Started
+
+1. Copy the environment variables file and add your OpenAI API key:
+
+   ```bash
+   cp .env.example .env
+   ```
+
+   Then edit `.env` and add your OpenAI API key:
+
+   ```env
+   OPENAI_API_KEY=sk-your-api-key-here
+   ```
+
+2. Install dependencies:
+
+   ```
+   pnpm install
+   ```
+
+3. Run the example:
+
+   ```bash
+   pnpm start
+   ```
diff --git a/simple_ai_agents/mastra_ai_weather_agent/index.ts b/simple_ai_agents/mastra_ai_weather_agent/index.ts
new file mode 100644
index 00000000..d747db4a
--- /dev/null
+++ b/simple_ai_agents/mastra_ai_weather_agent/index.ts
@@ -0,0 +1,130 @@
+import 'dotenv/config';
+import { openai } from '@ai-sdk/openai';
+import { createTool, Agent, Mastra } from '@mastra/core';
+import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
+import { z } from 'zod';
+
+const nebius = createOpenAICompatible({
+  name: "nebius",
+  apiKey: process.env.NEBIUS_API_KEY,
+  baseURL: "https://api.studio.nebius.com/v1/",
+});
+
+const model = "meta-llama/Meta-Llama-3.1-405B-Instruct";
+
+interface WeatherResponse {
+  current: {
+    time: string;
+    temperature_2m: number;
+    apparent_temperature: number;
+    relative_humidity_2m: number;
+    wind_speed_10m: number;
+    wind_gusts_10m: number;
+    weather_code: number;
+  };
+}
+
+const weatherTool = createTool({
+  id: 'get-weather',
+  description: 'Get current weather for a location',
+  inputSchema: z.object({
+    location: z.string().describe('City name'),
+  }),
+  outputSchema: z.object({
+    temperature: z.number(),
+    feelsLike: z.number(),
+    humidity: z.number(),
+    windSpeed: z.number(),
+    windGust: z.number(),
+    conditions: z.string(),
+    location: z.string(),
+  }),
+  execute: async ({ context }) => {
+    return await getWeather(context.location);
+  },
+});
+
+const getWeather = async (location: string) => {
+  const geocodingUrl = `https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(location)}&count=1`;
+  const geocodingResponse = await fetch(geocodingUrl);
+  const geocodingData = await geocodingResponse.json();
+
+  if (!geocodingData.results?.[0]) {
+    throw new Error(`Location '${location}' not found`);
+  }
+
+  const { latitude, longitude, name } = geocodingData.results[0];
+
+  const weatherUrl = `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current=temperature_2m,apparent_temperature,relative_humidity_2m,wind_speed_10m,wind_gusts_10m,weather_code`;
+
+  const response = await fetch(weatherUrl);
+  const data: WeatherResponse = await response.json();
+
+  return {
+    temperature: data.current.temperature_2m,
+    feelsLike: data.current.apparent_temperature,
+    humidity: data.current.relative_humidity_2m,
+    windSpeed: data.current.wind_speed_10m,
+    windGust: data.current.wind_gusts_10m,
+    conditions: getWeatherCondition(data.current.weather_code),
+    location: name,
+  };
+};
+
+function getWeatherCondition(code: number): string {
+  const conditions: Record<number, string> = {
+    0: 'Clear sky',
+    1: 'Mainly clear',
+    2: 'Partly cloudy',
+    3: 'Overcast',
+    45: 'Foggy',
+    48: 'Depositing rime fog',
+    51: 'Light drizzle',
+    53: 'Moderate drizzle',
+    55: 'Dense drizzle',
+    56: 'Light freezing drizzle',
+    57: 'Dense freezing drizzle',
+    61: 'Slight rain',
+    63: 'Moderate rain',
+    65: 'Heavy rain',
+    66: 'Light freezing rain',
+    67: 'Heavy freezing rain',
+    71: 'Slight snow fall',
+    73: 'Moderate snow fall',
+    75: 'Heavy snow fall',
+    77: 'Snow grains',
+    80: 'Slight rain showers',
+    81: 'Moderate rain showers',
+    82: 'Violent rain showers',
+    85: 'Slight snow showers',
+    86: 'Heavy snow showers',
+    95: 'Thunderstorm',
+    96: 'Thunderstorm with slight hail',
+    99: 'Thunderstorm with heavy hail',
+  };
+  return conditions[code] || 'Unknown';
+}
+
+const weatherAgent = new Agent({
+  name: 'Weather Agent',
+  instructions: `You are a helpful weather assistant that provides accurate weather information.
+Your primary function is to help users get weather details for specific locations. When responding:
+- Always ask for a location if none is provided - If the location name isn't in English, please translate it - If giving a location with multiple parts (e.g. "New York, NY"), use the most relevant part (e.g. "New York")
+- Include relevant details like humidity, wind conditions, and precipitation
+- Keep responses concise but informative
+Use the weatherTool to fetch current weather data.`,
+  model: nebius(model),
+  tools: { weatherTool },
+});
+
+const mastra = new Mastra({
+  agents: { weatherAgent },
+});
+
+async function main() {
+  const agent = mastra.getAgent('weatherAgent');
+  const result = await agent.generate('What is the weather in London?');
+  console.log(result.text);
+}
+
+main();
diff --git a/simple_ai_agents/mastra_ai_weather_agent/package.json b/simple_ai_agents/mastra_ai_weather_agent/package.json
new file mode 100644
index 00000000..69412db1
--- /dev/null
+++ b/simple_ai_agents/mastra_ai_weather_agent/package.json
@@ -0,0 +1,17 @@
+{
+  "name": "examples-using-a-tool",
+  "type": "module",
+  "private": true,
+  "scripts": {
+    "start": "pnpx tsx index.ts"
+  },
+  "dependencies": {
+    "@ai-sdk/openai": "latest",
+    "@ai-sdk/openai-compatible": "^0.2.14",
+    "@mastra/core": "latest",
+    "dotenv": "^16.4.5",
+    "zod": "^3.24.3"
+  },
+  "version": "0.0.1",
+  "packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
+}
diff --git a/simple_ai_agents/mastra_ai_weather_agent/pnpm-lock.yaml b/simple_ai_agents/mastra_ai_weather_agent/pnpm-lock.yaml
new file mode 100644
index 00000000..57a1ca2b
--- /dev/null
+++ b/simple_ai_agents/mastra_ai_weather_agent/pnpm-lock.yaml
@@ -0,0 +1,81 @@
+lockfileVersion: '9.0'
+
+settings:
+  autoInstallPeers: true
+  excludeLinksFromLockfile: false
+
+overrides:
+  '@mastra/core': link:../../../../packages/core
+
+importers:
+
+  .:
+    dependencies:
+      '@ai-sdk/openai':
+        specifier: latest
+        version: 1.3.17(zod@3.24.3)
+      '@mastra/core':
+        specifier: link:../../../../packages/core
+        version: link:../../../../packages/core
+      zod:
+        specifier: ^3.24.3
+        version: 3.24.3
+
+packages:
+
+  '@ai-sdk/openai@1.3.17':
+    resolution: {integrity: sha512-ge94OcFLfmc1eTBA1b7ubHMRLJ98HZwnD0B3gcE25Y/lZ7ctLbihdn3wgwu9R6ZVD2/jgc73vrjyOL2+lmsoYw==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      zod: ^3.0.0
+
+  '@ai-sdk/provider-utils@2.2.7':
+    resolution: {integrity: sha512-kM0xS3GWg3aMChh9zfeM+80vEZfXzR3JEUBdycZLtbRZ2TRT8xOj3WodGHPb06sUK5yD7pAXC/P7ctsi2fvUGQ==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      zod: ^3.23.8
+
+  '@ai-sdk/provider@1.1.3':
+    resolution: {integrity: sha512-qZMxYJ0qqX/RfnuIaab+zp8UAeJn/ygXXAffR5I4N0n1IrvA6qBsjc8hXLmBiMV2zoXlifkacF7sEFnYnjBcqg==}
+    engines: {node: '>=18'}
+
+  json-schema@0.4.0:
+    resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==}
+
+  nanoid@3.3.11:
+    resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}
+    engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
+    hasBin: true
+
+  secure-json-parse@2.7.0:
+    resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==}
+
+  zod@3.24.3:
+    resolution: {integrity: sha512-HhY1oqzWCQWuUqvBFnsyrtZRhyPeR7SUGv+C4+MsisMuVfSPx8HpwWqH8tRahSlt6M3PiFAcoeFhZAqIXTxoSg==}
+
+snapshots:
+
+  '@ai-sdk/openai@1.3.17(zod@3.24.3)':
+    dependencies:
+      '@ai-sdk/provider': 1.1.3
+      '@ai-sdk/provider-utils': 2.2.7(zod@3.24.3)
+      zod: 3.24.3
+
+  '@ai-sdk/provider-utils@2.2.7(zod@3.24.3)':
+    dependencies:
+      '@ai-sdk/provider': 1.1.3
+      nanoid: 3.3.11
+      secure-json-parse: 2.7.0
+      zod: 3.24.3
+
+  '@ai-sdk/provider@1.1.3':
+    dependencies:
+      json-schema: 0.4.0
+
+  json-schema@0.4.0: {}
+
+  nanoid@3.3.11: {}
+
+  secure-json-parse@2.7.0: {}
+
+  zod@3.24.3: {}


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 6**

<details>
<summary>🧹 Nitpick comments (3)</summary><blockquote>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/main.ipynb (1)</summary><blockquote>

`10-18`: **Add docstrings and comments to explain the notebook's purpose**

Adding a docstring at the beginning of the notebook would help users understand the purpose and requirements of this demo.

```diff
import asyncio
import os
import shutil

+# This notebook demonstrates the integration of an AI agent with a Couchbase database 
+# using the Model Context Protocol (MCP) and OpenAI Agents SDK.
+# Requirements:
+# - A running Couchbase server with the travel-sample dataset
+# - The mcp-server-couchbase project installed
+# - NebiusAI API key in the .env file

from agents import Agent, Runner, gen_trace_id, trace, OpenAIChatCompletionsModel
from agents.mcp import MCPServer, MCPServerStdio
from openai import AsyncOpenAI
from dotenv import load_dotenv
load_dotenv()
```

</blockquote></details>
<details>
<summary>mcp_ai_agents/couchbase_mcp_server/README.md (2)</summary><blockquote>

`34-51`: **Fix Markdown list indentation for better readability**

The Markdown lists are using 4-space indentation which is inconsistent with standard Markdown style. Consider using 2-space indentation for better compatibility with Markdown renderers.

```diff
### 3.1. Core Components:

-*   **`main.ipynb`:**
-    *   The main Jupyter notebook that orchestrates the demonstration.
-    *   It imports necessary libraries, including `agents` and `agents.mcp`.
-    *   Defines the AI agent's configuration and the questions to be asked.
-    *   Manages the lifecycle of the MCP server connection.
+* **`main.ipynb`:**
+  * The main Jupyter notebook that orchestrates the demonstration.
+  * It imports necessary libraries, including `agents` and `agents.mcp`.
+  * Defines the AI agent's configuration and the questions to be asked.
+  * Manages the lifecycle of the MCP server connection.
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 LanguageTool</summary>

[uncategorized] ~36-~36: Loose punctuation mark.
Context: ....1. Core Components:  *   **`main.ipynb`:**     *   The main Jupyter notebook tha...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~45-~45: Loose punctuation mark.
Context: ...ility. *   **`agents.mcp.MCPServerStdio`:**     *   A component used to establish...

(UNLIKELY_OPENING_PUNCTUATION)

</details>
<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

34-34: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

---

37-37: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

38-38: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

39-39: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

40-40: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

42-42: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

43-43: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

44-44: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

46-46: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

47-47: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

49-49: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

50-50: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

51-51: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

</details>

</details>

---

`34-34`: **Remove trailing punctuation from section headings**

For consistent Markdown style, remove trailing colons from section headings.

```diff
-### 3.1. Core Components:
+### 3.1. Core Components

-### 3.2. Workflow:
+### 3.2. Workflow

-### 3.3. Database Interaction Details:
+### 3.3. Database Interaction Details

-### 3.4. Setting Up and Running the Demo:
+### 3.4. Setting Up and Running the Demo
```


Also applies to: 53-53, 85-85, 92-92

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

34-34: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

</details>

</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 4096abcc70d4ce9132a8587a4727aed100e35275 and ca7ad5897c3bb1d55fa85cd7723fc335125591db.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `mcp_ai_agents/couchbase_mcp_server/README.md` (1 hunks)
* `mcp_ai_agents/couchbase_mcp_server/main.ipynb` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/README.md</summary>

[uncategorized] ~22-~22: Possible missing comma found.
Context: ...es LLMs to not just retrieve information but also to use external tools and trigger ...

(AI_HYDRA_LEO_MISSING_COMMA)

---

[uncategorized] ~28-~28: Possible missing comma found.
Context: ...upported by SDKs in various programming languages to facilitate the development of MCP cl...

(AI_HYDRA_LEO_MISSING_COMMA)

---

[uncategorized] ~36-~36: Loose punctuation mark.
Context: ....1. Core Components:  *   **`main.ipynb`:**     *   The main Jupyter notebook tha...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~45-~45: Loose punctuation mark.
Context: ...ility. *   **`agents.mcp.MCPServerStdio`:**     *   A component used to establish...

(UNLIKELY_OPENING_PUNCTUATION)

</details>

</details>
<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/README.md</summary>

25-25: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

26-26: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

34-34: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

---

37-37: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

38-38: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

39-39: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

40-40: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

42-42: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

43-43: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

44-44: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

46-46: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

47-47: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

49-49: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

50-50: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

51-51: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

53-53: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

---

85-85: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

---

92-92: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

</details>

</details>

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T00:12:57Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 5**

<details>
<summary>🔭 Outside diff range comments (1)</summary><blockquote>

<details>
<summary>simple_ai_agents/mastra_ai_weather_agent/index.ts (1)</summary><blockquote>

`1-131`: _💡 Verification agent_

<details>
<summary>🧩 Analysis chain</summary>

**Verify environment variable availability.**

Ensure that the required environment variables are available before using them to prevent runtime errors.



Add environment variable validation at the beginning of the file:

```diff
import 'dotenv/config';
import { openai } from '@ai-sdk/openai';
import { createTool, Agent, Mastra } from '@mastra/core';
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { z } from 'zod';

+// Validate required environment variables
+if (!process.env.NEBIUS_API_KEY) {
+  throw new Error('NEBIUS_API_KEY environment variable is required');
+}
+
+if (!process.env.OPENAI_API_KEY) {
+  throw new Error('OPENAI_API_KEY environment variable is required');
+}

const nebius = createOpenAICompatible({
```

Run the following script to verify the environment variable usage:

---

🏁 Script executed:

```shell
#!/bin/bash
# Description: Check for environment variables usage and validation in the codebase

# Search for environment variable usage
rg -A 3 -B 3 "process\.env\." --type ts
```

Length of output: 541

---



</details>

**Validate NEBIUS_API_KEY at startup**

Ensure we guard against a missing Nebius API key to avoid runtime errors. Since this file only uses process.env.NEBIUS_API_KEY, you only need to validate that one. If you end up using the imported `openai` client here, add its validation then; otherwise, you can safely remove that unused import.

Affected file:
- simple_ai_agents/mastra_ai_weather_agent/index.ts (add at top, after imports)

Suggested diff:
```diff
 import 'dotenv/config';
 import { openai } from '@ai-sdk/openai';
 import { createTool, Agent, Mastra } from '@mastra/core';
 import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
 import { z } from 'zod';

+// Validate required environment variables
+if (!process.env.NEBIUS_API_KEY) {
+  throw new Error('NEBIUS_API_KEY environment variable is required');
+}

 const nebius = createOpenAICompatible({
   name: "nebius",
   apiKey: process.env.NEBIUS_API_KEY,
   baseURL: "https://api.studio.nebius.com/v1/",
 });
```

</blockquote></details>

</blockquote></details>

<details>
<summary>♻️ Duplicate comments (1)</summary><blockquote>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/README.md (1)</summary><blockquote>

`96-109`: **Add explicit installation steps** 

The **Prerequisites** section lists required tools but doesn’t instruct users how to install them. As noted in a previous review, an **Installation Steps** subsection will streamline onboarding. For example:
```md
#### Installation Steps

1. Clone this repo:
   ```bash
   git clone https://github.com/Arindam200/awesome-ai-apps.git
   cd mcp_ai_agents/couchbase_mcp_server
   ```
2. Create and activate a virtual environment:
   ```bash
   python -m venv venv && source venv/bin/activate
   ```
3. Install Python dependencies:
   ```bash
   pip install jupyter openai agents-protocol python-dotenv
   ```
```
Please include similar guidance before “Running the Demo.”

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (6)</summary><blockquote>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/README.md (4)</summary><blockquote>

`1-2`: **Clarify and correct the title**

The top‐level heading currently reads:
```md
# Couchbase MCP OpenAI Agents SDK Demo with Nebius 
```
- The trailing word “Nebius” is ambiguous in this Couchbase‐focused demo.
- If NebiusAI isn’t part of this example, consider removing it; otherwise, rename to “NebiusAI” and briefly explain its role.

---

`19-27`: **Unify list indentation for readability**

The bullet lists under **Key Goals and Features of MCP** use inconsistent indentation (4 spaces vs. 2). For example:
```md
*   **Standardized Communication:** ...
    *   **MCP Hosts/Clients:** ...
```
Please standardize to 2 spaces for top‐level lists and 4 spaces for nested lists:
```diff
- *   **Standardized Communication:** MCP provides...
+ * **Standardized Communication:** MCP provides...
  * **MCP Hosts/Clients:** Applications...
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

25-25: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

26-26: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

</details>

</details>

---

`34-34`: **Remove trailing punctuation from subheadings**

Markdown linting flags trailing colons in subheadings. For consistency, drop the colon at the end of each:
```diff
- ### 3.1. Core Components:
+ ### 3.1. Core Components

- ### 3.2. Workflow:
+ ### 3.2. Workflow

- ### 3.3. Database Interaction Details:
+ ### 3.3. Database Interaction Details

- ### 3.4. Setting Up and Running the Demo:
+ ### 3.4. Setting Up and Running the Demo
```



Also applies to: 53-53, 85-85, 92-92

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

34-34: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

</details>

</details>

---

`101-107`: **Dedent the `.env` code block for proper rendering**

The env example is indented, which may prevent the fence from rendering correctly:
```md
    ```env
    COUCHBASE_HOST=...
    ...
    ```
```
Remove the leading spaces so that the fences sit at the root level:
```diff
-    ```env
-    COUCHBASE_HOST=your_couchbase_host
-    ...
-    ```
+```env
+COUCHBASE_HOST=your_couchbase_host
+COUCHBASE_BUCKET_NAME=your_bucket_name
+COUCHBASE_USERNAME=your_couchbase_username
+COUCHBASE_PASSWORD=your_couchbase_password
+# Add any other variables required by mcp-server-couchbase
+```
```

</blockquote></details>
<details>
<summary>simple_ai_agents/mastra_ai_weather_agent/README.md (1)</summary><blockquote>

`28-30`: **Fix markdown formatting issue.**

The fenced code block is missing a language specification, which is flagged by the linter.



Add language specification to the code block:

```diff
-   ```
+   ```bash
   pnpm install
   ```
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

28-28: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

</details>

</details>

</blockquote></details>
<details>
<summary>simple_ai_agents/mastra_ai_weather_agent/index.ts (1)</summary><blockquote>

`110-112`: **Fix formatting issue in agent instructions.**

The instructions have a formatting issue where multiple points are on the same line, making them hard to read.



Fix the formatting of the instructions:

```diff
  instructions: `You are a helpful weather assistant that provides accurate weather information.

Your primary function is to help users get weather details for specific locations. When responding:
- Always ask for a location if none is provided
- If the location name isn't in English, please translate it
- If giving a location with multiple parts (e.g. "New York, NY"), use the most relevant part (e.g. "New York")
- Include relevant details like humidity, wind conditions, and precipitation
- Keep responses concise but informative

Use the weatherTool to fetch current weather data.`,
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between ca7ad5897c3bb1d55fa85cd7723fc335125591db and 9ea8f4b8db8176ba163d404709067da97bbed8d2.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `simple_ai_agents/mastra_ai_weather_agent/pnpm-lock.yaml` is excluded by `!**/pnpm-lock.yaml`

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `mcp_ai_agents/couchbase_mcp_server/README.md` (1 hunks)
* `simple_ai_agents/mastra_ai_weather_agent/.env.example` (1 hunks)
* `simple_ai_agents/mastra_ai_weather_agent/README.md` (1 hunks)
* `simple_ai_agents/mastra_ai_weather_agent/index.ts` (1 hunks)
* `simple_ai_agents/mastra_ai_weather_agent/package.json` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (2)</summary>

* simple_ai_agents/mastra_ai_weather_agent/.env.example
* simple_ai_agents/mastra_ai_weather_agent/package.json

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/README.md</summary>

[uncategorized] ~28-~28: Possible missing comma found.
Context: ...upported by SDKs in various programming languages to facilitate the development of MCP cl...

(AI_HYDRA_LEO_MISSING_COMMA)

---

[uncategorized] ~36-~36: Loose punctuation mark.
Context: ....1. Core Components:  *   **`main.ipynb`:**     *   The main Jupyter notebook tha...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~45-~45: Loose punctuation mark.
Context: ...ility. *   **`agents.mcp.MCPServerStdio`:**     *   A component used to establish...

(UNLIKELY_OPENING_PUNCTUATION)

</details>

</details>
<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/README.md</summary>

25-25: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

26-26: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

34-34: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

---

37-37: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

38-38: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

39-39: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

40-40: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

42-42: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

43-43: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

44-44: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

46-46: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

47-47: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

49-49: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

50-50: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

51-51: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

53-53: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

---

85-85: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

---

92-92: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

</details>
<details>
<summary>simple_ai_agents/mastra_ai_weather_agent/README.md</summary>

28-28: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (2)</summary><blockquote>

<details>
<summary>simple_ai_agents/mastra_ai_weather_agent/index.ts (2)</summary>

`7-11`: **LGTM! Proper API configuration.**

The Nebius API client is correctly configured with environment variable and proper base URL.

---

`74-106`: **LGTM! Comprehensive weather condition mapping.**

The weather condition mapping covers a wide range of WMO weather codes and provides descriptive strings. The fallback to 'Unknown' is appropriate.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T08:11:12Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 1**

<details>
<summary>♻️ Duplicate comments (1)</summary><blockquote>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/README.md (1)</summary><blockquote>

`94-99`: **Add installation instructions after prerequisites.**

The “Prerequisites” section lists required tools but doesn’t show how to install them. Please insert an “Installation Steps” subsection containing commands to:
1. Clone the `mcp-server-couchbase` repo.  
2. Install Python packages (e.g., `pip install jupyter openai agents-protocol python-dotenv`).  
3. Any other setup needed before running the demo.

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (5)</summary><blockquote>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/README.md (5)</summary><blockquote>

`22-22`: **Improve readability with a comma.**

Add a comma after “retrieve information” for natural phrasing:
```diff
- ...to not just retrieve information but also to use external tools and trigger actions...
+ ...to not just retrieve information, but also to use external tools and trigger actions...
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 LanguageTool</summary>

[uncategorized] ~22-~22: Possible missing comma found.
Context: ...es LLMs to not just retrieve information but also to use external tools and trigger ...

(AI_HYDRA_LEO_MISSING_COMMA)

</details>

</details>

---

`34-34`: **Remove trailing colon from heading.**

Markdown style guidelines recommend omitting trailing punctuation in headings. Update:
```diff
- ### 3.1. Core Components:
+ ### 3.1. Core Components
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

34-34: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

</details>

</details>

---

`85-85`: **Remove trailing colon from heading.**

Avoid trailing punctuation in headings for consistency:
```diff
- ### 3.3. Database Interaction Details:
+ ### 3.3. Database Interaction Details
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

85-85: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

</details>

</details>

---

`92-92`: **Remove trailing colon from heading.**

Drop the colon to comply with Markdown best practices:
```diff
- ### 3.4. Setting Up and Running the Demo:
+ ### 3.4. Setting Up and Running the Demo
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

92-92: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

</details>

</details>

---

`100-109`: **Explain the `NEBIUS_API_KEY` environment variable.**

The sample `.env` includes `NEBIUS_API_KEY`, but its purpose isn’t documented. Add a brief note under “Prerequisites” clarifying how the Nebius AI service is used in this demo.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 9ea8f4b8db8176ba163d404709067da97bbed8d2 and 95a2876ba62980d7a6f510349e319939caa1fdcf.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `mcp_ai_agents/couchbase_mcp_server/README.md` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/README.md</summary>

[uncategorized] ~22-~22: Possible missing comma found.
Context: ...es LLMs to not just retrieve information but also to use external tools and trigger ...

(AI_HYDRA_LEO_MISSING_COMMA)

---

[uncategorized] ~28-~28: Possible missing comma found.
Context: ...upported by SDKs in various programming languages to facilitate the development of MCP cl...

(AI_HYDRA_LEO_MISSING_COMMA)

---

[uncategorized] ~36-~36: Loose punctuation mark.
Context: ....1. Core Components:  *   **`main.ipynb`:**     *   The main Jupyter notebook tha...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~45-~45: Loose punctuation mark.
Context: ...ility. *   **`agents.mcp.MCPServerStdio`:**     *   A component used to establish...

(UNLIKELY_OPENING_PUNCTUATION)

</details>

</details>
<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/README.md</summary>

25-25: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

26-26: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

34-34: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

---

37-37: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

38-38: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

39-39: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

40-40: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

42-42: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

43-43: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

44-44: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

46-46: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

47-47: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

49-49: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

50-50: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

51-51: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

---

53-53: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

---

85-85: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

---

92-92: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

</details>

</details>

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T08:17:17Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 2**

<details>
<summary>♻️ Duplicate comments (2)</summary><blockquote>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/main.ipynb (2)</summary><blockquote>

`40-65`: _⚠️ Potential issue_

**Previous issue remains: Missing error handling in qna function**

The function still lacks error handling for `Runner.run` calls as noted in the previous review. If any query fails, the entire process will crash without graceful error reporting.




```diff
 async def qna(agent):
+    async def run_query(message):
+        try:
+            print(f"Running: {message}")
+            result = await Runner.run(starting_agent=agent, input=message)
+            print(result.final_output)
+            return result
+        except Exception as e:
+            print(f"Error processing query '{message}': {e}")
+            return None
+
     message = "Tell me about the database that you are connected to."
-    print(f"Running: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
+    await run_query(message)

     message = "List out the top 5 hotels by the highest aggregate rating?"
-    print(f"\n\nRunning: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
+    print("\n\n")
+    await run_query(message)

     message = "Recommend me a flight and hotel from New York to San Francisco"
-    print(f"\n\nRunning: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
+    print("\n\n")
+    await run_query(message)

     message = "I'm going to the UK for 1 week. Recommend some great spots to visit for sightseeing. Also mention the respective prices of those places for adults and kids."
-    print(f"\n\nRunning: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
+    print("\n\n")
+    await run_query(message)

     message = "My budget is around 30 pounds a night. What will be the best hotel to stay in?"
-    print(f"\n\nRunning: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
+    print("\n\n")
+    await run_query(message)
```

---

`294-302`: _⚠️ Potential issue_

**Previous issue remains: Hardcoded absolute paths need to be removed**

The notebook still contains hardcoded absolute paths that are specific to the developer's local environment, making it impossible for other users to run without manual modifications.




```diff
     params={
-        "command": "/Users/shivaylamba/miniconda3/bin/uv",
-        "args": ["--directory", "/Users/shivaylamba/Documents/work/mcp-server-couchbase",
+        "command": "uv",
+        "args": ["--directory", "./mcp-server-couchbase",
                     "run",
-                    "--env-file", "/Users/shivaylamba/Documents/work/MCPCouchbaseDemo/src/.env",
+                    "--env-file", "./.env",
                 "src/mcp_server.py"],
     }
```

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>mcp_ai_agents/couchbase_mcp_server/main.ipynb (2)</summary><blockquote>

`77-116`: **Refactor lengthy agent instructions for better maintainability**

The agent instructions are quite lengthy and embedded directly in the code, making them hard to maintain and read.



Consider extracting the instructions to a separate variable or file:

```diff
+COUCHBASE_INSTRUCTIONS = """Couchbase organizes data with the following hierarchy (from top to bottom):
+
+1. Cluster
+The overall container of all Couchbase data and services.
+
+2. Bucket
+A bucket is similar to a database in traditional systems.
+Each bucket contains multiple scopes.
+Example: "users", "analytics", "products"
+
+3. Scope
+A scope is a namespace within a bucket that groups collections.
+Scopes help isolate data for different microservices or tenants.
+Default scope name: _default
+
+4. Collection
+The equivalent of a table in relational databases.
+Collections store JSON documents.
+Default collection name: _default
+
+5. Document
+The atomic data unit (usually JSON) stored in a collection.
+Each document has a unique key within its collection.
+
+Use the tools to read the database answer questions based on this database.
+The data is inside `inventory` scope, so use only that scope.
+Any query you generate needs to have only the collection name in the FROM clause.
+Every field, collection, scope or bucket name inside the query should be inside backticks."""
+
 async def run(mcp_server: MCPServer):
     agent = Agent(
         name="Assistant",
-        instructions="""Couchbase organizes data with the following hierarchy (from top to bottom):
-                        1. Cluster
-                        The overall container of all Couchbase data and services.
-                        2. Bucket
-                        A bucket is similar to a database in traditional systems.
-                        Each bucket contains multiple scopes.
-                        Example: "users", "analytics", "products"
-                        3. Scope
-                        A scope is a namespace within a bucket that groups collections.
-                        Scopes help isolate data for different microservices or tenants.
-                        Default scope name: _default
-                        4. Collection
-                        The equivalent of a table in relational databases.
-                        Collections store JSON documents.
-                        Default collection name: _default
-                        5. Document
-                        The atomic data unit (usually JSON) stored in a collection.
-                        Each document has a unique key within its collection.
-                        Use the tools to read the database answer questions based on this database.
-                        The data is inside `inventory` scope, so use only that scope.
-                        Any query you generate needs to have only the collection name in the FROM clause.
-                        Every field, collection, scope or bucket name inside the query should be inside backticks.""",
+        instructions=COUCHBASE_INSTRUCTIONS,
```

---

`40-65`: **Refactor repetitive code in qna function**

The function has repetitive patterns that could be simplified using a loop or helper function.



```diff
 async def qna(agent):
-    message = "Tell me about the database that you are connected to."
-    print(f"Running: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
-
-    message = "List out the top 5 hotels by the highest aggregate rating?"
-    print(f"\n\nRunning: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
-
-    message = "Recommend me a flight and hotel from New York to San Francisco"
-    print(f"\n\nRunning: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
-
-    message = "I'm going to the UK for 1 week. Recommend some great spots to visit for sightseeing. Also mention the respective prices of those places for adults and kids."
-    print(f"\n\nRunning: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
-
-    message = "My budget is around 30 pounds a night. What will be the best hotel to stay in?"
-    print(f"\n\nRunning: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
+    queries = [
+        "Tell me about the database that you are connected to.",
+        "List out the top 5 hotels by the highest aggregate rating?",
+        "Recommend me a flight and hotel from New York to San Francisco",
+        "I'm going to the UK for 1 week. Recommend some great spots to visit for sightseeing. Also mention the respective prices of those places for adults and kids.",
+        "My budget is around 30 pounds a night. What will be the best hotel to stay in?"
+    ]
+    
+    for i, message in enumerate(queries):
+        if i > 0:
+            print("\n\n")
+        print(f"Running: {message}")
+        try:
+            result = await Runner.run(starting_agent=agent, input=message)
+            print(result.final_output)
+        except Exception as e:
+            print(f"Error processing query: {e}")
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 95a2876ba62980d7a6f510349e319939caa1fdcf and 64245cfb49ba486012254f2a3c61dae8e20c08e1.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `mcp_ai_agents/couchbase_mcp_server/main.ipynb` (1 hunks)

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-23T08:19:27Z
user: login: Arindam200
state: APPROVED
author_association: OWNER
submitted_at: 2025-05-23T12:33:00Z

Review comments:
diff_hunk: @@ -0,0 +1,342 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "id": "b64f1212",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import asyncio\n",
+    "import os\n",
+    "import shutil\n",
+    "\n",
+    "from agents import Agent, Runner, gen_trace_id, trace, OpenAIChatCompletionsModel\n",
+    "from agents.mcp import MCPServer, MCPServerStdio\n",
+    "from openai import AsyncOpenAI\n",
+    "from dotenv import load_dotenv\n",
+    "load_dotenv()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "5b63ccc3",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "api_key = os.environ[\"NEBIUS_API_KEY\"]\n",
+    "base_url = \"https://api.studio.nebius.ai/v1\" \n",
+    "client = AsyncOpenAI(base_url=base_url, api_key=api_key)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "id": "0c3a957e",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "async def qna(agent):\n",
+    "    message = \"Tell me about the database that you are connected to.\"\n",
+    "    print(f\"Running: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"List out the top 5 hotels by the highest aggregate rating?\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"Recommend me a flight and hotel from New York to San Francisco\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"I'm going to the UK for 1 week. Recommend some great spots to visit for sightseeing. Also mention the respective prices of those places for adults and kids.\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"My budget is around 30 pounds a night. What will be the best hotel to stay in?\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "id": "c8ed2f11",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "async def run(mcp_server: MCPServer):\n",
+    "    agent = Agent(\n",
+    "        name=\"Assistant\",\n",
+    "        instructions=\"\"\"Couchbase organizes data with the following hierarchy (from top to bottom):\n",
+    "\n",
+    "                        1. Cluster\n",
+    "\n",
+    "                        The overall container of all Couchbase data and services.\n",
+    "\n",
+    "                        2. Bucket\n",
+    "\n",
+    "                        A bucket is similar to a database in traditional systems.\n",
+    "\n",
+    "                        Each bucket contains multiple scopes.\n",
+    "\n",
+    "                        Example: \"users\", \"analytics\", \"products\"\n",
+    "\n",
+    "                        3. Scope\n",
+    "\n",
+    "                        A scope is a namespace within a bucket that groups collections.\n",
+    "\n",
+    "                        Scopes help isolate data for different microservices or tenants.\n",
+    "\n",
+    "                        Default scope name: _default\n",
+    "\n",
+    "                        4. Collection\n",
+    "\n",
+    "                        The equivalent of a table in relational databases.\n",
+    "\n",
+    "                        Collections store JSON documents.\n",
+    "\n",
+    "                        Default collection name: _default\n",
+    "\n",
+    "                        5. Document\n",
+    "\n",
+    "                        The atomic data unit (usually JSON) stored in a collection.\n",
+    "\n",
+    "                        Each document has a unique key within its collection.\n",
+    "\n",
+    "                        Use the tools to read the database answer questions based on this database.\n",
+    "                        The data is inside `inventory` scope, so use only that scope.\n",
+    "                        Any query you generate needs to have only the collection name in the FROM clause.\n",
+    "                        Every field, collection, scope or bucket name inside the query should be inside backticks.\"\"\",\n",
+    "         model=OpenAIChatCompletionsModel(\n",
+    "            model=\"meta-llama/Meta-Llama-3.1-8B-Instruct\",\n",
+    "            openai_client=client\n",
+    "        )\n",
+    "        mcp_servers=[mcp_server],\n",
+    "    )\n",
+    "\n",
+    "    await qna(agent=agent)\n",
+    "\n",
+    "    \n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "id": "e08f8d4c",
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Starting CouchbaseDemo\n",
+      "View trace: https://platform.openai.com/traces/trace?trace_id=trace_ab0900977661443e926dd61304dc06e0\n",
+      "\n",
+      "Running: Tell me about the database that you are connected to.\n",
+      "I am connected to a database that has the following organizational structure:\n",
+      "\n",
+      "- There are multiple scopes (namespaces), each containing collections (similar to tables in a SQL database).\n",
+      "- The main scope containing data of interest is called inventory.\n",
+      "\n",
+      "Within the inventory scope, there are five collections:\n",
+      "1. airport\n",
+      "2. airline\n",
+      "3. route\n",
+      "4. landmark\n",
+      "5. hotel\n",
+      "\n",
+      "Each collection stores data as JSON documents, and these collections likely cover information related to airports, airlines, travel routes, notable landmarks, and hotels.\n",
+      "\n",
+      "Other scopes, such as tenant_agent_00 to tenant_agent_04, seem to have collections related to users and bookings, possibly for a multi-tenant application. There are also default and system-specific scopes and collections.\n",
+      "\n",
+      "If you want to know about the structure or data in any particular collection, please specify which one!\n",
+      "\n",
+      "\n",
+      "Running: List out the top 5 hotels by the highest aggregate rating?\n",
+      "The top 5 hotels by highest aggregate (average) rating are:\n",
+      "\n",
+      "1. Belle Cour Hotel & SPA - 5.0\n",
+      "2. Lovett House Guest House - 5.0\n",
+      "3. Hotel del Coronado - 5.0\n",
+      "4. Hôtel Acacias Etoile - 5.0\n",
+      "5. Handlery Hotel - 5.0\n",
+      "\n",
+      "All of these hotels have an average \"Overall\" review rating of 5.0.\n",
+      "\n",
+      "\n",
+      "Running: Recommend me a flight and hotel from New York to San Francisco\n"
+     ]
+    },
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "Errored MCP tool result: meta=None content=[] isError=False\n"
+     ]
+    },
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Here are my recommendations for your trip from New York to San Francisco:\n",
+      "\n",
+      "Flight:\n",
+      "- Airline: Alaska Airlines (AS)\n",
+      "- Route: Nonstop from JFK (New York) to SFO (San Francisco)\n",
+      "- Sample Flight: AS717, departing at 01:41 UTC (other time options available through the week)\n",
+      "- Distance: Approx. 4,152 km\n",
+      "\n",
+      "Hotel in San Francisco:\n",
+      "- Name: Inn on Castro\n",
+      "- Address: 321 Castro St, San Francisco, California, United States\n",
+      "- Description: An upscale bed and breakfast in a restored house, located at 16th street.\n",
+      "- Amenities: Free internet, free parking, pet-friendly, no free breakfast.\n",
+      "- Website: [Inn on Castro](http://www.innoncastro.com/)\n",
+      "- Price range: $95–$190\n",
+      "- Phone: +1 415 861-0321\n",
+      "\n",
+      "Would you like more details or assistance with booking?\n",
+      "\n",
+      "\n",
+      "Running: I'm going to the UK for 1 week. Recommend some great spots to visit for sightseeing. Also mention the respective prices of those places for adults and kids.\n",
+      "Here are some great sightseeing spots in the UK (Glasgow) for your 1-week trip, along with prices for adults and kids where available:\n",
+      "\n",
+      "1. Glasgow Cathedral\n",
+      "   - Description: A magnificent Gothic cathedral dating from medieval times, built on a site first consecrated in 397AD. Nearby is the Necropolis, a historic and grand cemetery.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "2. City Chambers (George Square)\n",
+      "   - Description: An Italian Renaissance style building, headquarters of the City Council. Free daily tours showing stunning interiors.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "3. St Enoch Subway Station\n",
+      "   - Description: Historic subway station in a quaint building, currently used as a coffee shop, located in St Enoch Square.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "4. Glasgow Central Station\n",
+      "   - Description: Glasgow’s principal railway terminus, noted for its grand interior and the impressive glass-walled bridge known as the Hielanman's Umbrella.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "5. Glasgow School of Art (Mackintosh at the GSA Tour)\n",
+      "   - Description: One of Britain’s most important art schools. Although the original building is closed, external tours are available focusing on Mackintosh’s architecture.\n",
+      "   - Price: £9.75 adults, £8 students/seniors, £4.75 youth\n",
+      "\n",
+      "6. Mitchell Library\n",
+      "   - Description: The largest municipal public reference library in Europe with a stunning reading room. Great for book lovers.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "7. Glasgow University (Hunterian Museum and Art Gallery)\n",
+      "   - Description: Historic university (founded 1451), includes the excellent Hunterian Museum and Art Gallery, and impressive neo-Gothic architecture.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "8. Scotland Street School (Museum)\n",
+      "   - Description: Designed by Charles Rennie Mackintosh, features an excellent museum about Mackintosh and educational history.\n",
+      "   - Price: Free (for all ages)\n",
+      "\n",
+      "9. House for an Art Lover\n",
+      "   - Description: Built to Mackintosh’s original 1901 designs, with an excellent museum and beautiful surroundings. Includes audio handset guide.\n",
+      "   - Price: £4.50 adults, £3 youth/students\n",
+      "\n",
+      "10. Holmwood House\n",
+      "   - Description: A stunning example of Alexander ‘Greek’ Thomson’s work, run by the National Trust and currently being renovated.\n",
+      "   - Price: £6.50 adults, £16.50 family, £5 concession\n",
+      "\n",
+      "These attractions cover culture, history, and architecture—with many offering free entry! Be sure to check for updated prices and opening hours before your visit. If you need spots in other cities (like London), let me know!\n",
+      "\n",
+      "\n",
+      "Running: My budget is around 30 pounds a night. What will be the best hotel to stay in?\n",
+      "Here are some of the best hotel options in the UK for around £30 a night, along with notable features and guest feedback:\n",
+      "\n",
+      "---\n",
+      "### **1. Anis Louise Guest House, Chesterfield**\n",
+      "- **Price:** £27 per night\n",
+      "- **Address:** 34 Clarence Road, Chesterfield, United Kingdom\n",
+      "- **Facilities:** Free breakfast, free internet, pets not allowed, no free parking\n",
+      "- **Reviews:** Not many available, but it's the best fit for your budget in the UK and appears clean and straightforward.\n",
+      "\n",
+      "**Recommendation:** If your priority is value, cleanliness, and location over luxury, this is your best choice for under £30/night.\n",
+      "\n",
+      "---\n",
+      "\n",
+      "### **2. Tan yr Eglwys Cottages, Pontardawe (Budget option, but with strong caveats)**\n",
+      "- **Price:** £ (exact amount unclear, but marked as pound-priced and likely budget—verify final price before booking)\n",
+      "- **Address:** Church Road, Cilybebyll, Pontardawe, SA8 3JR, United Kingdom\n",
+      "- **Facilities:** Free breakfast, free parking, pets allowed, no free internet\n",
+      "- **Reviews:** Mixed, averaging very poor to average. Some guests report cleanliness and facilities issues, others felt it was tolerable given the price.\n",
+      "\n",
+      "**Recommendation:** Only choose if you are highly budget-restricted and everywhere else is unavailable—but reviews warn about subpar conditions!\n",
+      "\n",
+      "---\n",
+      "\n",
+      "### **3. Other Notable Options (Above Budget)**\n",
+      "If you're able to stretch a bit above £30:\n",
+      "- **La Reserve Hotel Chelsea, London** – £95, great staff and facilities according to reviews.\n",
+      "- **Hotel Sergul, London** – £40, but mixed reviews on comfort and amenities.\n",
+      "- **Magazine Wood B&B, Norfolk** – £40, nice environment and guest comfort, but just over your budget.\n",
+      "\n",
+      "---\n",
+      "\n",
+      "### **Summary**\n",
+      "Your best bet **under £30 is Anis Louise Guest House in Chesterfield**—it fits your budget, offers free breakfast and WiFi, and has no significant negative reviews.\n",
+      "\n",
+      "If you book here, you’ll have a reliable, no-nonsense stay within your budget. If you need something in London or other big cities, consider stretching your budget a little or look for hostels/guesthouses with similar pricing but read reviews carefully.\n",
+      "\n",
+      "Would you like more details or booking info for any hotel above?\n"
+     ]
+    }
+   ],
+   "source": [
+    "async with MCPServerStdio(\n",
+    "    params={\n",
+    "        \"command\": \"/Users/shivaylamba/miniconda3/bin/uv\",\n",
+    "        \"args\": [\"--directory\", \"/Users/shivaylamba/Documents/work/mcp-server-couchbase\",\n",
+    "                    \"run\",\n",
+    "                    \"--env-file\", \"/Users/shivaylamba/Documents/work/MCPCouchbaseDemo/src/.env\",\n",
+    "                \"src/mcp_server.py\"],\n",
+    "    }\n",
+    ") as server:\n",
path: mcp_ai_agents/couchbase_mcp_server/main.ipynb
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Remove hardcoded local paths**

The notebook contains hardcoded absolute paths that are specific to your local environment. This will prevent other users from running the demo without manually modifying these paths.

```diff
    params={
-        "command": "/Users/shivaylamba/miniconda3/bin/uv",
-        "args": ["-directory", "/Users/shivaylamba/Documents/work/mcp-server-couchbase",
+        "command": "uv", # Consider using a relative path or environment variable
+        "args": ["--directory", "./mcp-server-couchbase", # Use relative paths
                    "run",
-                   "--env-file", "/Users/shivaylamba/Documents/work/MCPCouchbaseDemo/src/.env",
+                   "--env-file", "./.env", # Use relative path
                "src/mcp_server.py"],
    }
```


> Committable suggestion skipped: line range outside the PR's diff.

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In mcp_ai_agents/couchbase_mcp_server/main.ipynb around lines 296 to 304,
replace the hardcoded absolute paths for the command, directory, and env-file
parameters with relative paths or configurable variables. This will make the
notebook portable and runnable by other users without requiring manual path
changes. Use environment variables or path joining functions to dynamically
construct these paths based on the current working directory or project root.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T00:12:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,342 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "id": "b64f1212",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import asyncio\n",
+    "import os\n",
+    "import shutil\n",
+    "\n",
+    "from agents import Agent, Runner, gen_trace_id, trace, OpenAIChatCompletionsModel\n",
+    "from agents.mcp import MCPServer, MCPServerStdio\n",
+    "from openai import AsyncOpenAI\n",
+    "from dotenv import load_dotenv\n",
+    "load_dotenv()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "5b63ccc3",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "api_key = os.environ[\"NEBIUS_API_KEY\"]\n",
+    "base_url = \"https://api.studio.nebius.ai/v1\" \n",
+    "client = AsyncOpenAI(base_url=base_url, api_key=api_key)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "id": "0c3a957e",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "async def qna(agent):\n",
+    "    message = \"Tell me about the database that you are connected to.\"\n",
+    "    print(f\"Running: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"List out the top 5 hotels by the highest aggregate rating?\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"Recommend me a flight and hotel from New York to San Francisco\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"I'm going to the UK for 1 week. Recommend some great spots to visit for sightseeing. Also mention the respective prices of those places for adults and kids.\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"My budget is around 30 pounds a night. What will be the best hotel to stay in?\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)"
+   ]
path: mcp_ai_agents/couchbase_mcp_server/main.ipynb
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add error handling to the query function**

The `qna` function lacks error handling for the `Runner.run` calls. If any query fails, the entire process will crash without graceful error reporting.

```diff
async def qna(agent):
+    async def run_query(message):
+        try:
+            print(f"Running: {message}")
+            result = await Runner.run(starting_agent=agent, input=message)
+            print(result.final_output)
+            return result
+        except Exception as e:
+            print(f"Error processing query: {e}")
+            return None

    message = "Tell me about the database that you are connected to."
-    print(f"Running: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
+    await run_query(message)

    message = "List out the top 5 hotels by the highest aggregate rating?"
-    print(f"\n\nRunning: {message}")
-    result = await Runner.run(starting_agent=agent, input=message)
-    print(result.final_output)
+    print("\n\n")
+    await run_query(message)

    # Continue with the same pattern for other queries
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
async def qna(agent):
    async def run_query(message):
        try:
            print(f"Running: {message}")
            result = await Runner.run(starting_agent=agent, input=message)
            print(result.final_output)
            return result
        except Exception as e:
            print(f"Error processing query: {e}")
            return None

    message = "Tell me about the database that you are connected to."
    await run_query(message)

    message = "List out the top 5 hotels by the highest aggregate rating?"
    print("\n\n")
    await run_query(message)

    # Continue with the same pattern for other queries

    message = "Recommend me a flight and hotel from New York to San Francisco"
    print(f"\n\nRunning: {message}")
    result = await Runner.run(starting_agent=agent, input=message)
    print(result.final_output)

    message = "I'm going to the UK for 1 week. Recommend some great spots to visit for sightseeing. Also mention the respective prices of those places for adults and kids."
    print(f"\n\nRunning: {message}")
    result = await Runner.run(starting_agent=agent, input=message)
    print(result.final_output)

    message = "My budget is around 30 pounds a night. What will be the best hotel to stay in?"
    print(f"\n\nRunning: {message}")
    result = await Runner.run(starting_agent=agent, input=message)
    print(result.final_output)
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In mcp_ai_agents/couchbase_mcp_server/main.ipynb around lines 40 to 65, the
async function qna calls Runner.run multiple times without error handling, which
can cause the entire process to crash if any call fails. Wrap each Runner.run
call in a try-except block to catch exceptions, log or print an error message
indicating which query failed, and allow the function to continue running
subsequent queries gracefully.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T00:12:56Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,342 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "id": "b64f1212",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import asyncio\n",
+    "import os\n",
+    "import shutil\n",
+    "\n",
+    "from agents import Agent, Runner, gen_trace_id, trace, OpenAIChatCompletionsModel\n",
+    "from agents.mcp import MCPServer, MCPServerStdio\n",
+    "from openai import AsyncOpenAI\n",
+    "from dotenv import load_dotenv\n",
+    "load_dotenv()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "5b63ccc3",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "api_key = os.environ[\"NEBIUS_API_KEY\"]\n",
+    "base_url = \"https://api.studio.nebius.ai/v1\" \n",
+    "client = AsyncOpenAI(base_url=base_url, api_key=api_key)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "id": "0c3a957e",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "async def qna(agent):\n",
+    "    message = \"Tell me about the database that you are connected to.\"\n",
+    "    print(f\"Running: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"List out the top 5 hotels by the highest aggregate rating?\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"Recommend me a flight and hotel from New York to San Francisco\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"I'm going to the UK for 1 week. Recommend some great spots to visit for sightseeing. Also mention the respective prices of those places for adults and kids.\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"My budget is around 30 pounds a night. What will be the best hotel to stay in?\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "id": "c8ed2f11",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "async def run(mcp_server: MCPServer):\n",
+    "    agent = Agent(\n",
+    "        name=\"Assistant\",\n",
+    "        instructions=\"\"\"Couchbase organizes data with the following hierarchy (from top to bottom):\n",
+    "\n",
+    "                        1. Cluster\n",
+    "\n",
+    "                        The overall container of all Couchbase data and services.\n",
+    "\n",
+    "                        2. Bucket\n",
+    "\n",
+    "                        A bucket is similar to a database in traditional systems.\n",
+    "\n",
+    "                        Each bucket contains multiple scopes.\n",
+    "\n",
+    "                        Example: \"users\", \"analytics\", \"products\"\n",
+    "\n",
+    "                        3. Scope\n",
+    "\n",
+    "                        A scope is a namespace within a bucket that groups collections.\n",
+    "\n",
+    "                        Scopes help isolate data for different microservices or tenants.\n",
+    "\n",
+    "                        Default scope name: _default\n",
+    "\n",
+    "                        4. Collection\n",
+    "\n",
+    "                        The equivalent of a table in relational databases.\n",
+    "\n",
+    "                        Collections store JSON documents.\n",
+    "\n",
+    "                        Default collection name: _default\n",
+    "\n",
+    "                        5. Document\n",
+    "\n",
+    "                        The atomic data unit (usually JSON) stored in a collection.\n",
+    "\n",
+    "                        Each document has a unique key within its collection.\n",
+    "\n",
+    "                        Use the tools to read the database answer questions based on this database.\n",
+    "                        The data is inside `inventory` scope, so use only that scope.\n",
+    "                        Any query you generate needs to have only the collection name in the FROM clause.\n",
+    "                        Every field, collection, scope or bucket name inside the query should be inside backticks.\"\"\",\n",
+    "         model=OpenAIChatCompletionsModel(\n",
+    "            model=\"meta-llama/Meta-Llama-3.1-8B-Instruct\",\n",
+    "            openai_client=client\n",
+    "        )\n",
+    "        mcp_servers=[mcp_server],\n",
+    "    )\n",
+    "\n",
+    "    await qna(agent=agent)\n",
+    "\n",
+    "    \n"
path: mcp_ai_agents/couchbase_mcp_server/main.ipynb
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Syntax error in agent creation**

There's a missing comma at the end of line 120, before the `mcp_servers` parameter. This would cause a syntax error when running the notebook.

```diff
        model=OpenAIChatCompletionsModel(
            model="meta-llama/Meta-Llama-3.1-8B-Instruct",
            openai_client=client
-        )
+        ),
        mcp_servers=[mcp_server],
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
async def run(mcp_server: MCPServer):
    agent = Agent(
        name="Assistant",
        instructions="""Couchbase organizes data with the following hierarchy (from top to bottom):

                        1. Cluster

                        The overall container of all Couchbase data and services.

                        2. Bucket

                        A bucket is similar to a database in traditional systems.

                        Each bucket contains multiple scopes.

                        Example: "users", "analytics", "products"

                        3. Scope

                        A scope is a namespace within a bucket that groups collections.

                        Scopes help isolate data for different microservices or tenants.

                        Default scope name: _default

                        4. Collection

                        The equivalent of a table in relational databases.

                        Collections store JSON documents.

                        Default collection name: _default

                        5. Document

                        The atomic data unit (usually JSON) stored in a collection.

                        Each document has a unique key within its collection.

                        Use the tools to read the database answer questions based on this database.
                        The data is inside `inventory` scope, so use only that scope.
                        Any query you generate needs to have only the collection name in the FROM clause.
                        Every field, collection, scope or bucket name inside the query should be inside backticks.""",
        model=OpenAIChatCompletionsModel(
            model="meta-llama/Meta-Llama-3.1-8B-Instruct",
            openai_client=client
        ),
        mcp_servers=[mcp_server],
    )

    await qna(agent=agent)
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In mcp_ai_agents/couchbase_mcp_server/main.ipynb between lines 74 and 126, there
is a missing comma after the model parameter in the Agent constructor on line
120. Add a comma at the end of the line defining the model parameter to separate
it properly from the next parameter mcp_servers, fixing the syntax error.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T00:12:56Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,116 @@
+# Couchbase MCP OpenAI Agents SDK Demo with Nebius 
+
+## 1. Project Overview
+
+This project demonstrates the integration of a Large Language Model (LLM) with a Couchbase database using the Model Context Protocol (MCP) and the OpenAI Agents SDK. It showcases how an AI agent can understand natural language queries, interact with a Couchbase instance to retrieve or manipulate data, and provide meaningful responses. This demo specifically focuses on querying a sample database `travel-sample` containing information about hotels, airports, airlines, routes, and landmarks, primarily within an `inventory` scope.
+
+Users can ask questions like:
+*   "List out the top 5 hotels by the highest aggregate rating?"
+*   "Recommend me a flight and hotel from New York to San Francisco."
+
+The project uses a Jupyter notebook (`main.ipynb`) to define and run the AI agent, which communicates with a Couchbase database via an MCP server.
+
+## 2. Introduction to Model Context Protocol (MCP)
+
+The Model Context Protocol (MCP) is an open standard designed to standardize how AI assistants and applications connect to and interact with external data sources, tools, and systems. Think of MCP as a universal adapter that allows AI models to seamlessly access the context they need to produce more relevant, accurate, and actionable responses.
+
+**Key Goals and Features of MCP:**
+
+*   **Standardized Communication:** MCP provides a common language and structure for AI models to communicate with diverse backend systems, replacing the need for numerous custom integrations.
+*   **Enhanced Context Management:** It helps manage the limited context windows of LLMs efficiently, enabling them to maintain longer, more coherent interactions and leverage historical data.
+*   **Secure Data Access:** MCP emphasizes secure connections, allowing developers to expose data through MCP servers while maintaining control over their infrastructure.
+*   **Tool Use and Actionability:** It enables LLMs to not just retrieve information but also to use external tools and trigger actions in other systems.
+*   **Interoperability:** Fosters an ecosystem where different AI tools, models, and data sources can work together more cohes বাড়.
+*   **Client-Server Architecture:** MCP typically involves:
+    *   **MCP Hosts/Clients:** Applications (like AI assistants, IDEs, or other AI-powered tools) that want to access data or capabilities.
+    *   **MCP Servers:** Lightweight programs that expose specific data sources or tools (e.g., a database, an API) through the standardized MCP.
+
+MCP aims to break down data silos, making it easier for AI to integrate with real-world applications and enterprise systems, leading to more powerful and context-aware AI solutions. It is an open-source initiative, often supported by SDKs in various programming languages to facilitate the development of MCP clients and servers.
+
+## 3. Implementation Overview
+
+This project leverages MCP to allow an AI agent to query and understand data within a Couchbase database.
+
+### 3.1. Core Components:
+
+*   **`main.ipynb`:**
+    *   The main Jupyter notebook that orchestrates the demonstration.
+    *   It imports necessary libraries, including `agents` and `agents.mcp`.
+    *   Defines the AI agent's configuration and the questions to be asked.
+    *   Manages the lifecycle of the MCP server connection.
+*   **`agents` library (custom/external):**
+    *   Provides the `Agent` class to define the AI agent's behavior, instructions, and model (e.g., "meta-llama/Meta-Llama-3.1-8B-Instruct").
+    *   Provides the `Runner` class to execute interactions with the agent.
+    *   Includes `gen_trace_id` and `trace` for observability.
+*   **`agents.mcp.MCPServerStdio`:**
+    *   A component used to establish and manage a connection to an MCP server running as a separate process, communicating via standard input/output (stdio).
+    *   In this demo, it's configured to run an external Python script (`mcp-server-couchbase/src/mcp_server.py`) which acts as the MCP server for Couchbase.
+*   **`mcp-server-couchbase` (External MCP Server):**
+    *   This is a separate Python application (located [here](https://github.com/Couchbase-Ecosystem/mcp-server-couchbase)) that implements the MCP server logic for Couchbase.
+    *   It exposes Couchbase operations (like running SQL++ queries, fetching documents, listing scopes/collections) as tools that the AI agent can call via MCP.
+    *   It requires its own environment configuration (e.g., via a `.env` file specified by the `--env-file` argument) to connect to the actual Couchbase instance.
+
+### 3.2. Workflow:
+
+1.  **MCP Server Initialization:**
+    *   The `main.ipynb` script starts by launching the `mcp-server-couchbase` process using `MCPServerStdio`.
+    *   The command to start the server is configured with the path to a `uv` executable (a Python project and virtual environment manager), the `mcp-server-couchbase` project directory, and the path to an `.env` file for its database credentials.
+    *   This server listens for MCP requests from the agent.
+
+2.  **Agent Configuration:**
+    *   An `Agent` instance (named "Assistant") is created with:
+        *   **System Prompt/Instructions:** Detailed instructions are provided to the LLM on how to interact with the Couchbase database. These instructions include:
+            *   The hierarchical structure of Couchbase (Cluster, Bucket, Scope, Collection, Document).
+            *   Specific guidance that the data of interest is within the `inventory` scope.
+            *   Rules for generating SQL++ queries (e.g., only the collection name in the `FROM` clause, and enclosing all identifiers like fields, collections, scopes, or bucket names in backticks `` ` ``).
+        *   **LLM Model:** Specifies the underlying language model to be used (e.g., "meta-llama/Meta-Llama-3.1-8B-Instruct").
+        *   **MCP Server Connection:** The `mcp_servers` parameter links the agent to the initialized `MCPServerStdio` instance, enabling it to discover and use the Couchbase tools exposed by the MCP server.
+
+3.  **Querying the Agent:**
+    *   The `qna` asynchronous function defines a series of natural language questions.
+    *   For each question, `Runner.run(starting_agent=agent, input=message)` sends the message to the "Assistant" agent.
+
+4.  **Agent Processing and MCP Tool Use:**
+    *   The agent (LLM) receives the user's question.
+    *   Based on its instructions and the question, it determines if it needs to interact with the Couchbase database.
+    *   If database interaction is required, the agent formulates a request to use one of the available Couchbase tools provided by the `mcp-server-couchbase` (e.g., `mcp_couchbase_run_sql_plus_plus_query`, `mcp_couchbase_get_scopes_and_collections_in_bucket`).
+    *   This tool request is sent over MCP to the `mcp-server-couchbase`.
+    *   The `mcp-server-couchbase` executes the requested database operation (e.g., runs a SQL++ query against the `inventory` scope).
+    *   The results from the database operation are returned to the agent via MCP.
+
+5.  **Response Generation:**
+    *   The agent uses the information retrieved from Couchbase (if any) and its own reasoning capabilities to formulate a natural language response to the user's original question.
+    *   The final output from the agent is then printed in the notebook.
+
+### 3.3. Database Interaction Details:
+
+*   **Target Database:** The agent is configured to primarily work with the `inventory` scope.
+*   **Collections:** The demo implies the existence of collections such as `airport`, `airline`, `route`, `landmark`, and `hotel` within the `inventory` scope.
+*   **Query Language:** The agent is instructed to generate SQL++ (N1QL) queries for Couchbase.
+
+
+### 3.4. Setting Up and Running the Demo:
+
+**Prerequisites:**
+
+*   Python
+*   Jupyter Notebook or JupyterLab.
+*   Access to a running Couchbase Server instance populated with the relevant sample data (especially in the `inventory` scope with the mentioned collections).
+*   The `mcp-server-couchbase` project must be available at the specified path (set as the `--directory` flag) or the path in `main.ipynb` updated accordingly.
+*   A `.env` file containing the necessary Couchbase connection details for the `mcp-server-couchbase`. This file should define variables like:
+    ```env
+    COUCHBASE_HOST=your_couchbase_host
+    COUCHBASE_BUCKET_NAME=your_bucket_name # e.g., travel-sample if that's what inventory scope is in
+    COUCHBASE_USERNAME=your_couchbase_username
+    COUCHBASE_PASSWORD=your_couchbase_password
+    # Add any other variables required by mcp-server-couchbase
+    ```
+*   The `agents` library and its dependencies must be installed in the Python environment used by the Jupyter notebook.
+
path: mcp_ai_agents/couchbase_mcp_server/README.md
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add installation instructions for the external dependencies**

The README lists prerequisites but doesn't explain how to install them. Adding specific installation steps would make it easier for new users to get started.

```diff
**Prerequisites:**

* Python
* Jupyter Notebook or JupyterLab.
* Access to a running Couchbase Server instance populated with the relevant sample data (especially in the `inventory` scope with the mentioned collections).
* The `mcp-server-couchbase` project must be available at the specified path (set as the `--directory` flag) or the path in `main.ipynb` updated accordingly.
* A `.env` file containing the necessary Couchbase connection details for the `mcp-server-couchbase`. This file should define variables like:
    ```env
    COUCHBASE_HOST=your_couchbase_host
    COUCHBASE_BUCKET_NAME=your_bucket_name # e.g., travel-sample if that's what inventory scope is in
    COUCHBASE_USERNAME=your_couchbase_username
    COUCHBASE_PASSWORD=your_couchbase_password
    # Add any other variables required by mcp-server-couchbase
    ```
* The `agents` library and its dependencies must be installed in the Python environment used by the Jupyter notebook.

+**Installation Steps:**
+
+1. Clone the `mcp-server-couchbase` repository:
+   ```bash
+   git clone https://github.com/Couchbase-Ecosystem/mcp-server-couchbase.git
+   ```
+
+2. Install the required Python packages:
+   ```bash
+   pip install jupyter openai "agents-protocol>=0.5.0" python-dotenv
+   ```
+
+3. Install and set up Couchbase Server with the travel-sample dataset:
+   - Download Couchbase Server from [couchbase.com](https://www.couchbase.com/downloads/)
+   - During setup, install the travel-sample bucket when prompted
+
+4. Create a `.env` file with your credentials as shown in the prerequisites
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

92-92: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In mcp_ai_agents/couchbase_mcp_server/README.md around lines 92 to 109, the
prerequisites section lists required tools and libraries but lacks installation
instructions. Add a new subsection titled "Installation Steps" after the
prerequisites that includes clear commands and guidance for cloning the
repository, installing necessary Python packages via pip, downloading and
setting up Couchbase Server with the travel-sample dataset, and creating the
.env file with credentials. This will help new users easily set up the
environment.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T00:12:56Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,116 @@
+# Couchbase MCP OpenAI Agents SDK Demo with Nebius 
+
+## 1. Project Overview
+
+This project demonstrates the integration of a Large Language Model (LLM) with a Couchbase database using the Model Context Protocol (MCP) and the OpenAI Agents SDK. It showcases how an AI agent can understand natural language queries, interact with a Couchbase instance to retrieve or manipulate data, and provide meaningful responses. This demo specifically focuses on querying a sample database `travel-sample` containing information about hotels, airports, airlines, routes, and landmarks, primarily within an `inventory` scope.
+
+Users can ask questions like:
+*   "List out the top 5 hotels by the highest aggregate rating?"
+*   "Recommend me a flight and hotel from New York to San Francisco."
+
+The project uses a Jupyter notebook (`main.ipynb`) to define and run the AI agent, which communicates with a Couchbase database via an MCP server.
+
+## 2. Introduction to Model Context Protocol (MCP)
+
+The Model Context Protocol (MCP) is an open standard designed to standardize how AI assistants and applications connect to and interact with external data sources, tools, and systems. Think of MCP as a universal adapter that allows AI models to seamlessly access the context they need to produce more relevant, accurate, and actionable responses.
+
+**Key Goals and Features of MCP:**
+
+*   **Standardized Communication:** MCP provides a common language and structure for AI models to communicate with diverse backend systems, replacing the need for numerous custom integrations.
+*   **Enhanced Context Management:** It helps manage the limited context windows of LLMs efficiently, enabling them to maintain longer, more coherent interactions and leverage historical data.
+*   **Secure Data Access:** MCP emphasizes secure connections, allowing developers to expose data through MCP servers while maintaining control over their infrastructure.
+*   **Tool Use and Actionability:** It enables LLMs to not just retrieve information but also to use external tools and trigger actions in other systems.
+*   **Interoperability:** Fosters an ecosystem where different AI tools, models, and data sources can work together more cohes বাড়.
path: mcp_ai_agents/couchbase_mcp_server/README.md
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Fix incomplete text with non-English character**

There appears to be an incomplete sentence with a non-English character "বাড়" at the end of this line.

```diff
- *   **Interoperability:** Fosters an ecosystem where different AI tools, models, and data sources can work together more cohes বাড়.
+ *   **Interoperability:** Fosters an ecosystem where different AI tools, models, and data sources can work together more cohesively.
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
*   **Interoperability:** Fosters an ecosystem where different AI tools, models, and data sources can work together more cohesively.
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In mcp_ai_agents/couchbase_mcp_server/README.md at line 23, the sentence ends
with an incomplete word containing a non-English character "বাড়". Remove the
non-English character and complete or correct the sentence to ensure it is fully
in English and makes sense in context.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T00:12:56Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,116 @@
+# Couchbase MCP OpenAI Agents SDK Demo with Nebius 
+
+## 1. Project Overview
+
+This project demonstrates the integration of a Large Language Model (LLM) with a Couchbase database using the Model Context Protocol (MCP) and the OpenAI Agents SDK. It showcases how an AI agent can understand natural language queries, interact with a Couchbase instance to retrieve or manipulate data, and provide meaningful responses. This demo specifically focuses on querying a sample database `travel-sample` containing information about hotels, airports, airlines, routes, and landmarks, primarily within an `inventory` scope.
+
+Users can ask questions like:
+*   "List out the top 5 hotels by the highest aggregate rating?"
+*   "Recommend me a flight and hotel from New York to San Francisco."
+
+The project uses a Jupyter notebook (`main.ipynb`) to define and run the AI agent, which communicates with a Couchbase database via an MCP server.
+
+## 2. Introduction to Model Context Protocol (MCP)
+
+The Model Context Protocol (MCP) is an open standard designed to standardize how AI assistants and applications connect to and interact with external data sources, tools, and systems. Think of MCP as a universal adapter that allows AI models to seamlessly access the context they need to produce more relevant, accurate, and actionable responses.
+
+**Key Goals and Features of MCP:**
+
+*   **Standardized Communication:** MCP provides a common language and structure for AI models to communicate with diverse backend systems, replacing the need for numerous custom integrations.
+*   **Enhanced Context Management:** It helps manage the limited context windows of LLMs efficiently, enabling them to maintain longer, more coherent interactions and leverage historical data.
+*   **Secure Data Access:** MCP emphasizes secure connections, allowing developers to expose data through MCP servers while maintaining control over their infrastructure.
+*   **Tool Use and Actionability:** It enables LLMs to not just retrieve information but also to use external tools and trigger actions in other systems.
+*   **Interoperability:** Fosters an ecosystem where different AI tools, models, and data sources can work together more cohesively.
+*   **Client-Server Architecture:** MCP typically involves:
+    *   **MCP Hosts/Clients:** Applications (like AI assistants, IDEs, or other AI-powered tools) that want to access data or capabilities.
+    *   **MCP Servers:** Lightweight programs that expose specific data sources or tools (e.g., a database, an API) through the standardized MCP.
+
+MCP aims to break down data silos, making it easier for AI to integrate with real-world applications and enterprise systems, leading to more powerful and context-aware AI solutions. It is an open-source initiative, often supported by SDKs in various programming languages to facilitate the development of MCP clients and servers.
+
+## 3. Implementation Overview
+
+This project leverages MCP to allow an AI agent to query and understand data within a Couchbase database.
+
+### 3.1. Core Components:
+
+*   **`main.ipynb`:**
+    *   The main Jupyter notebook that orchestrates the demonstration.
+    *   It imports necessary libraries, including `agents` and `agents.mcp`.
+    *   Defines the AI agent's configuration and the questions to be asked.
+    *   Manages the lifecycle of the MCP server connection.
+*   **`agents` library (custom/external):**
+    *   Provides the `Agent` class to define the AI agent's behavior, instructions, and model (e.g., "meta-llama/Meta-Llama-3.1-8B-Instruct").
+    *   Provides the `Runner` class to execute interactions with the agent.
+    *   Includes `gen_trace_id` and `trace` for observability.
+*   **`agents.mcp.MCPServerStdio`:**
+    *   A component used to establish and manage a connection to an MCP server running as a separate process, communicating via standard input/output (stdio).
+    *   In this demo, it's configured to run an external Python script (`mcp-server-couchbase/src/mcp_server.py`) which acts as the MCP server for Couchbase.
+*   **`mcp-server-couchbase` (External MCP Server):**
+    *   This is a separate Python application (located [here](https://github.com/Couchbase-Ecosystem/mcp-server-couchbase)) that implements the MCP server logic for Couchbase.
+    *   It exposes Couchbase operations (like running SQL++ queries, fetching documents, listing scopes/collections) as tools that the AI agent can call via MCP.
+    *   It requires its own environment configuration (e.g., via a `.env` file specified by the `--env-file` argument) to connect to the actual Couchbase instance.
+
+### 3.2. Workflow:
+
+1.  **MCP Server Initialization:**
+    *   The `main.ipynb` script starts by launching the `mcp-server-couchbase` process using `MCPServerStdio`.
+    *   The command to start the server is configured with the path to a `uv` executable (a Python project and virtual environment manager), the `mcp-server-couchbase` project directory, and the path to an `.env` file for its database credentials.
+    *   This server listens for MCP requests from the agent.
+
+2.  **Agent Configuration:**
+    *   An `Agent` instance (named "Assistant") is created with:
+        *   **System Prompt/Instructions:** Detailed instructions are provided to the LLM on how to interact with the Couchbase database. These instructions include:
+            *   The hierarchical structure of Couchbase (Cluster, Bucket, Scope, Collection, Document).
+            *   Specific guidance that the data of interest is within the `inventory` scope.
+            *   Rules for generating SQL++ queries (e.g., only the collection name in the `FROM` clause, and enclosing all identifiers like fields, collections, scopes, or bucket names in backticks `` ` ``).
+        *   **LLM Model:** Specifies the underlying language model to be used (e.g., "meta-llama/Meta-Llama-3.1-8B-Instruct").
+        *   **MCP Server Connection:** The `mcp_servers` parameter links the agent to the initialized `MCPServerStdio` instance, enabling it to discover and use the Couchbase tools exposed by the MCP server.
+
+3.  **Querying the Agent:**
+    *   The `qna` asynchronous function defines a series of natural language questions.
+    *   For each question, `Runner.run(starting_agent=agent, input=message)` sends the message to the "Assistant" agent.
+
+4.  **Agent Processing and MCP Tool Use:**
+    *   The agent (LLM) receives the user's question.
+    *   Based on its instructions and the question, it determines if it needs to interact with the Couchbase database.
+    *   If database interaction is required, the agent formulates a request to use one of the available Couchbase tools provided by the `mcp-server-couchbase` (e.g., `mcp_couchbase_run_sql_plus_plus_query`, `mcp_couchbase_get_scopes_and_collections_in_bucket`).
+    *   This tool request is sent over MCP to the `mcp-server-couchbase`.
+    *   The `mcp-server-couchbase` executes the requested database operation (e.g., runs a SQL++ query against the `inventory` scope).
+    *   The results from the database operation are returned to the agent via MCP.
+
+5.  **Response Generation:**
+    *   The agent uses the information retrieved from Couchbase (if any) and its own reasoning capabilities to formulate a natural language response to the user's original question.
+    *   The final output from the agent is then printed in the notebook.
+
+### 3.3. Database Interaction Details:
+
+*   **Target Database:** The agent is configured to primarily work with the `inventory` scope.
+*   **Collections:** The demo implies the existence of collections such as `airport`, `airline`, `route`, `landmark`, and `hotel` within the `inventory` scope.
+*   **Query Language:** The agent is instructed to generate SQL++ (N1QL) queries for Couchbase.
+
+
+### 3.4. Setting Up and Running the Demo:
+
+**Prerequisites:**
+
+*   Python
+*   Jupyter Notebook or JupyterLab.
+*   Access to a running Couchbase Server instance populated with the relevant sample data (especially in the `inventory` scope with the mentioned collections).
+*   The `mcp-server-couchbase` project must be available at the specified path (set as the `--directory` flag) or the path in `main.ipynb` updated accordingly.
+*   A `.env` file containing the necessary Couchbase connection details for the `mcp-server-couchbase`. This file should define variables like:
+    ```env
+    COUCHBASE_HOST=your_couchbase_host
+    COUCHBASE_BUCKET_NAME=your_bucket_name # e.g., travel-sample if that's what inventory scope is in
+    COUCHBASE_USERNAME=your_couchbase_username
+    COUCHBASE_PASSWORD=your_couchbase_password
+    # Add any other variables required by mcp-server-couchbase
+    ```
path: mcp_ai_agents/couchbase_mcp_server/README.md
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Include OpenAI API key in `.env`**  

The notebook requires `OPENAI_API_KEY` to authenticate with the OpenAI SDK, but it’s not documented in the `.env` sample. Please add:
```diff
```env
+OPENAI_API_KEY=your_openai_api_key
 COUCHBASE_HOST=your_couchbase_host
 COUCHBASE_BUCKET_NAME=your_bucket_name
 ...
```
This is necessary for users to run the demo.

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In mcp_ai_agents/couchbase_mcp_server/README.md around lines 100 to 107, the
sample `.env` file documentation is missing the `OPENAI_API_KEY` variable
required for authenticating with the OpenAI SDK. Add a line
`OPENAI_API_KEY=your_openai_api_key` to the `.env` example to ensure users know
to include this key for running the demo successfully.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->

✅ Addressed in commit 95a2876
created_at: 2025-05-23T08:11:10Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,36 @@
+# Using a tool with Mastra AI and Nebius 
+
+A simple example showing how to use a tool.
+
+## Prerequisites
+
+- Node.js v20.0+
+- pnpm (recommended) or npm
+- OpenAI API key
+- Nebius AI Key
+
+## Getting Started
+
+1. Copy the environment variables file and add your OpenAI API key:
+
+   ```bash
+   cp .env.example .env
+   ```
+
+   Then edit `.env` and add your OpenAI API key:
+
+   ```env
+   OPENAI_API_KEY=sk-your-api-key-here
+   ```
path: simple_ai_agents/mastra_ai_weather_agent/README.md
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Inconsistency: Missing Nebius API key in environment setup.**

The prerequisites mention both OpenAI and Nebius API keys, but the environment setup instructions only show adding the OpenAI API key. Based on the implementation in `index.ts`, both keys are required.



Add the Nebius API key to the environment setup instructions:

```diff
   Then edit `.env` and add your OpenAI API key:

   ```env
   OPENAI_API_KEY=sk-your-api-key-here
+  NEBIUS_API_KEY=your-nebius-api-key-here
   ```
```

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In simple_ai_agents/mastra_ai_weather_agent/README.md around lines 22 to 24, the
environment setup instructions only include the OpenAI API key but omit the
required Nebius API key. Update the code block to add a line for NEBIUS_API_KEY
with a placeholder value, ensuring both API keys are documented for proper
configuration.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T08:11:11Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,130 @@
+import 'dotenv/config';
+import { openai } from '@ai-sdk/openai';
+import { createTool, Agent, Mastra } from '@mastra/core';
+import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
+import { z } from 'zod';
+
+const nebius = createOpenAICompatible({
+  name: "nebius",
+  apiKey: process.env.NEBIUS_API_KEY,
+  baseURL: "https://api.studio.nebius.com/v1/",
+});
+
+const model = "meta-llama/Meta-Llama-3.1-405B-Instruct";
+
+interface WeatherResponse {
+  current: {
+    time: string;
+    temperature_2m: number;
+    apparent_temperature: number;
+    relative_humidity_2m: number;
+    wind_speed_10m: number;
+    wind_gusts_10m: number;
+    weather_code: number;
+  };
+}
+
+const weatherTool = createTool({
+  id: 'get-weather',
+  description: 'Get current weather for a location',
+  inputSchema: z.object({
+    location: z.string().describe('City name'),
+  }),
+  outputSchema: z.object({
+    temperature: z.number(),
+    feelsLike: z.number(),
+    humidity: z.number(),
+    windSpeed: z.number(),
+    windGust: z.number(),
+    conditions: z.string(),
+    location: z.string(),
+  }),
+  execute: async ({ context }) => {
+    return await getWeather(context.location);
+  },
+});
+
+const getWeather = async (location: string) => {
+  const geocodingUrl = `https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(location)}&count=1`;
+  const geocodingResponse = await fetch(geocodingUrl);
+  const geocodingData = await geocodingResponse.json();
+
+  if (!geocodingData.results?.[0]) {
+    throw new Error(`Location '${location}' not found`);
+  }
+
+  const { latitude, longitude, name } = geocodingData.results[0];
+
+  const weatherUrl = `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current=temperature_2m,apparent_temperature,relative_humidity_2m,wind_speed_10m,wind_gusts_10m,weather_code`;
+
+  const response = await fetch(weatherUrl);
+  const data: WeatherResponse = await response.json();
+
+  return {
+    temperature: data.current.temperature_2m,
+    feelsLike: data.current.apparent_temperature,
+    humidity: data.current.relative_humidity_2m,
+    windSpeed: data.current.wind_speed_10m,
+    windGust: data.current.wind_gusts_10m,
+    conditions: getWeatherCondition(data.current.weather_code),
+    location: name,
+  };
+};
+
+function getWeatherCondition(code: number): string {
+  const conditions: Record<number, string> = {
+    0: 'Clear sky',
+    1: 'Mainly clear',
+    2: 'Partly cloudy',
+    3: 'Overcast',
+    45: 'Foggy',
+    48: 'Depositing rime fog',
+    51: 'Light drizzle',
+    53: 'Moderate drizzle',
+    55: 'Dense drizzle',
+    56: 'Light freezing drizzle',
+    57: 'Dense freezing drizzle',
+    61: 'Slight rain',
+    63: 'Moderate rain',
+    65: 'Heavy rain',
+    66: 'Light freezing rain',
+    67: 'Heavy freezing rain',
+    71: 'Slight snow fall',
+    73: 'Moderate snow fall',
+    75: 'Heavy snow fall',
+    77: 'Snow grains',
+    80: 'Slight rain showers',
+    81: 'Moderate rain showers',
+    82: 'Violent rain showers',
+    85: 'Slight snow showers',
+    86: 'Heavy snow showers',
+    95: 'Thunderstorm',
+    96: 'Thunderstorm with slight hail',
+    99: 'Thunderstorm with heavy hail',
+  };
+  return conditions[code] || 'Unknown';
+}
+
+const weatherAgent = new Agent({
+  name: 'Weather Agent',
+  instructions: `You are a helpful weather assistant that provides accurate weather information.
+Your primary function is to help users get weather details for specific locations. When responding:
+- Always ask for a location if none is provided - If the location name isn't in English, please translate it - If giving a location with multiple parts (e.g. "New York, NY"), use the most relevant part (e.g. "New York")
+- Include relevant details like humidity, wind conditions, and precipitation
+- Keep responses concise but informative
+Use the weatherTool to fetch current weather data.`,
+  model: nebius(model),
+  tools: { weatherTool },
+});
+
+const mastra = new Mastra({
+  agents: { weatherAgent },
+});
+
+async function main() {
+  const agent = mastra.getAgent('weatherAgent');
+  const result = await agent.generate('What is the weather in London?');
+  console.log(result.text);
+}
+
+main();
path: simple_ai_agents/mastra_ai_weather_agent/index.ts
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add error handling to main function.**

The main function should include error handling to gracefully handle any failures during execution.



Add error handling to the main function:

```diff
async function main() {
-  const agent = mastra.getAgent('weatherAgent');
-  const result = await agent.generate('What is the weather in London?');
-  console.log(result.text);
+  try {
+    const agent = mastra.getAgent('weatherAgent');
+    const result = await agent.generate('What is the weather in London?');
+    console.log(result.text);
+  } catch (error) {
+    console.error('Error running weather agent:', error);
+    process.exit(1);
+  }
}
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
async function main() {
  try {
    const agent = mastra.getAgent('weatherAgent');
    const result = await agent.generate('What is the weather in London?');
    console.log(result.text);
  } catch (error) {
    console.error('Error running weather agent:', error);
    process.exit(1);
  }
}

main();
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In simple_ai_agents/mastra_ai_weather_agent/index.ts around lines 124 to 130,
the main function lacks error handling which can cause unhandled exceptions
during execution. Wrap the asynchronous code inside main in a try-catch block to
catch any errors thrown by agent.generate or other operations. In the catch
block, log the error or handle it appropriately to ensure graceful failure and
better debugging.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T08:11:11Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,130 @@
+import 'dotenv/config';
+import { openai } from '@ai-sdk/openai';
+import { createTool, Agent, Mastra } from '@mastra/core';
+import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
+import { z } from 'zod';
+
+const nebius = createOpenAICompatible({
+  name: "nebius",
+  apiKey: process.env.NEBIUS_API_KEY,
+  baseURL: "https://api.studio.nebius.com/v1/",
+});
+
+const model = "meta-llama/Meta-Llama-3.1-405B-Instruct";
+
+interface WeatherResponse {
+  current: {
+    time: string;
+    temperature_2m: number;
+    apparent_temperature: number;
+    relative_humidity_2m: number;
+    wind_speed_10m: number;
+    wind_gusts_10m: number;
+    weather_code: number;
+  };
+}
+
+const weatherTool = createTool({
+  id: 'get-weather',
+  description: 'Get current weather for a location',
+  inputSchema: z.object({
+    location: z.string().describe('City name'),
+  }),
+  outputSchema: z.object({
+    temperature: z.number(),
+    feelsLike: z.number(),
+    humidity: z.number(),
+    windSpeed: z.number(),
+    windGust: z.number(),
+    conditions: z.string(),
+    location: z.string(),
+  }),
+  execute: async ({ context }) => {
+    return await getWeather(context.location);
+  },
+});
path: simple_ai_agents/mastra_ai_weather_agent/index.ts
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add error handling for tool execution.**

The tool execution should include proper error handling to gracefully handle failures from the weather API.



Add error handling to the tool execution:

```diff
  execute: async ({ context }) => {
-    return await getWeather(context.location);
+    try {
+      return await getWeather(context.location);
+    } catch (error) {
+      throw new Error(`Failed to get weather for ${context.location}: ${error.message}`);
+    }
  },
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
  execute: async ({ context }) => {
    try {
      return await getWeather(context.location);
    } catch (error) {
      throw new Error(`Failed to get weather for ${context.location}: ${error.message}`);
    }
  },
});
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In simple_ai_agents/mastra_ai_weather_agent/index.ts around lines 42 to 45, the
execute function calls getWeather without error handling, which can cause
unhandled exceptions if the weather API fails. Wrap the call to getWeather in a
try-catch block, return the weather data if successful, and handle or log errors
gracefully in the catch block to ensure the tool execution does not crash on
failures.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T08:11:11Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,130 @@
+import 'dotenv/config';
+import { openai } from '@ai-sdk/openai';
+import { createTool, Agent, Mastra } from '@mastra/core';
+import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
+import { z } from 'zod';
+
+const nebius = createOpenAICompatible({
+  name: "nebius",
+  apiKey: process.env.NEBIUS_API_KEY,
+  baseURL: "https://api.studio.nebius.com/v1/",
+});
+
+const model = "meta-llama/Meta-Llama-3.1-405B-Instruct";
+
+interface WeatherResponse {
+  current: {
+    time: string;
+    temperature_2m: number;
+    apparent_temperature: number;
+    relative_humidity_2m: number;
+    wind_speed_10m: number;
+    wind_gusts_10m: number;
+    weather_code: number;
+  };
+}
+
+const weatherTool = createTool({
+  id: 'get-weather',
+  description: 'Get current weather for a location',
+  inputSchema: z.object({
+    location: z.string().describe('City name'),
+  }),
+  outputSchema: z.object({
+    temperature: z.number(),
+    feelsLike: z.number(),
+    humidity: z.number(),
+    windSpeed: z.number(),
+    windGust: z.number(),
+    conditions: z.string(),
+    location: z.string(),
+  }),
+  execute: async ({ context }) => {
+    return await getWeather(context.location);
+  },
+});
+
+const getWeather = async (location: string) => {
+  const geocodingUrl = `https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(location)}&count=1`;
+  const geocodingResponse = await fetch(geocodingUrl);
+  const geocodingData = await geocodingResponse.json();
+
+  if (!geocodingData.results?.[0]) {
+    throw new Error(`Location '${location}' not found`);
+  }
+
+  const { latitude, longitude, name } = geocodingData.results[0];
+
+  const weatherUrl = `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current=temperature_2m,apparent_temperature,relative_humidity_2m,wind_speed_10m,wind_gusts_10m,weather_code`;
+
+  const response = await fetch(weatherUrl);
+  const data: WeatherResponse = await response.json();
+
+  return {
+    temperature: data.current.temperature_2m,
+    feelsLike: data.current.apparent_temperature,
+    humidity: data.current.relative_humidity_2m,
+    windSpeed: data.current.wind_speed_10m,
+    windGust: data.current.wind_gusts_10m,
+    conditions: getWeatherCondition(data.current.weather_code),
+    location: name,
+  };
+};
path: simple_ai_agents/mastra_ai_weather_agent/index.ts
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add comprehensive error handling and response validation.**

The `getWeather` function lacks proper error handling for network failures and should validate API responses.



Add error handling and response validation:

```diff
const getWeather = async (location: string) => {
+  try {
    const geocodingUrl = `https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(location)}&count=1`;
    const geocodingResponse = await fetch(geocodingUrl);
+    
+    if (!geocodingResponse.ok) {
+      throw new Error(`Geocoding API error: ${geocodingResponse.status}`);
+    }
    
    const geocodingData = await geocodingResponse.json();

    if (!geocodingData.results?.[0]) {
      throw new Error(`Location '${location}' not found`);
    }

    const { latitude, longitude, name } = geocodingData.results[0];

    const weatherUrl = `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current=temperature_2m,apparent_temperature,relative_humidity_2m,wind_speed_10m,wind_gusts_10m,weather_code`;

    const response = await fetch(weatherUrl);
+    
+    if (!response.ok) {
+      throw new Error(`Weather API error: ${response.status}`);
+    }
+    
    const data: WeatherResponse = await response.json();
+    
+    if (!data.current) {
+      throw new Error('Invalid weather data received');
+    }

    return {
      temperature: data.current.temperature_2m,
      feelsLike: data.current.apparent_temperature,
      humidity: data.current.relative_humidity_2m,
      windSpeed: data.current.wind_speed_10m,
      windGust: data.current.wind_gusts_10m,
      conditions: getWeatherCondition(data.current.weather_code),
      location: name,
    };
+  } catch (error) {
+    if (error instanceof Error) {
+      throw error;
+    }
+    throw new Error(`Unexpected error fetching weather data: ${error}`);
+  }
};
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
const getWeather = async (location: string) => {
  try {
    const geocodingUrl = `https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(location)}&count=1`;
    const geocodingResponse = await fetch(geocodingUrl);
    
    if (!geocodingResponse.ok) {
      throw new Error(`Geocoding API error: ${geocodingResponse.status}`);
    }

    const geocodingData = await geocodingResponse.json();

    if (!geocodingData.results?.[0]) {
      throw new Error(`Location '${location}' not found`);
    }

    const { latitude, longitude, name } = geocodingData.results[0];

    const weatherUrl = `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current=temperature_2m,apparent_temperature,relative_humidity_2m,wind_speed_10m,wind_gusts_10m,weather_code`;
    const response = await fetch(weatherUrl);
    
    if (!response.ok) {
      throw new Error(`Weather API error: ${response.status}`);
    }
    
    const data: WeatherResponse = await response.json();
    
    if (!data.current) {
      throw new Error('Invalid weather data received');
    }

    return {
      temperature: data.current.temperature_2m,
      feelsLike: data.current.apparent_temperature,
      humidity: data.current.relative_humidity_2m,
      windSpeed: data.current.wind_speed_10m,
      windGust: data.current.wind_gusts_10m,
      conditions: getWeatherCondition(data.current.weather_code),
      location: name,
    };
  } catch (error) {
    if (error instanceof Error) {
      throw error;
    }
    throw new Error(`Unexpected error fetching weather data: ${error}`);
  }
};
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In simple_ai_agents/mastra_ai_weather_agent/index.ts between lines 47 and 72,
the getWeather function lacks error handling for network issues and does not
validate API responses. Wrap the fetch calls in try-catch blocks to handle
network errors gracefully. After each fetch, check the response status and throw
an error if it is not successful. Also, validate that the expected data fields
exist before accessing them, and throw descriptive errors if the data is missing
or malformed.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T08:11:11Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,118 @@
+# Couchbase MCP OpenAI Agents SDK Demo with Nebius 
path: mcp_ai_agents/couchbase_mcp_server/README.md
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Clarify title to reflect content accurately.**

The title mentions _"with Nebius"_ but the README exclusively covers the Couchbase MCP demo; Nebius AI integration isn’t described. Consider removing “with Nebius” or adding a dedicated section explaining Nebius usage.

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In mcp_ai_agents/couchbase_mcp_server/README.md at line 1, the title includes
"with Nebius" but the README does not mention or explain Nebius AI integration.
To fix this, either remove "with Nebius" from the title to accurately reflect
the content or add a new section in the README that details how Nebius AI is
integrated and used in the demo.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T08:17:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,340 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "id": "b64f1212",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import asyncio\n",
+    "import os\n",
+    "import shutil\n",
+    "\n",
+    "from agents import Agent, Runner, gen_trace_id, trace, OpenAIChatCompletionsModel\n",
+    "from agents.mcp import MCPServer, MCPServerStdio\n",
+    "from openai import AsyncOpenAI\n",
+    "from dotenv import load_dotenv\n",
+    "load_dotenv()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "5b63ccc3",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "api_key = os.environ[\"NEBIUS_API_KEY\"]\n",
+    "base_url = \"https://api.studio.nebius.ai/v1\" \n",
+    "client = AsyncOpenAI(base_url=base_url, api_key=api_key)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "id": "0c3a957e",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "async def qna(agent):\n",
+    "    message = \"Tell me about the database that you are connected to.\"\n",
+    "    print(f\"Running: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"List out the top 5 hotels by the highest aggregate rating?\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"Recommend me a flight and hotel from New York to San Francisco\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"I'm going to the UK for 1 week. Recommend some great spots to visit for sightseeing. Also mention the respective prices of those places for adults and kids.\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)\n",
+    "\n",
+    "    message = \"My budget is around 30 pounds a night. What will be the best hotel to stay in?\"\n",
+    "    print(f\"\\n\\nRunning: {message}\")\n",
+    "    result = await Runner.run(starting_agent=agent, input=message)\n",
+    "    print(result.final_output)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "id": "c8ed2f11",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+async def run(mcp_server: MCPServer):
path: mcp_ai_agents/couchbase_mcp_server/main.ipynb
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add parameter validation for mcp_server**

The function doesn't validate the `mcp_server` parameter, which could lead to runtime errors if None or an invalid object is passed.



```diff
 async def run(mcp_server: MCPServer):
+    if not mcp_server:
+        raise ValueError("mcp_server parameter is required")
+        
     agent = Agent(
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
async def run(mcp_server: MCPServer):
    if not mcp_server:
        raise ValueError("mcp_server parameter is required")

    agent = Agent(
        # … rest of your parameters …
    )
    # … rest of the function …
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In mcp_ai_agents/couchbase_mcp_server/main.ipynb at line 74, the run function
lacks validation for the mcp_server parameter. Add a check at the start of the
function to verify that mcp_server is not None and is an instance of the
expected MCPServer class. If the validation fails, raise a ValueError with a
clear message indicating the parameter is invalid. This will prevent runtime
errors caused by invalid inputs.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T08:19:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,340 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "id": "b64f1212",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import asyncio\n",
+    "import os\n",
+    "import shutil\n",
+    "\n",
+    "from agents import Agent, Runner, gen_trace_id, trace, OpenAIChatCompletionsModel\n",
+    "from agents.mcp import MCPServer, MCPServerStdio\n",
+    "from openai import AsyncOpenAI\n",
+    "from dotenv import load_dotenv\n",
+    "load_dotenv()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "5b63ccc3",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "api_key = os.environ[\"NEBIUS_API_KEY\"]\n",
+    "base_url = \"https://api.studio.nebius.ai/v1\" \n",
+    "client = AsyncOpenAI(base_url=base_url, api_key=api_key)"
path: mcp_ai_agents/couchbase_mcp_server/main.ipynb
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add environment variable validation**

The code directly accesses environment variables without checking if they exist, which could cause a KeyError at runtime if the variables are not set.



```diff
-api_key = os.environ["NEBIUS_API_KEY"]
-base_url = "https://api.studio.nebius.ai/v1" 
-client = AsyncOpenAI(base_url=base_url, api_key=api_key)
+api_key = os.environ.get("NEBIUS_API_KEY")
+if not api_key:
+    raise ValueError("NEBIUS_API_KEY environment variable is required")
+    
+base_url = "https://api.studio.nebius.ai/v1" 
+client = AsyncOpenAI(base_url=base_url, api_key=api_key)
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
api_key = os.environ.get("NEBIUS_API_KEY")
if not api_key:
    raise ValueError("NEBIUS_API_KEY environment variable is required")

base_url = "https://api.studio.nebius.ai/v1"
client = AsyncOpenAI(base_url=base_url, api_key=api_key)
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In mcp_ai_agents/couchbase_mcp_server/main.ipynb around lines 28 to 30, the code
accesses the environment variable NEBIUS_API_KEY directly without validation,
risking a KeyError if it is not set. Modify the code to check if NEBIUS_API_KEY
exists in the environment before using it, and handle the case where it is
missing by raising a clear error or providing a fallback. This ensures safer
access to environment variables and prevents runtime exceptions.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-23T08:19:26Z
author_association: CONTRIBUTOR

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-05-23T00:09:09Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough

A new demo project is introduced for integrating a Large Language Model (LLM) with a Couchbase database using the Model Context Protocol (MCP) and the OpenAI Agents SDK. The changes include a comprehensive README and a Jupyter notebook showcasing an asynchronous AI agent that processes natural language queries, interacts with Couchbase via an MCP server, and returns structured answers. Additionally, a new Mastra AI weather agent project is added with source code, environment configuration, README, and package setup for weather data retrieval via Nebius API.

## Changes

| File(s)                                                                                   | Change Summary                                                                                                                        |
|-------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
| mcp_ai_agents/couchbase_mcp_server/README.md                                             | Added a detailed README explaining project purpose, architecture, workflow, Couchbase integration details, and setup instructions.    |
| mcp_ai_agents/couchbase_mcp_server/main.ipynb                                            | Added a Jupyter notebook demonstrating an async AI agent using MCP to query Couchbase, including agent setup, example queries, and results display. |
| simple_ai_agents/mastra_ai_weather_agent/.env.example                                    | Added example environment file with placeholders for NEBIUS_API_KEY and OPENAI_API_KEY.                                               |
| simple_ai_agents/mastra_ai_weather_agent/README.md                                       | Added README with setup and usage instructions for the Mastra AI weather agent integrating Nebius and OpenAI APIs.                    |
| simple_ai_agents/mastra_ai_weather_agent/index.ts                                        | Added weather agent code using Mastra AI framework and Nebius OpenAI-compatible API, including geocoding, weather fetching, and agent setup. |
| simple_ai_agents/mastra_ai_weather_agent/package.json                                    | Added Node.js project configuration with dependencies, scripts, and package metadata for the Mastra AI weather agent project.          |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant JupyterNotebook
    participant Agent
    participant MCPServer
    participant CouchbaseDB

    User->>JupyterNotebook: Runs notebook cells
    JupyterNotebook->>MCPServer: Launch MCP server process
    JupyterNotebook->>Agent: Initialize agent with instructions and model
    Agent->>MCPServer: Sends query via MCP protocol
    MCPServer->>CouchbaseDB: Executes SQL++ query
    CouchbaseDB-->>MCPServer: Returns query results
    MCPServer-->>Agent: Returns results via MCP
    Agent-->>JupyterNotebook: Generates and returns answer
    JupyterNotebook-->>User: Displays answer
```

```mermaid
sequenceDiagram
    participant User
    participant MastraAgent
    participant NebiusAPI
    participant OpenMeteoAPI

    User->>MastraAgent: Request weather for location
    MastraAgent->>OpenMeteoAPI: Geocode location
    OpenMeteoAPI-->>MastraAgent: Return coordinates
    MastraAgent->>OpenMeteoAPI: Fetch weather data
    OpenMeteoAPI-->>MastraAgent: Return weather details
    MastraAgent-->>User: Respond with formatted weather info
```

## Poem

> A rabbit hops through code and air,  
> Fetching weather with utmost care.  
> From Couchbase depths to skies above,  
> AI agents work with love.  
> Queries bounce and answers gleam,  
> In digital meadows, a coder’s dream!  
> 🐰🌦️✨

<!-- walkthrough_end -->

<!-- announcements_start -->

> [!NOTE]
> <details>
> <summary>⚡️ AI Code Reviews for VS Code, Cursor, Windsurf</summary>
> 
> CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
> Learn more [here](http://coderabbit.ai/ide).
> 
> </details>

<!-- announcements_end -->
<!-- internal state start -->


<!-- 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= -->

<!-- internal state end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=Arindam200/awesome-ai-apps&utm_content=17):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: CONTRIBUTOR
user: login: shivaylamba
created_at: 2025-05-23T00:09:15Z
body: @Arindam200 
author_association: COLLABORATOR