Lightweight integration of Google's Gemini AI with Claude Code, offering 1M+ token context window, smart model selection, and code analysis tools for operations teams. Connects to existing workflows via Python, enhancing automation and code understanding.
git clone https://github.com/cmdaltctr/claude-gemini-mcp-slim.gitClaude Gemini MCP Integration bridges Claude Code with Google's Gemini AI models through the Model Context Protocol, enabling developers to leverage Gemini's massive 1M+ token context window for comprehensive code analysis. The tool automatically selects between Gemini Flash for quick responses and Gemini Pro for deeper analysis, providing security reviews, performance suggestions, and architectural guidance without leaving your IDE. It includes 20+ slash commands for common tasks like quick queries, codebase analysis, and automated pre-commit reviews. The shared MCP server architecture serves multiple AI clients and projects from a single installation, keeping project directories clean while enabling real-time streaming output with progress indicators.
[{"step":"Install claude-gemini-mcp-slim via pip: `pip install claude-gemini-mcp-slim` and configure your Google API key in `.env`.","tip":"Use `export GOOGLE_API_KEY=your_key_here` for temporary testing or add to your shell profile for persistence."},{"step":"Run a targeted analysis by pasting the prompt template into your Claude/ChatGPT interface, replacing [PLACEHOLDERS] with your specific context (e.g., codebase path, issue type).","tip":"For large codebases (>1M tokens), split the analysis into modules (e.g., `/services/auth`) to avoid hitting token limits."},{"step":"Review the output, focusing on the prioritized list of issues. Use the provided code snippets to implement fixes or adapt them to your tech stack.","tip":"For security-critical issues (e.g., hardcoded secrets), address them immediately before proceeding with other fixes."},{"step":"Integrate the claude-gemini-mcp-slim into your CI/CD pipeline using the provided pre-commit hook or a custom GitHub Action to scan code on every push.","tip":"Example GitHub Action:\n```yaml\nname: Code Analysis\non: [push]\njobs:\n analyze:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - run: pip install claude-gemini-mcp-slim\n - run: claude-gemini analyze --path ./src --issue memory_leaks\n```"},{"step":"Monitor the impact of fixes using your existing observability tools (e.g., Prometheus, Datadog). Re-run the analysis weekly to catch regressions.","tip":"Set up a cron job to run the analysis during off-peak hours to avoid performance impact on your systems."}]
Security code reviews across large codebases using Gemini's extended context
Performance analysis and architectural advice for complex projects
Pre-commit automated reviews via the hooks system
Full project analysis leveraging 1M+ token context window
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/cmdaltctr/claude-gemini-mcp-slimCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use the claude-gemini-mcp-slim integration to analyze [CODEBASE_PATH] for [SPECIFIC_ISSUE]. Focus on identifying [TECHNICAL_DETAILS] such as memory leaks, inefficient algorithms, or security vulnerabilities. Provide a prioritized list of fixes with estimated effort in hours and potential impact. Include code snippets for critical issues. If possible, suggest automated remediation steps using [TOOL_NAME] or [SCRIPT_LANGUAGE].
Analyzing the `/backend/services` codebase for memory leaks in the user authentication module (v2.4.1). The scan identified 3 critical issues:
1. **Memory Leak in JWT Token Cache**
- Location: `/services/auth/cache.py:45-52`
- Issue: Tokens are stored in a global dictionary without TTL expiration, causing 1.2GB memory growth over 7 days in production (observed in monitoring dashboard).
- Impact: High - leads to OOM errors during peak traffic (500 errors increased by 18% this week).
- Fix: Replace global dict with `functools.lru_cache(maxsize=10000)` with 15-minute TTL. Estimated effort: 2 hours.
- Code snippet:
```python
# BEFORE
token_cache = {}
# AFTER
from functools import lru_cache
from datetime import datetime, timedelta
@lru_cache(maxsize=10000)
def get_cached_token(token_id):
return token_cache.get(token_id)
```
2. **Inefficient SQL Query in User Lookup**
- Location: `/services/db/users.py:89-95`
- Issue: Full table scan on `users` table (12M rows) due to missing index on `email` column. Query time increased from 45ms to 2.1s after recent data growth.
- Impact: Medium - degrades login API response time by 400ms (P95 latency).
- Fix: Add index `CREATE INDEX idx_users_email ON users(email)`. Estimated effort: 1 hour.
3. **Hardcoded API Keys**
- Location: `/config/secrets.env:3`
- Issue: Stripe API key exposed in version control. Detected via `git-secrets` scan.
- Impact: Critical - potential financial fraud if key is compromised.
- Fix: Rotate key immediately and use environment variables. Estimated effort: 30 minutes.
Automated remediation: Created a pre-commit hook using `pre-commit` framework to validate no secrets are committed. Hook script:
```yaml
repos:
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
```
Total estimated remediation time: 3.5 hours. After fixes, memory usage should stabilize at ~200MB (down from current 1.4GB), and login API latency should return to baseline.Google's multimodal AI model and assistant
AI assistant built for thoughtful, nuanced conversation
Get more done every day with Microsoft Teams – powered by AI
Automate your spreadsheet tasks with AI power
Agentic AI Workflow platform
Connected workspace for docs, wikis, and projects
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan