Commit Graph

903 Commits

Author SHA1 Message Date
Beehive Innovations
84ef5adbe0 Update README.md 2025-06-10 20:45:42 +04:00
Beehive Innovations
c9ac5c73e8 Update README.md 2025-06-10 20:40:13 +04:00
Beehive Innovations
0f4e6cb056 Update README.md 2025-06-10 20:35:25 +04:00
Fahad
7ffbfc9596 WIP - communication memory 2025-06-10 20:04:13 +04:00
Fahad
f5060367a0 WIP - communication memory 2025-06-10 19:16:51 +04:00
Fahad
bb8a101dbf cleanup: remove Windows native support, enforce WSL requirement
Remove Windows batch scripts and native setup instructions since Claude Code CLI
requires WSL on Windows. Consolidate Docker as primary recommendation across all platforms.

Changes:
- Remove setup.bat, run_gemini.bat, setup-docker-env.bat
- Remove examples/claude_config_windows.json
- Update README to clarify WSL requirement for Windows users
- Promote Docker as recommended setup for all platforms
- Update troubleshooting section for WSL-only support
- Apply code formatting fixes from ruff/black

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 16:30:58 +04:00
Fahad
1be339ecc0 enhance: improve tool prompts with better file request grounding and response guidance
- Update DEBUG_ISSUE_PROMPT to request files when diagnostics are irrelevant/incomplete
- Clarify question field to specify what information is needed from Claude/user
- Update chat tool format_response to ask Claude to continue with user's request
- Update debug tool format_response to encourage implementing fixes when root cause identified
- Fix line length formatting to comply with 120 char limit

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 14:59:18 +04:00
Fahad
7ab0d42dd3 enhance: improve CHAT_PROMPT with file request grounding and technology-aware collaboration
- Add file request capability using JSON format like THINKDEEP_PROMPT
- Include technology stack awareness and grounding instructions
- Ensure collaboration stays within project scope and constraints
- Fix trailing whitespace issues identified by ruff linter

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 14:47:36 +04:00
Fahad
032e783efb Groundings added 2025-06-10 14:39:14 +04:00
Fahad
40a5dfccde enhance: improve tool prompts with technology-aware guidance and grounding
- Add technology-specific considerations to all tool prompts (THINKDEEP, CODEREVIEW, DEBUG, ANALYZE, PRECOMMIT)
- Replace specific technology lists with generic key areas to prevent misdirection
- Add comprehensive grounding statements to prevent overstepping scope
- Enhance DEBUG_ISSUE_PROMPT with regression prevention guidance
- Add scope discipline and focus requirements to all prompts
- Fix trailing whitespace issues

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 14:25:26 +04:00
Fahad
3f93444f45 Groundings added 2025-06-10 14:23:43 +04:00
Fahad
19b9435f95 Improved prompts 2025-06-10 14:17:26 +04:00
Fahad
385c42f6a5 Tailor reviews around tech stack 2025-06-10 13:59:12 +04:00
Fahad
7a5c9bfb8d enhance: improve code review prompt with technology-specific guidance
Add comprehensive technology-specific review categories and instructions to analyze codebase technology stack before reviewing. This enhancement will provide more targeted and relevant code reviews by adapting to different frameworks and patterns.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 13:52:24 +04:00
Fahad
157f80b47b style: apply black formatting to server.py
- Fixed code formatting in server.py using black
- Only formatting changes, no functional modifications
- Ensures consistent code style across the project

All tests pass (96/96) and linting is clean:
-  pytest: 96 tests passed
-  ruff: all checks passed
-  black: formatting applied
-  isort: import sorting correct

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 13:29:15 +04:00
Fahad
6495b29d47 fix: use proper ServerCapabilities for InitializationOptions
- Replaced plain dict capabilities with proper ServerCapabilities object
- Added proper imports for ServerCapabilities and ToolsCapability from mcp.types
- Now correctly declares tools capability using ToolsCapability() instead of empty dict
- This follows the MCP protocol specification for server capability declaration

