Skip to main content
Glama
Gemini CLI Orchestrator MCP

Gemini CLI Orchestrator MCP

by dnnyngyen

Gemini CLI Orchestrator v2.0 - Sequential Thinking MCP

A metaprompting-first MCP server that guides AI agents through intelligent, multi-step codebase analysis using Google's Gemini AI.

🧠 Core Philosophy

Don't build intelligence into the system. Build prompts that elicit intelligence from the agent.

This tool doesn't wrap or replace your thinking - it guides you to think more systematically about complex codebase analysis through structured workflows.

Related MCP server: Gemini Bridge

πŸš€ Quick Start

Step 1: Install Gemini CLI

npm install -g @google/gemini-cli

Step 2: Authenticate (one-time setup)

gemini auth login

Step 3: Install this tool

npm install

Step 4: Test it works

node gemini-collaboration-guide.mjs

Step 5: Try your first analysis (using Claude Code CLI)

# Start with planning a simple analysis
gemini_plan_analysis goal="Understand this project's main architecture"

# Then craft a specific prompt for the first step
gemini_craft_prompt step_description="Analyze package.json and README for project overview" context="Starting fresh analysis"

That's it! Authentication is handled automatically by the gemini CLI.

How It Works

Instead of trying to be "smart" about your analysis, this tool provides four simple tools that guide you through systematic analysis:

🎯 gemini_plan_analysis(goal)

Breaks down complex analysis goals into a step-by-step plan. Be specific about what you want to understand and why.

Example:

gemini_plan_analysis goal="Audit authentication system for security vulnerabilities"

πŸ” gemini_craft_prompt(step_description, context)

Helps you write better prompts for Gemini by suggesting effective commands and context for each analysis step.

Example:

gemini_craft_prompt step_description="Analyze JWT token handling" context="Found 3 auth endpoints, focusing on token security"

πŸ”„ gemini_iterate_analysis(current_understanding, iteration_goal)

Guide iterative analysis using observe-think-act cycles for dynamic problem-solving.

Example:

gemini_iterate_analysis current_understanding="Found potential SQL injection in login" iteration_goal="Investigate if other endpoints have similar issues"

πŸ“Š gemini_synthesize_findings(steps_summary, synthesis_goal)

Combine insights from multiple analysis steps into comprehensive understanding.

Example:

gemini_synthesize_findings steps_summary="Analyzed auth system, found 2 vulnerabilities, tested 5 endpoints" synthesis_goal="Create security audit report with prioritized fixes"

Example Workflow

Here's how you'd conduct a security audit using the orchestrator:

# 1. Plan the overall analysis
gemini_plan_analysis goal="Analyze authentication system for security vulnerabilities"
# β†’ Outputs: 5-stage analysis plan with specific steps

# 2. Execute each planned step
gemini_craft_prompt step_description="Identify authentication mechanisms" context="Security audit of auth system"
# β†’ Outputs: Optimized gemini command to analyze auth files
# β†’ You run: cat src/auth/**/* | gemini -m gemini-2.5-flash -p "..."

# 3. Dive deeper if needed
gemini_iterate_analysis current_understanding="Found JWT + session auth" iteration_goal="Check for common auth vulnerabilities"
# β†’ Outputs: ReAct loop guidance for systematic vulnerability testing

# 4. Synthesize final report
gemini_synthesize_findings steps_summary="Analyzed 3 auth mechanisms, found 2 issues" synthesis_goal="Security audit report with fixes"
# β†’ Outputs: Comprehensive synthesis strategy for final report

🎯 Key Benefits

βœ… Simplified Authentication - Uses your existing gemini CLI setup
βœ… True Metaprompting - Guides your intelligence, doesn't replace it
βœ… Multi-Step Analysis - Break complex problems into manageable steps
βœ… Flexible Workflows - Adapt your approach based on what you discover
βœ… Direct Gemini Integration - No wrapper complexity or auth overhead

πŸ“š Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guide and Code of Conduct for details on how to get involved.

MCP Configuration

🚨 Important Note for Existing Users

If you've previously installed this MCP server (especially if you used gemini-orchestrator.mjs), you may have cached configurations. The filename was renamed to gemini-collaboration-guide.mjs for clarity. See "Handling Previous Installations" below if you encounter setup issues.

The easiest and most reliable way to configure the MCP server:

# Add the server using Claude Code's built-in command
claude mcp add gemini-collaboration-guide node /path/to/your/gemini-cli-orchestrator/gemini-collaboration-guide.mjs

# Verify it was added
claude mcp list

# Test it's working in Claude Code
/mcp

Important:

  • Use the full absolute path to the gemini-collaboration-guide.mjs file

  • The server name must be exactly gemini-collaboration-guide

  • Restart Claude Code after adding the server

