DEV Community

Picoable
Picoable

Posted on • Originally published at devops.picoable.com

How to Automate GitHub Workflows with Gemini CLI and the MCP Toolkit for Docker

In the world of DevOps, speed and efficiency are paramount. Yet, many teams are still bogged down by fragmented toolchains, manual processes, and the constant context-switching between IDEs, terminals, browsers, and project management tools. While automation is the goal, setting up complex CI/CD pipelines and maintaining brittle test scripts can sometimes feel like more work than the manual tasks they replace.

What if you could command your entire workflow—from browser testing and performance analysis to creating documented GitHub issues—using natural language, directly from your terminal?

This isn't a far-off fantasy. By combining the conversational power of Google's Gemini CLI with the containerized power of the Docker MCP Toolkit, you can create a seamless, intelligent automation engine. This guide will show you how to set up this powerful duo to automate complex tasks, reduce manual toil, and bring conversational AI directly into your development and CI/CD lifecycles.

Table of contents

The Challenge with Traditional Automation

Manual workflows are a productivity killer. A typical bug-squashing process might involve:

  1. Manually clicking through a web application.
  2. Opening browser DevTools to inspect elements and network requests.
  3. Taking screenshots as evidence.
  4. Writing up a detailed bug report.
  5. Navigating to GitHub to create a new issue and upload the artifacts.

This multi-step, multi-tool process is ripe for error and consumes valuable developer time. While tools like Selenium and Playwright offer automation, they come with their own complexities:

  • Heavy Setup: Managing browser drivers, Node.js dependencies, and test framework configurations can be a hassle, especially across different developer machines.
  • Maintenance Overhead: Test scripts are often brittle and require updates with every minor UI change.
  • Steep Learning Curve: Effective use requires proficiency in specific programming languages and testing paradigms.

The core problem is friction. The solution shouldn't introduce more friction than it removes.

A Paradigm Shift: Gemini CLI + Docker MCP Toolkit

This is where the combination of Gemini CLI and the Docker MCP Toolkit changes the game. It creates a system where an AI agent can securely interact with containerized tools on your local machine.

What is Gemini CLI?

The Gemini CLI is a command-line interface that brings Google's powerful Gemini models to your terminal. It allows you to have rich, conversational interactions with an AI that can understand context, process instructions, and generate code, text, or commands. Its real power lies in its extensibility through a tool-use protocol called MCP.

What is the Docker MCP Toolkit?

The MCP (Machine-Conversation Protocol) Toolkit is a feature built into Docker Desktop that provides a catalog of pre-configured, containerized tools—called MCP servers. These servers act as the "hands" for an AI "brain" like Gemini. Instead of the AI just generating text, it can now execute real-world actions:

  • Run browser tests with a Playwright server.
  • Interact with your repositories via a GitHub server.
  • Read and write files on your local machine with a Filesystem server.

Because these tools run in isolated Docker containers, you get perfect consistency and zero dependency conflicts, all with a one-click setup.

Why They Work Better Together

Gemini provides the intelligence, and the Docker MCP Toolkit provides the standardized, secure interface to the tools. This synergy eliminates the setup friction of traditional automation. You don't need to install Playwright, configure a GitHub client, or manage file paths manually. You simply enable the MCP servers in Docker Desktop and tell Gemini what you want to do.

Step-by-Step Guide: Setting Up Your Automated Environment

Let's get this powerful combination up and running. The entire process takes just a few minutes.

Prerequisites

  • Docker Desktop 4.40 or later installed.
  • The MCP Toolkit enabled in Docker Desktop (found in Settings > Extensions).
  • A Google account for authentication or a Gemini API Key from Google AI Studio.

Step 1: Install and Configure Gemini CLI

First, install the Gemini CLI globally using npm.

npm install -g @google/gemini-cli
Enter fullscreen mode Exit fullscreen mode

Once installed, run the interactive setup wizard:

gemini
Enter fullscreen mode Exit fullscreen mode

Follow the prompts to choose a theme and log in. The "Login with Google" (OAuth) option is recommended for its generous free tier. Alternatively, if you have an API key, you can set it as an environment variable:

export GEMINI_API_KEY="YOUR_API_KEY"
Enter fullscreen mode Exit fullscreen mode

Step 2: Connect Gemini CLI to the Docker MCP Toolkit

The easiest way to link Gemini to your Docker tools is directly through the Docker Desktop interface.

  1. Open Docker Desktop.
  2. Navigate to the MCP Toolkit section in the left-hand sidebar.
  3. Click on the Clients tab.
  4. Find Gemini in the list and click the Connect button.

