We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jray2123/zen-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
code_quality_checks.shโข3.04 kB
#!/bin/bash
# Zen MCP Server - Code Quality Checks
# This script runs all required linting and testing checks before committing changes.
# ALL checks must pass 100% for CI/CD to succeed.
set -e # Exit on any error
echo "๐ Running Code Quality Checks for Zen MCP Server"
echo "================================================="
# Determine Python command
if [[ -f ".zen_venv/bin/python" ]]; then
PYTHON_CMD=".zen_venv/bin/python"
PIP_CMD=".zen_venv/bin/pip"
echo "โ Using venv"
elif [[ -n "$VIRTUAL_ENV" ]]; then
PYTHON_CMD="python"
PIP_CMD="pip"
echo "โ Using activated virtual environment: $VIRTUAL_ENV"
else
echo "โ No virtual environment found!"
echo "Please run: ./run-server.sh first to set up the environment"
exit 1
fi
echo ""
# Check and install dev dependencies if needed
echo "๐ Checking development dependencies..."
DEV_DEPS_NEEDED=false
# Check each dev dependency
for tool in ruff black isort pytest; do
# Check if tool exists in venv or in PATH
if [[ -f ".zen_venv/bin/$tool" ]] || command -v $tool &> /dev/null; then
continue
else
DEV_DEPS_NEEDED=true
break
fi
done
if [ "$DEV_DEPS_NEEDED" = true ]; then
echo "๐ฆ Installing development dependencies..."
$PIP_CMD install -q -r requirements-dev.txt
echo "โ Development dependencies installed"
else
echo "โ Development dependencies already installed"
fi
# Set tool paths
if [[ -f ".zen_venv/bin/ruff" ]]; then
RUFF=".zen_venv/bin/ruff"
BLACK=".zen_venv/bin/black"
ISORT=".zen_venv/bin/isort"
PYTEST=".zen_venv/bin/pytest"
else
RUFF="ruff"
BLACK="black"
ISORT="isort"
PYTEST="pytest"
fi
echo ""
# Step 1: Linting and Formatting
echo "๐ Step 1: Running Linting and Formatting Checks"
echo "--------------------------------------------------"
echo "๐ง Running ruff linting with auto-fix..."
$RUFF check --fix --exclude test_simulation_files
echo "๐จ Running black code formatting..."
$BLACK . --exclude="test_simulation_files/"
echo "๐ฆ Running import sorting with isort..."
$ISORT . --skip-glob=".zen_venv/*" --skip-glob="test_simulation_files/*"
echo "โ Verifying all linting passes..."
$RUFF check --exclude test_simulation_files
echo "โ Step 1 Complete: All linting and formatting checks passed!"
echo ""
# Step 2: Unit Tests
echo "๐งช Step 2: Running Complete Unit Test Suite"
echo "---------------------------------------------"
echo "๐ Running unit tests (excluding integration tests)..."
$PYTHON_CMD -m pytest tests/ -v -x -m "not integration"
echo "โ Step 2 Complete: All unit tests passed!"
echo ""
# Step 3: Final Summary
echo "๐ All Code Quality Checks Passed!"
echo "=================================="
echo "โ Linting (ruff): PASSED"
echo "โ Formatting (black): PASSED"
echo "โ Import sorting (isort): PASSED"
echo "โ Unit tests: PASSED"
echo ""
echo "๐ Your code is ready for commit and GitHub Actions!"
echo "๐ก Remember to add simulator tests if you modified tools"