A metaprompting-first MCP server that guides AI agents through intelligent, multi-step codebase analysis using Google's Gemini AI.
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.
Step 1: Install Gemini CLI
npm install -g @google/gemini-cliStep 2: Authenticate (one-time setup)
gemini auth loginStep 3: Install this tool
npm installStep 4: Test it works
node gemini-collaboration-guide.mjsStep 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.
Instead of trying to be "smart" about your analysis, this tool provides four simple tools that guide you through systematic analysis:
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"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"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"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"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✅ 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
- 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
We welcome contributions! Please see our Contributing Guide and Code of Conduct for details on how to get involved.
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
/mcpImportant:
- Use the full absolute path to the
gemini-collaboration-guide.mjsfile - The server name must be exactly
gemini-collaboration-guide - Restart Claude Code after adding the server
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
/mcpIf 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": []
}
}
}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.mjstogemini-collaboration-guide.mjs
-
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
-
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 # Should show: gemini-collaboration-guide /mcp # Should show the four tools
Common Errors:
Status: ✘ failed→ Usually wrong filename (usegemini-collaboration-guide.mjs)File does not exist→ Check absolute path is correct- Tools not appearing → Restart Claude Code after configuration
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"
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"
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"
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- Node.js 18+
- Google Gemini CLI installed and authenticated
- Basic understanding of glob patterns
"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🎉 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
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.