loading…
Search for a command to run...
loading…
Enables Claude Code to consult Gemini for complex coding problems with session management, file attachments, and conversation persistence.
Enables Claude Code to consult Gemini for complex coding problems with session management, file attachments, and conversation persistence.
A powerful MCP server that allows Claude Code to consult Gemini for complex coding problems with full code context and conversation persistence.
Note: This server works standalone but is highly recommended to use with the Claude Code Development Kit for enhanced automation and context management.
code_context with file attachmentsWhile this MCP server works standalone, it is highly recommended and optimized to use with the Claude Code Development Kit.
The Development Kit transforms Claude Code into an orchestrated development environment that seamlessly integrates with this Gemini MCP server:
gemini-context-injector.sh hook automatically attaches project-specific context files (MCP-ASSISTANT-RULES.md, project-structure.md) to new Gemini sessionsmcp-security-scan.sh hook prevents sensitive data from being sent to external AI services/full-context automatically leverage Gemini for complex problemsWhen Claude Code encounters difficult problems or needs a second opinion, it can:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
.env.example to .env and add your Gemini API key:cp .env.example .env
# Edit .env file and set your GEMINI_API_KEY
claude mcp add gemini-coding -s user -- /path/to/gemini-mcp/start_server.sh
Replace /path/to/gemini-mcp/ with the actual path to this directory.consult_geminiStart or continue a conversation with Gemini about complex coding problems.
Parameters:
session_id (optional): Continue a previous conversationproblem_description: Description of the problem (required for new sessions)code_context: All relevant code (required for new sessions, cached afterward)attached_files (optional): Array of file paths to read and include in the conversationfile_descriptions (optional): Object mapping file paths to descriptionsspecific_question: The question you want answeredadditional_context (optional): Updates or changes since last questionpreferred_approach: Type of help needed (solution/review/debug/optimize/explain/follow-up)list_sessionsList all active Gemini consultation sessions.
end_sessionEnd a specific session to free up memory.
/consult_gemini
problem_description: "I need to implement efficient caching for a React application"
code_context: "[paste entire relevant codebase]"
specific_question: "What's the best approach for implementing LRU cache with React Query?"
preferred_approach: "solution"
/consult_gemini
problem_description: "I need to optimize this React component for performance"
attached_files: ["/absolute/path/to/src/components/Dashboard.jsx", "/absolute/path/to/src/hooks/useData.js", "/absolute/path/to/package.json"]
file_descriptions: {
"/absolute/path/to/src/components/Dashboard.jsx": "Main dashboard component with performance issues",
"/absolute/path/to/src/hooks/useData.js": "Custom hook for data fetching",
"/absolute/path/to/package.json": "Project dependencies"
}
specific_question: "How can I improve the rendering performance of this dashboard?"
preferred_approach: "optimize"
/consult_gemini
problem_description: "Complex authentication flow needs debugging"
code_context: "// Additional context or pseudocode here"
attached_files: ["/absolute/path/to/auth/login.js", "/absolute/path/to/middleware/auth.js"]
specific_question: "Why is the token refresh failing?"
preferred_approach: "debug"
Response includes a session ID for follow-ups.
/consult_gemini
session_id: "abc123..."
specific_question: "I implemented your suggestion but getting stale data issues. How do I handle cache invalidation?"
additional_context: "Added the LRU cache as suggested, but users see old data after updates"
preferred_approach: "follow-up"
/list_sessions
# Shows all active sessions with IDs and summaries
/end_session
session_id: "abc123..."
# Frees up memory for completed conversations
code_context or attached_filesattached_files for multiple files, code_context for snippetsYou can test the server directly before adding it to Claude Code:
# Make sure your .env file has a valid GEMINI_API_KEY
./start_server.sh
The server will start and display:
Gemini Coding Assistant MCP Server v3.0 running (Python)
Features: Session management, file attachments, context persistence, follow-up questions
Ready to help with complex coding problems!
Feel free to connect with me on LinkedIn if you have questions, need clarification, or wish to provide feedback.
Выполни в терминале:
claude mcp add mcp-gemini-assistant -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.