The previous implementation used {"tools": {}} which was not the correct way
to declare tool capabilities according to the MCP Python SDK. This fix ensures
proper capability negotiation during MCP client connection initialization.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 13:20:15 +04:00
Fahad
42169b2452 docs: fix thinkdeep default thinking mode in documentation
- Corrected thinking modes table to show `high` as default for thinkdeep (not `max`)
- Moved the default notation from `max` row to `high` row where it belongs
- This aligns with the actual tool implementation which uses "high" as default

The thinkdeep tool uses "high" (16,384 tokens) as its default thinking mode,
not "max" (32,768 tokens) as previously documented.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 13:12:17 +04:00
Fahad
8360b3ef70 docs: remove redundant Triggers sections from tool descriptions
- Removed all "Triggers:" lines from tool descriptions in README
- The trigger words were redundant since prompt examples already show usage
- Makes documentation cleaner and more focused on actual usage patterns

The prompt examples throughout the documentation already demonstrate
how to invoke each tool, making the trigger word lists unnecessary.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 12:56:35 +04:00
Fahad
96d30bf000 docs: add Web Search Integration section and update capability descriptions
- Added dedicated "Web Search Integration" section explaining the new behavior
- Updated all web search capability descriptions to reflect that Gemini recommends searches for Claude
- Added to table of contents for easy navigation
- Explained how the feature works with concrete examples
- Listed benefits of the collaborative approach
- Added note about disabling web search when needed

The documentation now clearly explains that:
- Web search is enabled by default
- Gemini analyzes when searches would help
- Provides specific search recommendations for Claude
- Claude performs the actual searches
- More collaborative and transparent approach

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 12:55:19 +04:00
Fahad
7cb0186389 docs: update README with renamed tool names and fix syntax error
- Updated all references in README.md from old tool names to new ones:
  - think_deeper → thinkdeep
  - review_code → codereview
  - review_changes → precommit
- Fixed syntax error in base.py (unterminated f-string literal)
- Removed trailing whitespace to pass linting
- All tests now pass (96 tests)
- All linting checks pass (ruff, black, isort)

This completes the tool renaming refactor with full documentation updates.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 12:51:55 +04:00
Fahad
3d958ef7e9 feat: enhance websearch functionality with reasoning-based approach
- Changed use_websearch default from False to True for all tools
- Redesigned websearch behavior to focus on reasoning rather than direct search
- Tools now analyze when web searches would be helpful and recommend specific searches
- Updated all tool-specific websearch instructions to be more thoughtful
- Gemini will now suggest what Claude should search for and explain why

Key improvements:
- Web search is now enabled by default for better documentation awareness
- Instead of performing searches, Gemini reasons about what searches would help
- Provides specific search recommendations for Claude to execute
- More collaborative approach between Gemini and Claude

This change makes the tools more intelligent about when external information
would be valuable while keeping Claude in control of actual web searches.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 12:45:57 +04:00
Fahad
ba8f7192c3 refactor: rename think_deeper to thinkdeep for brevity
- Renamed `think_deeper` tool to `thinkdeep` for shorter, cleaner naming
- Updated all imports from ThinkDeeperTool to ThinkDeepTool
- Updated all references from THINK_DEEPER_PROMPT to THINKDEEP_PROMPT
- Updated tool registration in server.py
- Updated all test files to use new naming convention
- Updated README documentation to reflect new tool names
- All functionality remains the same, only naming has changed

This completes the tool renaming refactor for improved clarity and consistency.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 12:38:38 +04:00
Fahad
5f8ed3aae8 refactor: rename review tools for clarity and consistency
- Renamed `review_code` tool to `codereview` for better naming convention
- Renamed `review_changes` tool to `precommit` to better reflect its purpose
- Updated all tool descriptions to remove "Triggers:" sections and improve clarity
- Updated all imports and references throughout the codebase
- Renamed test files to match new tool names
- Updated server.py tool registrations
- All existing functionality preserved with improved naming

