From 3059e3ec7b1b42e8ac7a987c6d99ff5045707382 Mon Sep 17 00:00:00 2001 From: Fahad Date: Mon, 9 Jun 2025 06:37:59 +0400 Subject: [PATCH] feat: enhance chat tool discovery for collaborative thinking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update chat tool description to emphasize collaborative thinking capabilities - Add explicit triggers for brainstorming and sharing ideas with Gemini - Enhance prompt parameter description to include "current thinking" - Update README to highlight chat as a thinking partner - Update MCP_DISCOVERY.md with current tool names and enhanced examples - Bump version to 2.5.0 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- MCP_DISCOVERY.md | 76 +++++++++++++++++++++++++++++++++++------------- README.md | 16 ++++++---- config.py | 2 +- server.py | 11 ++++--- setup.py | 2 +- 5 files changed, 76 insertions(+), 31 deletions(-) diff --git a/MCP_DISCOVERY.md b/MCP_DISCOVERY.md index e4890bf..a5d18d7 100644 --- a/MCP_DISCOVERY.md +++ b/MCP_DISCOVERY.md @@ -10,37 +10,65 @@ When you configure an MCP server in Claude Desktop, Claude automatically discove ## How This Gemini Server Appears in Claude -Once configured, this Gemini MCP server provides three tools that Claude can use: +Once configured, this Gemini MCP server provides these powerful tools: -### 1. `gemini_chat` -- Claude sees this as a way to chat with Gemini -- You can invoke it naturally: "Ask Gemini about...", "Use Gemini to..." +### 1. `chat` - Collaborative Thinking Partner +- Claude sees this as a way to collaborate with Gemini on thinking and problem-solving +- Perfect for: brainstorming, getting second opinions, validating approaches +- Triggered by: "Brainstorm with Gemini", "Share my thinking with Gemini", "Get Gemini's opinion" -### 2. `gemini_analyze_code` -- Claude recognizes this for code analysis tasks -- Triggered by: "Use Gemini to analyze this file", "Have Gemini review this code" +### 2. `think_deeper` - Extended Reasoning +- Challenges assumptions and explores alternatives +- Triggered by: "Use Gemini to think deeper", "Extend my analysis with Gemini" -### 3. `gemini_list_models` -- Lists available models -- Usually called automatically when needed +### 3. `analyze` - Code & File Analysis +- Analyzes files and directories for patterns, architecture, and insights +- Triggered by: "Use Gemini to analyze", "Get Gemini to examine this code" + +### 4. `review_code` - Professional Code Review +- Provides prioritized feedback on code quality and issues +- Triggered by: "Use Gemini to review", "Get Gemini to check for bugs" + +### 5. `debug_issue` - Expert Debugging +- Root cause analysis for complex problems +- Triggered by: "Use Gemini to debug", "Get Gemini to trace this error" + +### 6. `list_models` & `get_version` +- Utility tools for configuration and model info ## Natural Language Usage Claude is smart about understanding your intent. You don't need special syntax: ### Examples that work: -- "Ask Gemini what it thinks about quantum computing" -- "Use Gemini to analyze the file /path/to/large/file.py" + +**Collaborative Thinking:** +- "Share my authentication design with Gemini and get their opinion" +- "Brainstorm with Gemini about scaling strategies" +- "I'm thinking of using microservices - discuss this with Gemini" +- "Get Gemini's perspective on my implementation plan" + +**Deep Analysis:** +- "Use Gemini to think deeper about edge cases in my design" +- "Get Gemini to analyze the entire src/ directory architecture" - "Have Gemini review this code for security issues" -- "Get Gemini's opinion on this architecture" -- "Pass this to Gemini for extended analysis" +- "Use Gemini to debug why this test is failing" + +**General Development:** +- "Ask Gemini to explain async/await in Python" +- "Get Gemini to compare Redis vs Memcached" +- "Use Gemini to suggest optimization strategies" ### What happens behind the scenes: -1. Claude recognizes keywords like "Gemini", "analyze", "review" -2. Claude determines which tool to use based on context -3. Claude extracts parameters (files, questions, etc.) from your request -4. Claude calls the appropriate MCP tool -5. Claude presents the response back to you +1. Claude recognizes keywords like "Gemini", "brainstorm", "discuss", "opinion", "analyze", "review", "debug" +2. Claude determines which tool to use based on context: + - Collaborative thinking → `chat` + - Deep analysis → `think_deeper` + - Code examination → `analyze` or `review_code` + - Problem solving → `debug_issue` +3. Claude extracts parameters (files, questions, context) from your request +4. Claude calls the appropriate MCP tool with your context +5. Claude integrates Gemini's response into the conversation ## Configuration in Claude Desktop @@ -75,7 +103,11 @@ Add to `%APPDATA%\Claude\claude_desktop_config.json` To verify the server is connected: 1. Look for the MCP icon in Claude's interface 2. Ask Claude: "What MCP tools are available?" -3. Claude should list the Gemini tools +3. Claude should list the Gemini tools including: + - `chat` for collaborative thinking + - `think_deeper` for extended analysis + - `analyze`, `review_code`, `debug_issue` for development tasks +4. Try: "Brainstorm with Gemini about improving code performance" ## Troubleshooting @@ -88,6 +120,10 @@ If Claude doesn't recognize Gemini commands: ## Integration with Claude Code In Claude Code, the integration is even more seamless: +- Claude can use Gemini as a thinking partner during complex tasks +- Share your implementation plans with Gemini for validation +- Get second opinions on architectural decisions +- Collaborate on debugging tricky issues - Large file handling is automatic - Claude will suggest using Gemini when hitting token limits - File paths are resolved relative to your workspace \ No newline at end of file diff --git a/README.md b/README.md index a69bab4..b3ea936 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ Just ask Claude naturally: - **Code needs review?** → `review_code` (bugs, security, performance issues) - **Something's broken?** → `debug_issue` (root cause analysis, error tracing) - **Want to understand code?** → `analyze` (architecture, patterns, dependencies) -- **General questions?** → `chat` (explanations, comparisons, advice) +- **Need a thinking partner?** → `chat` (brainstorm ideas, get second opinions, validate approaches) - **Check models?** → `list_models` (see available Gemini models) - **Server info?** → `get_version` (version and configuration details) @@ -118,7 +118,7 @@ Just ask Claude naturally: 2. [`review_code`](#2-review_code---professional-code-review) - Professional code review with severity levels 3. [`debug_issue`](#3-debug_issue---expert-debugging-assistant) - Root cause analysis and debugging 4. [`analyze`](#4-analyze---smart-file-analysis) - General-purpose file and code analysis -5. [`chat`](#5-chat---general-development-chat) - General development conversations +5. [`chat`](#5-chat---general-development-chat--collaborative-thinking) - Collaborative thinking and development conversations 6. [`list_models`](#6-list_models---see-available-gemini-models) - List available Gemini models 7. [`get_version`](#7-get_version---server-information) - Get server version and configuration @@ -227,8 +227,8 @@ Just ask Claude naturally: **Triggers:** analyze, examine, look at, understand, inspect -### 5. `chat` - General Development Chat -**For everything else - explanations, comparisons, brainstorming** +### 5. `chat` - General Development Chat & Collaborative Thinking +**Your thinking partner - bounce ideas, get second opinions, brainstorm collaboratively** #### Example Prompts: @@ -236,6 +236,8 @@ Just ask Claude naturally: ``` "Use gemini to explain how async/await works in Python" "Get gemini to compare Redis vs Memcached for session storage" +"Share my authentication design with gemini and get their opinion" +"Brainstorm with gemini about scaling strategies for our API" ``` **Collaborative Workflow:** @@ -246,12 +248,16 @@ Just ask Claude naturally: ``` **Key Features:** +- Collaborative thinking partner for your analysis and planning +- Get second opinions on your designs and approaches +- Brainstorm solutions and explore alternatives together +- Validate your checklists and implementation plans - General development questions and explanations - Technology comparisons and best practices - Architecture and design discussions - Can reference files for context: `"Use gemini to explain this algorithm with context from algorithm.py"` -**Triggers:** ask, explain, compare, suggest, what about +**Triggers:** ask, explain, compare, suggest, what about, brainstorm, discuss, share my thinking, get opinion ### 6. `list_models` - See Available Gemini Models ``` diff --git a/config.py b/config.py index dacbc2d..e6c5092 100644 --- a/config.py +++ b/config.py @@ -3,7 +3,7 @@ Configuration and constants for Gemini MCP Server """ # Version and metadata -__version__ = "2.4.2" +__version__ = "2.5.0" __updated__ = "2025-06-09" __author__ = "Fahad Gilani" diff --git a/server.py b/server.py index 2ac214d..22b61ac 100644 --- a/server.py +++ b/server.py @@ -67,16 +67,19 @@ async def handle_list_tools() -> List[Tool]: Tool( name="chat", description=( - "GENERAL CHAT - Have a conversation with Gemini about any development topic. " - "Use for explanations, brainstorming, or general questions. " - "Triggers: 'ask gemini', 'explain', 'what is', 'how do I'." + "GENERAL CHAT & COLLABORATIVE THINKING - Use Gemini as your thinking partner! " + "Perfect for: bouncing ideas during your own analysis, getting second opinions on your plans, " + "collaborative brainstorming, validating your checklists and approaches, exploring alternatives. " + "Also great for: explanations, comparisons, general development questions. " + "Triggers: 'ask gemini', 'brainstorm with gemini', 'get gemini's opinion', 'discuss with gemini', " + "'share my thinking with gemini', 'explain', 'what is', 'how do I'." ), inputSchema={ "type": "object", "properties": { "prompt": { "type": "string", - "description": "Your question or topic", + "description": "Your question, topic, or current thinking to discuss with Gemini", }, "context_files": { "type": "array", diff --git a/setup.py b/setup.py index 70c35d5..01e1771 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ if readme_path.exists(): setup( name="gemini-mcp-server", - version="2.3.0", + version="2.5.0", description="Model Context Protocol server for Google Gemini", long_description=long_description, long_description_content_type="text/markdown",