Handling Previous Installations / Filename Changes

If you previously configured this MCP server or encounter issues like "Status: ✘ failed", follow these steps:

# 1. Remove any old configurations
claude mcp remove gemini-cli-orchestrator    # Old name
claude mcp remove gemini-orchestrator        # Another old name  
claude mcp remove gemini-collaboration-guide # Clean slate

# 2. Verify clean state
claude mcp list

# 3. Add with correct filename (use YOUR actual path)
claude mcp add gemini-collaboration-guide node /Users/dannynguyen/gemini-cli-orchestrator/gemini-collaboration-guide.mjs

# 4. Restart Claude Code completely

# 5. Test it works
/mcp

Manual Configuration (Alternative)

If you prefer manual JSON configuration:

Claude Desktop - Config file: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "gemini-collaboration-guide": {
      "command": "node",
      "args": ["/absolute/path/to/your/gemini-cli-orchestrator/gemini-collaboration-guide.mjs"]
    }
  }
}

Cursor IDE - Config file: .cursor/mcp.json

{
  "mcpServers": {
    "gemini-collaboration-guide": {
      "command": "node",
      "args": ["/absolute/path/to/your/gemini-cli-orchestrator/gemini-collaboration-guide.mjs"]
    }
  }
}

Windsurf IDE - Config file: windsurf_config.json

{
  "mcpServers": {
    "gemini-collaboration-guide": {
      "command": "node",
      "args": ["/absolute/path/to/your/gemini-cli-orchestrator/gemini-collaboration-guide.mjs"],
      "disabled": false,
      "alwaysAllow": []
    }
  }
}

Troubleshooting

If /mcp shows "No MCP servers configured" or tools aren't available:

  1. Check for filename/configuration conflicts (Most Common Issue)

    • Follow the "Handling Previous Installations" section above

    • The file was renamed from gemini-orchestrator.mjs to gemini-collaboration-guide.mjs

  2. Clean setup process:

    # Remove all old configurations
    claude mcp remove gemini-cli-orchestrator
    claude mcp remove gemini-orchestrator  
    claude mcp remove gemini-collaboration-guide
    
    # Add with correct filename
    claude mcp add gemini-collaboration-guide node /absolute/path/to/gemini-collaboration-guide.mjs
  3. Verify the file exists:

    ls -la /path/to/your/gemini-cli-orchestrator/gemini-collaboration-guide.mjs
  4. Test the server can start:

    node /path/to/your/gemini-cli-orchestrator/gemini-collaboration-guide.mjs --help
  5. Restart Claude Code completely after any configuration changes

  6. Verify success:

    claude mcp list    # Should show: gemini-collaboration-guide
    /mcp              # Should show the four tools

Common Errors:

  • Status: ✘ failed β†’ Usually wrong filename (use gemini-collaboration-guide.mjs)

  • File does not exist β†’ Check absolute path is correct

  • Tools not appearing β†’ Restart Claude Code after configuration

Advanced Usage Examples

Security Audit Workflow

1. Start: "Comprehensive security audit of web application"
2. Step 1: "Identify all authentication mechanisms" β†’ @src/auth/ @middleware/
3. Step 2: "Analyze API endpoint security" β†’ @src/api/ @src/routes/
4. Step 3: "Review data validation and sanitization" β†’ @src/validation/ @src/models/
5. Step 4: "Check for common vulnerabilities (OWASP)" β†’ @src/
6. Conclude: "Generate prioritized security report with remediation steps"

Performance Analysis Workflow

1. Start: "Identify performance bottlenecks in React application"
2. Step 1: "Analyze component rendering patterns" β†’ @src/components/
3. Step 2: "Review state management efficiency" β†’ @src/store/ @src/hooks/
4. Step 3: "Check for unnecessary re-renders" β†’ @src/components/
5. Step 4: "Analyze bundle size and imports" β†’ @package.json @webpack.config.js
6. Conclude: "Provide performance optimization recommendations"

Architecture Review Workflow

1. Start: "Review microservices architecture for scalability"
2. Step 1: "Understand service boundaries" β†’ @services/ @docker-compose.yml
3. Step 2: "Analyze inter-service communication" β†’ @src/api/ @src/clients/
4. Step 3: "Review data flow and dependencies" β†’ @src/models/ @src/schemas/
5. Step 4: "Evaluate error handling and resilience" β†’ @src/middleware/ @src/utils/
6. Conclude: "Recommend architectural improvements for scalability"

File Pattern Examples

Use glob patterns to focus analysis on relevant files:

# Language-specific patterns
@**/*.js @**/*.ts          # JavaScript/TypeScript
@**/*.py                   # Python
@**/*.go                   # Go
@**/*.rs                   # Rust
@**/*.java                 # Java

