#!/bin/bash
# Setup script for docx-mcp development environment
set -e
echo "Setting up docx-mcp development environment..."
# Check if Python 3.10+ is available
if ! command -v python3 &> /dev/null; then
echo "Error: Python 3 is not installed"
exit 1
fi
PYTHON_VERSION=$(python3 --version | cut -d' ' -f2 | cut -d'.' -f1,2)
echo "Using Python $PYTHON_VERSION"
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
echo "Activating virtual environment..."
source venv/bin/activate
# Install uv if not already installed
if ! command -v uv &> /dev/null; then
echo "Installing uv..."
pip install --upgrade pip
pip install uv
fi
# Install dependencies
echo "Installing dependencies..."
uv sync
# Create logs directory
mkdir -p logs
echo "✓ Setup complete!"
echo ""
echo "To activate the environment, run:"
echo " source venv/bin/activate"
echo ""
echo "To run the server, use:"
echo " ./run.sh"
echo ""
echo "To run tests, use:"
echo " uv run pytest tests/"