That's it! Docker Desktop automatically configures Gemini CLI by updating its settings.json file to use the Docker MCP Gateway. This gateway securely routes commands from Gemini to the active MCP servers running in containers.

To verify the connection, restart the Gemini CLI and type the /mcp command. You should see MCP_DOCKER listed, confirming that Gemini can now access your Docker-managed tools.

gemini
/mcp

Available MCP Servers:
- @MCP_DOCKER: Docker MCP Catalog (gateway server)
Enter fullscreen mode Exit fullscreen mode

Practical Automation: From Browser Test to GitHub Issue

Now for the exciting part. Let's automate the bug-finding workflow we described earlier.

Step 1: Enable the Necessary MCP Servers

In Docker Desktop, go to the MCP Toolkit catalog and enable the following servers:

  • Playwright: For browser automation.
  • GitHub: For interacting with GitHub repositories.
  • Filesystem: For saving test artifacts like screenshots.

Step 2: Run the Automated Test with Gemini

With the servers enabled, you can now compose a single, conversational prompt in the Gemini CLI to execute the entire workflow. The /use command tells Gemini which tools are available for the task.

/use @playwright, @github, @fs

Go to 'https://github.com/404'. Take a full-page screenshot and save it to a new local directory named 'artifacts' as 'github-404.png'.

Next, using the @github tool, create an issue in the 'YOUR_USERNAME/YOUR_REPO' repository.
The issue title should be: "Bug: 404 page needs design refresh".
The issue body should include: "The 404 error page is functional but visually outdated. A design refresh is recommended. See attached screenshot for current state."

Finally, report back when the issue has been created and the file is saved.
Enter fullscreen mode Exit fullscreen mode

Replace YOUR_USERNAME/YOUR_REPO with a real repository you have access to. When you press Enter, Gemini will:

  1. Use the Playwright server to launch a headless browser and navigate to the URL.
  2. Take a screenshot.
  3. Use the Filesystem server to create the artifacts directory and save github-404.png inside it.
  4. Use the GitHub server to authenticate and create a new issue in your specified repository with the exact title and body.
  5. Report back in the terminal that the tasks are complete.

Step 3: Verifying the Results

Check your local filesystem—you'll find the artifacts/github-404.png file. Then, navigate to your GitHub repository—you'll see the newly created issue, complete with the title and body you defined. You just automated a 10-minute manual process with a single 30-second command.

Integrating Automation into Your CI/CD Pipeline

This conversational power isn't limited to your local terminal. You can integrate it directly into your GitHub Actions workflows using the official run-gemini-cli action.

This allows you to automate tasks like reviewing pull requests, triaging issues, or even refactoring code on every commit.

First, add your Gemini API key as a secret in your repository at Settings > Secrets and variables > Actions with the name GEMINI_API_KEY.

Next, create a workflow file like .github/workflows/pr-review.yml to have Gemini automatically review new pull requests.

name: 'Gemini PR Review'

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      issues: write
      contents: read
    steps:
      - name: 'Checkout repo'
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: 'Run Gemini CLI for PR Review'
        uses: google-github-actions/run-gemini-cli@v1
        with:
          gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
          prompt: |
            You are an expert senior software engineer performing a code review.
            Analyze the changes in this pull request.
            Provide a concise summary of the changes.
            Identify any potential bugs, performance issues, or deviations from best practices.
            Post your feedback as a comment on the pull request.
Enter fullscreen mode Exit fullscreen mode

This workflow triggers on every new pull request. The run-gemini-cli action invokes Gemini with a specific prompt, instructing it to act as a senior engineer and review the code changes. The AI's feedback is then automatically posted as a comment on the PR, providing instant, valuable insights to your team.

Conclusion

By combining the Gemini CLI with the Docker MCP Toolkit, you're not just adding another tool to your belt—you're fundamentally changing how you interact with your development environment. This approach transforms automation from a rigid, code-heavy task into a fluid, conversational process.

The key takeaways are:

  • Drastic Efficiency Gains: Automate complex, multi-step workflows with simple, natural language prompts.
  • Zero-Friction Setup: Docker containers eliminate dependency hell and ensure consistent environments for everyone on your team.
  • Seamless Integration: Extend automation from your local machine directly into your CI/CD pipeline with GitHub Actions.
  • Enhanced Developer Experience: Spend less time on manual toil and context-switching, and more time on creative problem-solving.

This is the future of DevOps: intelligent, conversational, and deeply integrated. The tools are ready for you to use today.

What workflows will you automate first? Share your ideas and experiments in the comments below!

Top comments (0)