# Framework-specific patterns
@src/components/ @src/hooks/     # React
@src/models/ @src/views/         # MVC frameworks
@src/services/ @src/controllers/ # Service layer

# File type patterns
@package.json @*.config.js       # Configuration
@**/*.test.js @**/*.spec.js      # Tests
@README.md @docs/                # Documentation

Requirements

  • Node.js 18+

  • Google Gemini CLI installed and authenticated

  • Basic understanding of glob patterns

Troubleshooting

"Command not found: gemini"

npm install -g @google/gemini-cli

"Authentication failed"

gemini auth login

"No files found"

# Check your file patterns match your project structure
# Use broader patterns like @src/ or @**/*.js

What's New in v2.0

πŸŽ‰ Complete architectural redesign - From complex wrapper to simple orchestrator
πŸŽ‰ Eliminated authentication complexity - Uses native gemini CLI auth
πŸŽ‰ True metaprompting approach - Guides intelligence instead of replacing it
πŸŽ‰ Sequential thinking workflows - Multi-step analysis with state management
πŸŽ‰ Simplified setup - No complex configuration or environment variables

Philosophy

This tool embodies the metaprompting principle: trust agent intelligence over system complexity.

Instead of trying to be smart about your analysis, it provides simple tools that guide you to think systematically about complex problems. The result is more thoughtful analysis and better insights.

Perfect for leveraging Gemini's massive context window through intelligent, structured workflows.

Available Tools

4 tools
gemini_craft_promptB

Helps you write better prompts for Gemini by suggesting effective commands and context.

This tool guides you on crafting effective bash commands for gemini collaboration:

  • How to write focused, specific prompts that get better results

  • How to select the right files for each analysis step

  • How to structure your bash commands for optimal collaboration

  • How to interpret and build on gemini's responses

You execute the suggested commands yourself using your bash tools.

Inputs: step_description (required), context.

gemini_iterate_analysisB

Guide iterative analysis using observe-think-act cycles for dynamic problem-solving.

This tool helps you implement iterative analysis patterns that adapt based on findings:

  • How to structure reasoning before taking action

  • How to observe and interpret results effectively

  • How to reflect on findings and adjust strategy dynamically

  • How to decide when to continue iterating vs. when to conclude

  • How to handle unexpected results and pivot approaches

Based on ReAct patterns used by Gemini CLI itself for complex problem-solving workflows.

Inputs: current_understanding (required), iteration_goal (required), unexpected_findings.

gemini_plan_analysisB

Breaks down complex analysis goals into a step-by-step plan. Gives you the roadmap, you execute the steps.

This tool helps you plan multi-step analysis by guiding your thinking about:

  • How to decompose complex goals into manageable steps

  • What order to approach different aspects of your analysis

  • How to build understanding incrementally

  • How to use each step to inform the next

You execute the suggested gemini commands yourself using your bash tools.

Inputs: goal (required).

gemini_synthesize_findingsC

Combine insights from multiple analysis steps into comprehensive understanding.

This tool helps you synthesize results from multiple gemini interactions:

  • How to identify patterns and themes across different analyses

  • How to structure synthesis prompts that connect insights

  • How to build comprehensive understanding from incremental steps

  • How to formulate actionable conclusions

You execute the synthesis commands yourself using your bash tools.

Inputs: steps_summary (required), synthesis_goal (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose in the Gemini analysis workflow: prompt crafting, iterative analysis, planning, and synthesis. There is no overlap in functionalityβ€”craft_prompt focuses on command formulation, iterate_analysis on dynamic cycles, plan_analysis on step decomposition, and synthesize_findings on combining insights. An agent can easily differentiate them based on their specific roles.

    Naming Consistency5/5

    All tool names follow a consistent 'gemini_verb_noun' pattern (e.g., gemini_craft_prompt, gemini_iterate_analysis). This uniform structure makes the set predictable and readable, with no deviations in style or convention. The naming clearly indicates the domain (Gemini) and the action-resource pairing.

    Tool Count5/5

    With 4 tools, this server is well-scoped for its purpose of orchestrating Gemini CLI workflows. Each tool addresses a distinct phase of analysis (prompting, iteration, planning, synthesis), and none feel redundant or missing. The count is appropriate for covering the core lifecycle without being overwhelming or insufficient.

    Completeness4/5

    The tool set covers the essential phases of a Gemini analysis workflow: from initial prompt crafting to iterative cycles, planning, and final synthesis. However, there is a minor gap in direct execution or feedback tools, as all descriptions note 'you execute the commands yourself,' which might leave agents without guidance on handling execution errors or real-time adjustments. Overall, the surface is nearly complete for the stated orchestration purpose.

    Related MCP Connectors

    Related MCP Servers