GeminiCLI - The Deep Dive with MCPs

Gemini CLI Overview and Updates 00:00

  • The Gemini CLI tool has seen rapid public adoption and recent updates from Google, fixing bugs and adding features.
  • The project has grown significantly, reaching 33,000 stars, indicating strong community interest and active development.

Walkthrough 1: Next.js Chat App Development 01:46

  • The first walkthrough demonstrates building a Next.js chat app with Gemini CLI, featuring streaming responses, markdown rendering, and model selection.
  • An initial "bad prompt" was used to show how Gemini CLI handles ambiguous requests and subsequent debugging.
  • Common issues encountered included updating the screen for streaming tokens, autofocusing input after responses, and displaying markdown.
  • Gemini CLI successfully implemented autofocus and markdown rendering in one shot when prompted clearly.
  • The built-in Google search tool was used to find the latest Next.js version when an older version caused problems.
  • Out-of-date model versions (e.g., Gemini Pro 1.0) were addressed by specifying newer models like Gemini Flash.
  • Screenshots were used to visually demonstrate issues (e.g., responses getting cut off, appearing in wrong bubbles) to help Gemini CLI debug.
  • The issue of responses being cut off was resolved by increasing the max output tokens parameter, which was initially low.
  • Gemini CLI was used to initialize a Git repository, make a first commit, and update a Dockerfile for deployment to Google Cloud Run.
  • The tool could save a summary of the long conversation to memory for future reference.

Walkthrough 2: Fetching Content with MCPs (DuckDuckGo) 10:43

  • The built-in web fetch tool requires full URLs and some sites may block Gemini's direct page downloads.
  • To overcome limitations with Google's search not providing raw URLs, an MCP (Multi-Modal Component) was introduced.
  • Setting up an MCP involves creating a hidden .gemini directory, a settings.json file inside it, and installing the MCP server (e.g., duck.go MCP server via uv install).
  • The DuckDuckGo MCP was used to fetch the five most recent articles from TechCrunch, including their titles, URLs, and summaries, successfully retrieving raw URLs.

Walkthrough 3: Hugging Face and Context 7 MCPs for Development 17:45

  • This walkthrough demonstrated setting up and using Hugging Face and Context 7 MCP servers.
  • The Hugging Face MCP was used to "giflify" an image from a Dropbox URL, processing it on Gradio Spaces and saving it locally as a WebP image.
  • The Context 7 MCP, which provides access to documentation, was used to create an Agent Development Kit (ADK) agent.
  • The ADK agent was designed to answer questions about Gemini CLI and use Google search, configured to run in ADK web (a built-in UI for testing agents).
  • Initial attempts led to the agent using its own Google search tool, but it was corrected to use Gemini CLI's built-in Google search tool by leveraging Context 7 for ADK documentation.
  • The final ADK agent successfully ran in the ADK web UI, answered questions about Gemini CLI, and performed accurate Google searches.
  • The Context 7 MCP is highlighted as a valuable tool for accessing documentation for various development tasks.