This refactoring improves code organization and makes tool purposes clearer.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 12:30:06 +04:00
Fahad
67f18ef3c9 refactor: rename debug_issue tool to debug for brevity
- Rename debug_issue.py to debug.py
- Update tool name from 'debug_issue' to 'debug' throughout codebase
- Update all references in server.py, tests, and README
- Keep DebugIssueTool class name for backward compatibility
- All tests pass with the renamed tool

This makes the tool name shorter and more consistent with other
tool names like 'chat' and 'analyze'. The functionality remains
exactly the same.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 11:43:47 +04:00
Fahad
8c07ad1eb2 feat: enhance debug_issue tool description to encourage sharing large diagnostic files
- Emphasize Gemini's 1M token capacity in the description
- Explicitly encourage sharing large log files, stack traces, memory dumps
- Add 'diagnose issue' as a trigger phrase
- Instruct Claude to proactively use this tool for debugging
- Encourage sharing comprehensive file paths rather than snippets
- Make clear that more context leads to better debugging analysis

This ensures Claude understands it should liberally share diagnostic
files and logs when debugging, taking full advantage of Gemini's
massive context window for thorough root cause analysis.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 11:37:57 +04:00
Fahad
beb0b7fe9b docs: add link to Claude Code configuration as alternative option
- Update 'save this output\!' instruction to mention Claude Code option
- Add direct link to Claude Code configuration section
- Helps users who prefer Claude Code over Claude Desktop

This clarifies that users have two configuration options and can
skip the Claude Desktop step if they're using Claude Code directly.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 11:28:45 +04:00
Fahad
13c084dc18 docs: add hash link to Working with Large Prompts section
- Add clickable link from 'Bypass MCP's token limits' bullet point
- Links directly to the Working with Large Prompts section
- Makes it easier for users to jump to detailed explanation

This improves navigation and helps users quickly find information
about the large prompt handling feature.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 11:21:53 +04:00
Fahad
c841197b1a docs: clarify Docker setup automation in README
- Emphasize that setup-docker-env scripts automatically build Docker image
- Clarify that $GEMINI_API_KEY from environment is automatically used
- Remove manual 'docker build' step from instructions
- Add clear 'To update' instructions - just run setup script again
- Update 'Why Docker' section to reflect easy updates

This makes it clearer that Docker setup is fully automated and users
don't need to run any Docker commands manually. The setup scripts
handle everything including building, cleaning old images, and
configuring the environment.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 11:20:32 +04:00
Fahad
2f62b722d1 feat: enhance review_code tool to guide Claude's fix implementation workflow
- Update format_response to include clear next steps for Claude
- Claude will now:
  1. First understand the context of issues by examining referenced code
  2. Present improvement options to the user as a clear list
  3. Only implement fixes the user selects
- Ensures user has control over which improvements to implement
- Promotes better understanding of issues before suggesting fixes

This change improves the user experience by making code review fixes
more interactive and user-controlled rather than automatic.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 11:12:41 +04:00
Fahad
cf0b3f7f44 feat: add web search capability to all tools for enhanced analysis
- Add use_websearch parameter to base ToolRequest class
- All tools now inherit web search capability automatically
- Enhanced description emphasizes brainstorming and architectural design
- Add get_websearch_instruction() helper method to base class
- Update all tools to include web search in their prompts when enabled
- Update README documentation with web search examples
- Fix linting issues (ruff, black formatting)

Web search is particularly useful for:
- Brainstorming sessions and architectural design discussions
- Exploring industry best practices
- Working with specific frameworks/technologies
- Researching solutions to complex problems
- Getting current documentation and community insights

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 11:09:28 +04:00
Fahad
2fe83dd381 Rebuild docker image as part of setting up 2025-06-10 10:40:54 +04:00
Fahad
21b0470aef style: remove trailing whitespace in test_docker_path_integration.py
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 10:02:01 +04:00
Fahad
788d1fa9d3 fix: prevent double translation of already-translated Docker paths
Added check in translate_path_for_environment() to detect and skip
already-translated container paths (those starting with /workspace).

This prevents the function from attempting to translate paths like:
- /workspace/src/main.py -> /inaccessible/outside/mounted/volume/workspace/src/main.py

