setup_environment.sh•1.89 kB
#!/bin/bash
# Setup script for Resemble AI MCP Server
# This script creates a conda environment with Python 3.10 and installs all required packages
# Set error handling
set -e
echo "=== Setting up environment for Resemble AI MCP Server ==="
# Check if conda is installed
if ! command -v conda &> /dev/null; then
echo "Error: conda is not installed. Please install Miniconda or Anaconda."
exit 1
fi
# Create conda environment with Python 3.10
echo "Creating conda environment 'resemble_mcp' with Python 3.10..."
conda create -n resemble_mcp python=3.10 -y
# Activate the conda environment
echo "Activating conda environment..."
eval "$(conda shell.bash hook)"
conda activate resemble_mcp
# Install required packages
echo "Installing required packages..."
pip install uvicorn fastapi python-dotenv requests pydantic httpx sse-starlette
# Install MCP package from GitHub
echo "Installing MCP package from GitHub..."
pip install git+https://github.com/modelcontextprotocol/python-sdk.git
# Create .env file if it doesn't exist
if [ ! -f .env ]; then
echo "Creating .env file..."
if [ -f .env.example ]; then
cp .env.example .env
else
cat > .env << EOL
# Resemble AI API credentials
RESEMBLE_API_KEY=your_api_key_here
# Output settings
OUTPUT_DIR=./output
AUDIO_FORMAT=mp3
# Server settings
HOST=0.0.0.0
PORT=8083
EOL
fi
echo "Please edit .env file and add your Resemble AI API key"
else
echo ".env file already exists, keeping existing configuration"
fi
# Create output directory
echo "Creating output directory..."
mkdir -p output
echo ""
echo "=== Setup Complete ==="
echo ""
echo "To activate the environment and run the server:"
echo "conda activate resemble_mcp"
echo "python -m src.cli --implementation mcp --port 8083"
echo ""
echo "To connect Cursor to the server, use the SSE URL:"
echo "http://localhost:8083/sse"
echo ""