Commit Graph

679 Commits

Author SHA1 Message Date
OhMyApps
8ff8e06bf9 refactor: Update environment and Docker configuration files; remove unused MCP configuration tests 2025-06-25 17:42:58 +02:00
Fahad
2bed3a0774 Lint 2025-06-25 19:40:46 +04:00
Fahad
3ce0f93e5b Lint 2025-06-25 19:37:25 +04:00
Fahad
6d0bafa81d Support for Gemini CLI (setup instructions) - WIP 2025-06-25 19:36:09 +04:00
OhMyApps
b181f051ac Merge pull request #2 from GiGiDKR/feat-dockerisation
Feat: Add comprehensive Docker support and documentation for Zen MCP Server
2025-06-25 16:38:52 +02:00
OhMyApps
aef412fb30 Merge pull request #1 from GiGiDKR/feat-local_support_with_UTF-8_encoding
Feat: Local support with utf 8 encoding
2025-06-25 16:36:26 +02:00
OhMyApps
e4c2b36cb3 refactor: Remove unused mcp.json configuration test from Docker tests 2025-06-25 16:32:33 +02:00
OhMyApps
ec49c8f0c7 refactor: Delete unused validation script test 2025-06-25 16:11:42 +02:00
OhMyApps
2f9f989e52 Merge branch 'BeehiveInnovations:main' into feat-dockerisation 2025-06-25 16:01:35 +02:00
OhMyApps
2de9839096 Add Docker scripts and validation tests for Zen MCP Server
- Created build.sh script for building the Docker image with environment variable checks.
- Added deploy.sh script for deploying the Zen MCP Server with health checks and logging.
- Implemented healthcheck.py to verify server process, Python imports, log directory, and environment variables.
- Developed comprehensive tests for Docker configuration, environment validation, and integration with MCP.
- Included performance tests for Docker image size and startup time.
- Added validation script tests to ensure proper Docker and MCP setup.
2025-06-25 16:00:48 +02:00
Sebastiangmz
9c1503faac Add comprehensive WSL setup guide for Windows users (#136) 2025-06-24 19:40:05 -07:00
OhMyApps
e22fff27c9 refactor: remove obsolete localization test files and update UTF-8 tests for improved mock handling 2025-06-24 18:48:31 +02:00
Ming
8b7620b262 feat: Enhance run-server.sh with uv-first Python environment setup (#129)
* feat: Enhance run-server.sh with uv-first Python environment setup

- Implement uv-first approach for faster environment setup when available
- Add automatic WSL environment detection using wslvar for better Windows integration
- Improve system package installation by using bash -c for better command execution
- Add comprehensive environment validation and fallback mechanisms
- Optimize dependency installation with uv when environment supports it
- Enhance configuration display workflow for better user experience
- Add environment markers to track uv-created environments
- Improve error handling and user messaging throughout setup process

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

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: Add .claude/settings.local.json to .gitignore

Personal Claude Code settings should not be tracked in source control.

Reference: https://docs.anthropic.com/en/docs/claude-code/settings

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

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: Add shared Claude Code settings.json for team defaults

- Add .claude/settings.json with default permissions for team use
- Remove .claude/settings.local.json from git tracking (now personal config)

Reference: https://docs.anthropic.com/en/docs/claude-code/settings

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Address Gemini Code Assist review issues in run-server.sh

- Fix hardcoded Unix paths (lines 563 & 568) with cross-platform detection
- Improve error handling by capturing uv stderr instead of /dev/null
- Fix uv environment detection logic to check uv_created marker file

Resolves three issues identified in PR review:
1. High Priority: Replace hardcoded $VENV_PATH/bin/python with detection
2. Medium Priority: Capture and display uv command errors for debugging
3. Medium Priority: Use marker file instead of path matching for uv detection

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Address additional Gemini Code Assist feedback

- Enhance WSL warning message with more helpful guidance
- Add security comment explaining bash -c usage over eval
- Add get_venv_python_path helper function for cleaner cross-platform detection
- Improve path resolution error handling with proper error checking

Addresses 4 additional review points from gemini-code-assist to improve
user experience, code clarity, and error handling robustness.

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

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-24 11:31:50 +04:00
OhMyApps
c2342d341b fix: improve UTF-8 integration tests and response handling by adding details and fixes in mocks 2025-06-24 00:10:00 +02:00
OhMyApps
9cb992e780 fix: improve UTF-8 integration tests and response handling by adding details and fixes in mocks 2025-06-24 00:09:19 +02:00
OhMyApps
bf628f23ec fix: format error handling 2025-06-23 23:56:30 +02:00
OhMyApps
a46f8c2fad feat: add localization tests and improve locale handling in tools 2025-06-23 23:35:02 +02:00
OhMyApps
3368830f05 fix: remove unused imports and clean up code in various files 2025-06-23 23:24:38 +02:00
OhMyApps
f8e559ebb2 style: format code for consistency and readability across multiple files 2025-06-23 23:17:56 +02:00
OhMyApps
9945135a07 fix: correct import name for CodeReviewTool in UTF-8 tests 2025-06-23 23:09:52 +02:00
OhMyApps
0c7ac4fffd fix: sync fork 2025-06-23 22:38:40 +02:00
OhMyApps
29746f796b Merge branch 'BeehiveInnovations:main' into feat-local_support_with_UTF-8_encoding-update 2025-06-23 22:35:40 +02:00
OhMyApps
1fd48f034f Merge branch 'feat-local_support_with_UTF-8_encoding-update' of https://github.com/GiGiDKR/zen-mcp-server into feat-local_support_with_UTF-8_encoding-update 2025-06-23 22:24:47 +02:00
Fahad
4faa661c6d Updated guides 2025-06-23 19:44:01 +04:00
Illya Havsiyevych
a355b80afc feat: Add DISABLED_TOOLS environment variable for selective tool disabling (#127)
## Description

This PR adds support for selectively disabling tools via the DISABLED_TOOLS environment variable, allowing users to customize which MCP tools are available in their Zen server instance. This feature enables better control over tool availability for security,  performance, or organizational requirements.

## Changes Made

- [x] Added `DISABLED_TOOLS` environment variable support to selectively disable tools
- [x] Implemented tool filtering logic with protection for essential tools (version, listmodels)
- [x] Added comprehensive validation with warnings for unknown tools and attempts to disable essential tools
- [x] Updated `.env.example` with DISABLED_TOOLS documentation and examples
- [x] Added comprehensive test suite (16 tests) covering all edge cases
- [x] No breaking changes - feature is opt-in with default behavior unchanged

## Configuration

Add to `.env` file:
```bash
# Optional: Tool Selection
# Comma-separated list of tools to disable. If not set, all tools are enabled.
# Essential tools (version, listmodels) cannot be disabled.
# Available tools: chat, thinkdeep, planner, consensus, codereview, precommit,
#                  debug, docgen, analyze, refactor, tracer, testgen
# Examples:
# DISABLED_TOOLS=                    # All tools enabled (default)
# DISABLED_TOOLS=debug,tracer        # Disable debug and tracer tools
# DISABLED_TOOLS=planner,consensus   # Disable planning tools
2025-06-23 19:07:40 +04:00
Fahad
3b250c95df Quick test mode for simulation tests
Fixed o4-mini name, OpenAI removed o4-mini-high
Add max_output_tokens property to ModelCapabilities
Fixed tests after refactor
2025-06-23 18:56:47 +04:00
Fahad
ce6c1fd7ea Quick test mode for simulation tests
Fixed o4-mini name, OpenAI removed o4-mini-high
Add max_output_tokens property to ModelCapabilities
2025-06-23 18:33:47 +04:00
Fahad
8c1814d4eb Quick test mode for simulation tests 2025-06-23 18:05:31 +04:00
Fahad
9167e6d845 Quick test mode for simulation tests 2025-06-23 17:53:03 +04:00
Fahad
14eaf930ed Cleanup, use ModelCapabilities only 2025-06-23 17:39:47 +04:00
Fahad
498ea88293 Use ModelCapabilities consistently instead of dictionaries
Moved aliases as part of SUPPORTED_MODELS instead of shorthand, more in line with how custom_models are declared
Further refactoring to cleanup some code
2025-06-23 16:58:59 +04:00
Fahad
e94c028a3f Fixed: https://github.com/BeehiveInnovations/zen-mcp-server/issues/123
Fixed restriction checks for OpenRouter
2025-06-23 15:23:55 +04:00
OhMyApps
7e5f95531b Merge branch 'BeehiveInnovations:main' into feat-local_support_with_UTF-8_encoding-update 2025-06-23 12:51:56 +02:00
Fahad
b4852c825f Support for DIAL
Claude-3 models updated to Claude 4
2025-06-23 14:26:39 +04:00
Illya Havsiyevych
0623ce3546 feat: DIAL provider implementation (#112)
## Description

This PR implements a new [DIAL](https://dialx.ai/dial_api) (Data & AI Layer) provider for the Zen MCP Server, enabling unified access to multiple AI models through the DIAL API platform. DIAL provides enterprise-grade AI model access with deployment-specific routing similar to Azure OpenAI.

## Changes Made

- [x] Added support of atexit:
  - Ensures automatic cleanup of provider resources (HTTP clients, connection pools) on server shutdown
  - Fixed bug using ModelProviderRegistry.get_available_providers() instead of accessing private _providers
  - Works with SIGTERM/Ctrl+C for graceful shutdown in both development and containerized environments
- [x] Added new DIAL provider (`providers/dial.py`) inheriting from `OpenAICompatibleProvider`
- [x] Updated server.py to register DIAL provider during initialization
- [x] Updated provider registry to include DIAL provider type
- [x] Implemented deployment-specific routing for DIAL's Azure OpenAI-style endpoints
- [x] Implemented performance optimizations:
  - Connection pooling with httpx for better performance
  - Thread-safe client caching with double-check locking pattern
  - Proper resource cleanup with `close()` method
- [x] Added comprehensive unit tests with 16 test cases (`tests/test_dial_provider.py`)
- [x] Added DIAL configuration to `.env.example` with documentation
- [x] Added support for configurable API version via `DIAL_API_VERSION` environment variable
- [x] Added DIAL model restrictions support via `DIAL_ALLOWED_MODELS` environment variable

### Supported DIAL Models:
- OpenAI models: o3, o4-mini (and their dated versions)
- Google models: gemini-2.5-pro, gemini-2.5-flash (including search variant)
- Anthropic models: Claude 4 Opus/Sonnet (with and without thinking mode)

### Environment Variables:
- `DIAL_API_KEY`: Required API key for DIAL authentication
- `DIAL_API_HOST`: Optional base URL (defaults to https://core.dialx.ai)
- `DIAL_API_VERSION`: Optional API version header (defaults to 2025-01-01-preview)
- `DIAL_ALLOWED_MODELS`: Optional comma-separated list of allowed models

### Breaking Changes:
- None

  ### Dependencies:
  - No new dependencies added (uses existing OpenAI SDK with custom routing)
2025-06-23 14:07:10 +04:00
omryn-vera
4ae0344b14 feat: Update Claude model references from v3 to v4 (fixes issue #118) (#119)
* feat: Update Claude model references from v3 to v4

- Update model configurations from claude-3-opus to claude-4-opus
- Update model configurations from claude-3-sonnet to claude-4-sonnet
- Maintain backward compatibility through existing aliases (opus, sonnet, claude)
- Update provider registry preferred models list
- Update all test cases and assertions to reflect new model names
- Update documentation and examples consistently across all files
- Add Claude 4 model support while preserving existing functionality

Files modified: 15 (config, docs, providers, tests, tools)
Pattern: Systematic claude-3-* → claude-4-* model reference migration

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

Co-Authored-By: Claude <noreply@anthropic.com>

* PR feedback: changed anthropic/claude-4-opus -> anthropic/claude-opus-4 and anthropic/claude-4-haiku -> anthropic/claude-3.5-haiku

* changed anthropic/claude-4-sonnet -> anthropic/claude-sonnet-4

* PR feedback removed specific model from test mock

* PR feedback removed base.py

---------

Co-authored-by: Omry Nachman <omry@wix.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-06-23 13:57:13 +04:00
Fahad
8262d47c1e Updated readme with recommendations 2025-06-22 23:05:44 +04:00
Fahad
874e730a41 Updated readme with recommendations 2025-06-22 23:04:55 +04:00
Fahad
92a16b57cf Updated readme with recommendations 2025-06-22 22:59:42 +04:00
Fahad
dc6083694d Updated readme with recommendations 2025-06-22 22:56:47 +04:00
OhMyApps
12378addc9 fix: Update tests to use OpenAIModelProvider and improve UTF-8 handling 2025-06-22 19:34:55 +02:00
Fahad
669160755a Detect pyenv when available 2025-06-22 10:24:24 -07:00
OhMyApps
e9c5662b3a feat: Add LOCAL variable support for responses with UTF-8 JSON encoding.
Description: This feature adds support for UTF-8 encoding in JSON responses, allowing for proper handling of special characters and emojis.

- Implement unit tests for UTF-8 encoding in various model providers including Gemini, OpenAI, and OpenAI Compatible.
- Validate UTF-8 support in token counting, content generation, and error handling.
- Introduce tests for JSON serialization ensuring proper handling of French characters and emojis.
- Create tests for language instruction generation based on locale settings.
- Validate UTF-8 handling in workflow tools including AnalyzeTool, CodereviewTool, and DebugIssueTool.
- Ensure that all tests check for correct UTF-8 character preservation and proper JSON formatting.
- Add integration tests to verify the interaction between locale settings and model responses.
2025-06-22 19:13:02 +02:00
Brad Fair
3960835793 Fix duplicate version tool in MCP tool list (#121)
* fix: remove duplicate version tool registration

The version tool was appearing twice in the MCP tool list due to:
- VersionTool class properly registered in TOOLS dictionary (line 181)
- Hardcoded Tool() registration in handle_list_tools() (lines 451-462)

This duplicate was leftover from the architectural migration:
- June 8, 2025: Original hardcoded "get_version" tool added
- June 14, 2025: Renamed from "get_version" to "version"
- June 21, 2025: VersionTool class added during workflow architecture migration
- The old hardcoded registration was never removed

The hardcoded registration has been removed since VersionTool provides
identical functionality through the proper architecture.

Fixes: BeehiveInnovations/zen-mcp-server#120

* fix: complete removal of legacy version tool code

Following up on the duplicate version tool fix, this commit removes
all remaining dead code identified by Gemini Code Assist:

- Removed dead elif block for version tool (lines 639-643)
  This block was unreachable since version is handled by TOOLS registry

- Removed orphaned handle_version() function (lines 942-1030)
  No longer called after elif block removal

- Fixed imports: removed unused __author__ and __updated__ imports

These were remnants from the June 2025 migration from function-based
to class-based tools. The VersionTool class now handles all version
functionality through the standard tool architecture.

All 546 tests pass - no functional changes.

Related to: BeehiveInnovations/zen-mcp-server#120
2025-06-22 21:09:58 +04:00
Fahad
132c6ca025 secaudit - new tool for security audits 2025-06-22 15:29:05 +04:00
Beehive Innovations
000d12dc3a Add secaudit tool for security auditing (#117)
* WIP - working version

* Implement required methods
2025-06-22 15:28:05 +04:00
Beehive Innovations
327c801c9b Update README.md
Updated example
2025-06-22 14:55:53 +04:00
Fahad
0dff731b50 Lint 2025-06-22 13:38:41 +04:00
Fahad
521c6c0e61 Improved consensus to treat a step properly as both a request + response, and initial step includes Claude's assessment.
Improved prompt to not request for code when it's a general business decision
2025-06-22 13:37:32 +04:00
Fahad
18f6f16ac6 Improved consensus to treat a step properly as both a request + response, and initial step includes Claude's assessment.
Improved prompt to not request for code when it's a general business decision
2025-06-22 13:21:09 +04:00