Now it correctly handles:
- Host path: /Users/.../src/main.py -> /workspace/src/main.py (translation)
- Container path: /workspace/src/main.py -> /workspace/src/main.py (no change)

Added comprehensive test to verify double-translation prevention.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 09:58:25 +04:00
Fahad
af68e8bf7c fix: ensure review_changes properly translates both path and files for Docker
- Added explicit translation of files parameter using translate_file_paths()
- Now both path and files parameters are properly translated for Docker environments
- Ensures consistent behavior between dockerized and normal installations
- Updated all references to use translated_files consistently

This fixes the bug where files parameter wasn't being explicitly translated,
even though resolve_and_validate_path was handling it internally. The explicit
translation makes the behavior clear and consistent with path translation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 09:56:20 +04:00
Fahad
483ae7dd6d docs: clarify that Claude automatically manages thinking modes
Updated thinking modes section to emphasize that:
- Claude automatically selects appropriate thinking modes based on task complexity
- Manual override is available but not required in most cases
- Auto-managed mode is recommended for optimal cost/quality balance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 09:53:15 +04:00
Fahad
27add4d05d feat: Major refactoring and improvements v2.11.0
## 🚀 Major Improvements

### Docker Environment Simplification
- **BREAKING**: Simplified Docker configuration by auto-detecting sandbox from WORKSPACE_ROOT
- Removed redundant MCP_PROJECT_ROOT requirement for Docker setups
- Updated all Docker config examples and setup scripts
- Added security validation for dangerous WORKSPACE_ROOT paths

### Security Enhancements
- **CRITICAL**: Fixed insecure PROJECT_ROOT fallback to use current directory instead of home
- Enhanced path validation with proper Docker environment detection
- Removed information disclosure in error messages
- Strengthened symlink and path traversal protection

### File Handling Optimization
- **PERFORMANCE**: Optimized read_files() to return content only (removed summary)
- Unified file reading across all tools using standardized file_utils routines
- Fixed review_changes tool to use consistent file loading patterns
- Improved token management and reduced unnecessary processing

### Tool Improvements
- **UX**: Enhanced ReviewCodeTool to require user context for targeted reviews
- Removed deprecated _get_secure_container_path function and _sanitize_filename
- Standardized file access patterns across analyze, review_changes, and other tools
- Added contextual prompting to align reviews with user expectations

### Code Quality & Testing
- Updated all tests for new function signatures and requirements
- Added comprehensive Docker path integration tests
- Achieved 100% test coverage (95 tests passing)
- Full compliance with ruff, black, and isort linting standards

### Configuration & Deployment
- Added pyproject.toml for modern Python packaging
- Streamlined Docker setup removing redundant environment variables
- Updated setup scripts across all platforms (Windows, macOS, Linux)
- Improved error handling and validation throughout

## 🔧 Technical Changes

- **Removed**: `_get_secure_container_path()`, `_sanitize_filename()`, unused SANDBOX_MODE
- **Enhanced**: Path translation, security validation, token management
- **Standardized**: File reading patterns, error handling, Docker detection
- **Updated**: All tool prompts for better context alignment

## 🛡️ Security Notes

This release significantly improves the security posture by:
- Eliminating broad filesystem access defaults
- Adding validation for Docker environment variables
- Removing information disclosure in error paths
- Strengthening path traversal and symlink protections

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 09:50:05 +04:00
Fahad
7ea790ef88 fix: Docker path translation for review_changes and code deduplication
- Fixed review_changes tool to properly translate host paths to container paths in Docker
- Prevents "No such file or directory" errors when running in Docker containers
- Added proper error handling with clear messages when paths are inaccessible

refactor: Centralized token limit validation across all tools
- Added _validate_token_limit method to BaseTool to eliminate code duplication
- Reduced ~25 lines of duplicated code across 5 tools (analyze, chat, debug_issue, review_code, think_deeper)
- Maintains exact same error messages and behavior

feat: Enhanced large prompt handling
- Added support for prompts >50K chars by requesting file-based input
- Preserves MCP's ~25K token capacity for responses
- All tools now check prompt size before processing

