install_and_test.shโข1.33 kB
#!/bin/bash
# MCP Web Research Scraper - Installation and Test Script
echo "๐ Installing MCP Web Research Scraper..."
# Check if Python is available
if ! command -v python3 &> /dev/null; then
echo "โ Python 3 is required but not installed"
exit 1
fi
# Create virtual environment (optional but recommended)
echo "๐ฆ Setting up Python environment..."
python3 -m venv venv 2>/dev/null || echo "Using system Python..."
if [ -d "venv" ]; then
source venv/bin/activate
fi
# Install dependencies
echo "๐ Installing dependencies..."
pip install mcp requests beautifulsoup4 urllib3
# Install the package in development mode
echo "๐ง Installing MCP scraper..."
pip install -e .
# Run tests
echo "๐งช Running tests..."
python test_mcp_scraper.py
echo ""
echo "โ
Installation complete!"
echo ""
echo "๐ Next steps:"
echo "1. Configure your MCP client to use the scraper:"
echo ""
echo 'Add to your MCP client config:'
echo '{'
echo ' "mcpServers": {'
echo ' "web-research-scraper": {'
echo ' "command": "python",'
echo ' "args": ["'$(pwd)'/server.py"]'
echo ' }'
echo ' }'
echo '}'
echo ""
echo "2. Test the scraper with your MCP client"
echo "3. Start using the web research tools!"
echo ""
# Deactivate virtual environment if we created one
if [ -d "venv" ]; then
deactivate
fi