๐ Gemini CLI Orchestrator v2.0 - Sequential Thinking MCP
A metaprompting - first MCP server that uses Google's Gemini AI to guide AI agents through intelligent, multi - step codebase analysis.
๐ 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)
gemini_plan_analysis goal="Understand this project's main architecture"
gemini_craft_prompt step_description="Analyze package.json and README for project overview" context="Starting fresh analysis"
Authentication is handled automatically by the gemini CLI.
โจ Features
- 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.
๐ป Usage Examples
Basic Usage
The following steps show how to conduct a security audit using the orchestrator:
gemini_plan_analysis goal="Analyze authentication system for security vulnerabilities"
gemini_craft_prompt step_description="Identify authentication mechanisms" context="Security audit of auth system"
gemini_iterate_analysis current_understanding="Found JWT + session auth" iteration_goal="Check for common auth vulnerabilities"
gemini_synthesize_findings steps_summary="Analyzed 3 auth mechanisms, found 2 issues" synthesis_goal="Security audit report with fixes"
Advanced Usage
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"
๐ Documentation
- How It Works: Deep dive into the architecture and metaprompting philosophy.
- Contributing Guide: How to contribute to the project.
- Code of Conduct: Community standards and expectations.
๐ค Contributing
We welcome contributions! Please see our Contributing Guide and Code of Conduct for details on how to get involved.
๐ง Technical Details
This tool provides four simple tools to guide systematic analysis:
๐ฏ gemini_plan_analysis(goal)
It breaks down complex analysis goals into a step - by - step plan. You need to 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)
This tool 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)
It guides 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)
This tool combines insights from multiple analysis steps into a 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"
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.
Claude Code CLI (Recommended)
The easiest and most reliable way to configure the MCP server:
claude mcp add gemini - collaboration - guide node /path/to/your/gemini - cli - orchestrator/gemini - collaboration - guide.mjs
claude mcp list
/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:
claude mcp remove gemini - cli - orchestrator
claude mcp remove gemini - orchestrator
claude mcp remove gemini - collaboration - guide
claude mcp list
claude mcp add gemini - collaboration - guide node /Users/dannynguyen/gemini - cli - orchestrator/gemini - collaboration - guide.mjs
/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:
-
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
.
-
Clean setup process:
claude mcp remove gemini - cli - orchestrator
claude mcp remove gemini - orchestrator
claude mcp remove gemini - collaboration - guide
claude mcp add gemini - collaboration - guide node /absolute/path/to/gemini - collaboration - guide.mjs
-
Verify the file exists:
ls -la /path/to/your/gemini - cli - orchestrator/gemini - collaboration - guide.mjs
-
Test the server can start:
node /path/to/your/gemini - cli - orchestrator/gemini - collaboration - guide.mjs --help
-
Restart Claude Code completely after any configuration changes.
-
Verify success:
claude mcp list
/mcp
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.
File Pattern Examples
Use glob patterns to focus analysis on relevant files:
@**/*.js @**/*.ts
@**/*.py
@**/*.go
@**/*.rs
@**/*.java
@src/components/ @src/hooks/
@src/models/ @src/views/
@src/services/ @src/controllers/
@package.json @*.config.js
@**/*.test.js @**/*.spec.js
@README.md @docs/
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"
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. It is perfect for leveraging Gemini's massive context window through intelligent, structured workflows.