test: Added comprehensive Docker path integration tests
- Tests for path translation, security validation, and error handling
- Tests for review_changes tool specifically with Docker paths
- Fixed failing think_deeper test (updated default from "max" to "high")

chore: Code quality improvements
- Applied black formatting across all files
- Fixed import sorting with isort
- All tests passing (96 tests)
- Standardized error handling follows MCP TextContent format

The changes ensure consistent behavior across all environments while reducing code duplication and improving maintainability.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 07:20:24 +04:00
Beehive Innovations
ab007fb4b2 Update README.md 2025-06-09 23:03:55 +04:00
Fahad
34bbbd1d3f docs: rename 'Example Workflow' to 'Prompt Used'
More accurate label that clearly shows this is the actual prompt
that produced the results shown in the image.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 22:51:51 +04:00
Fahad
077e731ce0 docs: reorganize README for better flow
- Move example workflow image to Why This Server section
- Condense File & Directory Support into single bullet point
- Remove duplicate image/prompt from think_deeper section

This creates a cleaner, more compelling introduction that showcases
real usage before diving into setup details.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 22:47:28 +04:00
Fahad
0c2c3e1ce3 docs: simplify Docker setup instructions
Focus on using the setup scripts which already generate the exact
Claude Desktop configuration needed. This makes the setup process
much more straightforward.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 22:44:19 +04:00
Fahad
f68ad99f62 fix: correct update date to June 9, 2025
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 22:41:51 +04:00
Fahad
79300912df style: apply black formatting to file_utils.py
Fix code formatting to pass CI checks.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 22:35:53 +04:00
Fahad
0d56f6d66a chore: remove Docker publish GitHub Action
Removing automated Docker Hub publishing workflow to keep the setup simple.
Users can build the Docker image locally with 'docker build -t gemini-mcp-server .'

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 22:33:32 +04:00
Fahad
569692e82d fix: add repository check to Docker Hub login step
Only attempt Docker Hub login when running from the main repository,
not from forks. This prevents authentication errors in forked repos
while still allowing them to build images locally.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 22:30:20 +04:00
Fahad
b799f85b6d chore: bump version to 2.9.0
Docker support is a significant new feature warranting a minor version bump.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 22:28:15 +04:00
Fahad
6b03088eee feat: add Docker support for cross-platform easy setup
Implements comprehensive Docker support to eliminate Python version and dependency concerns.
Users can now run the MCP server in a container with automatic path translation between
host and container filesystems.

Key features:
- Dockerfile with multi-architecture support (amd64/arm64)
- Automatic path translation using WORKSPACE_ROOT environment variable
- Setup scripts for all platforms (Bash, CMD, PowerShell)
- GitHub Actions workflow for automated Docker Hub publishing
- Secure non-root container execution
- Read-only volume mounts by default

The setup process is now simplified to:
1. Run setup-docker-env script to generate .env and Claude config
2. Build the Docker image
3. Copy generated config to Claude Desktop

No Python installation or virtual environment management required.

Fixes #3

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 22:25:06 +04:00
Beehive Innovations
ed587f27d5 Merge pull request #2 from vwieczorek/fix/security-focused-prompts
fix: enhance security focus in tool prompts
2025-06-09 21:47:53 +04:00
Fahad
53303f86be feat: enhance review_changes with dynamic file requests
- Add instruction for Gemini to request files when needed
- Add comprehensive tests for files parameter functionality
- Test file request instruction presence/absence based on context
- Run all tests, ruff, and black formatting

Now review_changes can both accept context files and allow Gemini
to request additional files during review for better validation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 21:43:45 +04:00
Fahad
a01cc9677a feat: add optional files parameter to review_changes tool
- Add files parameter to provide additional context during review
- Context files help validate if changes align with existing patterns
- Files are processed after diffs to prioritize actual changes for token budget
- Clear section headers and summaries show what context was included
- Handles token limits gracefully with truncation when needed

This allows users to provide config files, docs, or related code that
helps Gemini better understand and validate the changes being reviewed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 21:26:56 +04:00