Gemini CLI + ANY MCP Server — Step‑by‑Step Tutorial

Prompt EngineeringAbout 5 min readJun 29, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • MCP (Managed Code Platform) Servers: Servers that provide access to various tools and functionalities, like web data extraction.
  • Gemini CLI: A command-line interface for interacting with AI models and tools.
  • Bright Data: A data scraping service that provides access to web data through proxies and automated scraping tools.
  • API Token: A security key used to authenticate access to Bright Data's services.
  • Web Unlocker: A Bright Data service for automated scraping of websites, leveraging residential proxies and CAPTCHA solving.
  • Rate Limits: Restrictions on the number of requests that can be made to a service within a specific time period.
  • JSON Schema: A format for defining the structure and data types of a JSON document.
  • Cloud Desktop: A cloud-based environment for running applications and accessing data.

Configuring MCP Servers with Gemini CLI

Initial Setup

  1. Checking Existing MCP Servers: The video starts by demonstrating how to check for configured MCP servers within Gemini CLI using the /MCP command. Initially, no servers are configured.
  2. Creating settings.json: The process begins with creating or modifying the settings.json file within the Gemini folder in the root directory. The command mkdir -p ~/.gemini creates the directory if it doesn't exist. The command code ~/.gemini/settings.json opens the file in Visual Studio Code (or any preferred editor).
  3. JSON Configuration: The video provides a JSON schema for configuring an MCP server. This schema includes fields for the API token, web unlocker zone, browser zone, and rate limits.

Bright Data Configuration

  1. Bright Data Overview: Bright Data is introduced as a data scraping service that allows access to data from websites like LinkedIn, Amazon, Reddit, and YouTube.
  2. Creating a Zone: The video demonstrates how to create a "Web Unlocker" zone within the Bright Data interface. The zone is named "web unlocker 4". Enabling CAPTCHA solver is recommended.
  3. Obtaining API Key and Zone: The API key and zone name ("web unlocker 4") are crucial for configuring the MCP server in the settings.json file. The API key is copied from the Bright Data dashboard.
  4. Populating settings.json: The copied API key and zone name are inserted into the settings.json file. Rate limits are set, but the presenter notes that these can be adjusted based on individual needs.
    • Example:
      {
        "bright_data": {
          "api_token": "YOUR_API_TOKEN",
          "web_unlocker_zone": "web_unlocker4",
          "browser_zone": "default",
          "rate_limits": 10
        }
      }
      
  5. Restarting Gemini CLI: After modifying the settings.json file, Gemini CLI needs to be restarted for the changes to take effect.

Using the Configured MCP Server

  1. Verifying Configuration: After restarting, the /MCP command now shows the Bright Data MCP server as configured.
  2. Exploring Tools: The Bright Data MCP server provides various tools for interacting with different platforms, including search engines, web scraping, and data extraction from websites like LinkedIn, Instagram, Facebook, TikTok, Google services, YouTube, and Reddit.
  3. Example Query: The video demonstrates a specific query: "What are the latest stats of the YouTube channel [YouTube channel link]? What are the last 10 videos on this channel?".
  4. Tool Selection and Permissions: Gemini CLI selects the "web data YouTube profile" tool from the Bright Data MCP server. The user is prompted for permission to use the tool.
  5. Output and Errors: The output includes the latest stats and the last 10 videos from the specified YouTube channel. An error related to "too many requests" is encountered due to the limitations of the free version of Gemini CLI. The system automatically reverts to Gemini 2.5 Flash.
  6. Inspecting Errors: Pressing Ctrl+O reveals the error log, indicating the "too many requests" issue.

Understanding Tool Inputs

  1. Tool Overview (Ctrl+T): The video explains that pressing Ctrl+T provides a detailed overview of each tool available in the MCP server, including the expected input types (e.g., specific URL or structured text query).
  2. URL Generation: The MCP server can generate URLs for the tools using web search, but Gemini CLI sometimes struggles to generate the correct inputs.

Advanced Query Example and File Input

  1. Complex Query: A detailed query is presented, aimed at extracting AI engineer job listings from LinkedIn and Indeed, along with specific information.
  2. File Input: The video demonstrates how to use a file as input to Gemini CLI using the instruction in command followed by the file path.
    • Example: instruction in linkedin.ext
  3. Unexpected Behavior: Gemini CLI attempts to use Google search instead of the LinkedIn job listing tool from the Bright Data MCP server. The presenter notes that they haven't found a way to disable default tools in Gemini CLI.

Cloud Desktop Integration

  1. Cloud Desktop Setup: The video briefly shows how to configure the Bright Data MCP server in Cloud Desktop.
  2. Configuration Process: The process is similar to Gemini CLI: accessing cloud settings, navigating to the developer configuration, and modifying the cloud_desktop_config.json file with the API token and other settings.
  3. Successful Execution: The presenter shows a previous successful execution of the same complex query in Cloud Desktop, where the Bright Data MCP server was used to find and extract job listings from LinkedIn.

Conclusion

The video provides a detailed walkthrough of configuring and using MCP servers, specifically Bright Data, with Gemini CLI. While the integration shows promise, the presenter highlights some challenges, such as Gemini CLI's tendency to use default tools over MCP server tools and the need to understand the specific input requirements of each tool. The video also demonstrates the successful integration of Bright Data with Cloud Desktop. The presenter concludes by noting that Gemini CLI is still under development and expects rapid progress due to its open-source nature.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.