- Implemented `generate_mermaid_with_instances.py` to create ER diagrams that include all classes, relationships, enum values, and instance data. - Loaded instance data from YAML files and enriched enum definitions with meaningful annotations. - Configured output paths for generated diagrams in both frontend and schema directories. - Added support for excluding technical classes and limiting the number of displayed enum and instance values for readability.
154 lines
4 KiB
Bash
Executable file
154 lines
4 KiB
Bash
Executable file
#!/bin/bash
|
|
# Social Media MCP Server - Setup Script
|
|
#
|
|
# This script sets up the development environment for the Social Media MCP server.
|
|
|
|
set -e # Exit on error
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$SCRIPT_DIR"
|
|
|
|
echo "=============================================="
|
|
echo " Social Media MCP Server - Setup"
|
|
echo "=============================================="
|
|
echo ""
|
|
|
|
# Check for Python 3.10+
|
|
echo "Checking Python version..."
|
|
if command -v python3 &> /dev/null; then
|
|
PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
|
|
MAJOR=$(echo $PYTHON_VERSION | cut -d. -f1)
|
|
MINOR=$(echo $PYTHON_VERSION | cut -d. -f2)
|
|
|
|
if [ "$MAJOR" -ge 3 ] && [ "$MINOR" -ge 10 ]; then
|
|
echo " Python $PYTHON_VERSION found"
|
|
else
|
|
echo " ERROR: Python 3.10+ required, found $PYTHON_VERSION"
|
|
exit 1
|
|
fi
|
|
else
|
|
echo " ERROR: Python 3 not found"
|
|
exit 1
|
|
fi
|
|
|
|
# Create virtual environment
|
|
echo ""
|
|
echo "Creating virtual environment..."
|
|
if [ -d ".venv" ]; then
|
|
echo " .venv already exists, skipping..."
|
|
else
|
|
python3 -m venv .venv
|
|
echo " Created .venv"
|
|
fi
|
|
|
|
# Activate virtual environment
|
|
echo ""
|
|
echo "Activating virtual environment..."
|
|
source .venv/bin/activate
|
|
echo " Activated"
|
|
|
|
# Upgrade pip
|
|
echo ""
|
|
echo "Upgrading pip..."
|
|
pip install --upgrade pip --quiet
|
|
|
|
# Install dependencies
|
|
echo ""
|
|
echo "Installing dependencies..."
|
|
pip install -e . --quiet
|
|
echo " Installed: httpx, mcp, yt-dlp, beautifulsoup4"
|
|
|
|
# Check for yt-dlp system installation (preferred for better codec support)
|
|
echo ""
|
|
echo "Checking yt-dlp installation..."
|
|
if command -v yt-dlp &> /dev/null; then
|
|
YTDLP_VERSION=$(yt-dlp --version)
|
|
echo " yt-dlp $YTDLP_VERSION found (system)"
|
|
else
|
|
echo " yt-dlp not found system-wide"
|
|
echo " Using pip-installed version (may have limited codec support)"
|
|
echo " For best results, install with: brew install yt-dlp"
|
|
fi
|
|
|
|
# Create .env template if it doesn't exist
|
|
echo ""
|
|
echo "Checking environment configuration..."
|
|
if [ -f ".env" ]; then
|
|
echo " .env file already exists"
|
|
else
|
|
cat > .env.example << 'EOF'
|
|
# YouTube API (optional - falls back to yt-dlp if not set)
|
|
YOUTUBE_API_KEY=
|
|
|
|
# LinkedIn (choose one method)
|
|
# Option 1: Session cookie (recommended)
|
|
LINKEDIN_COOKIE=
|
|
# Option 2: Email/Password (less reliable)
|
|
LINKEDIN_EMAIL=
|
|
LINKEDIN_PASSWORD=
|
|
|
|
# Facebook Graph API
|
|
FACEBOOK_ACCESS_TOKEN=
|
|
FACEBOOK_PAGE_ID=
|
|
FACEBOOK_API_VERSION=v19.0
|
|
|
|
# Instagram Graph API (via Facebook)
|
|
INSTAGRAM_ACCESS_TOKEN=
|
|
INSTAGRAM_BUSINESS_ACCOUNT_ID=
|
|
INSTAGRAM_API_VERSION=v19.0
|
|
EOF
|
|
echo " Created .env.example template"
|
|
echo " Copy to .env and fill in your credentials:"
|
|
echo " cp .env.example .env"
|
|
fi
|
|
|
|
# Test the server can start
|
|
echo ""
|
|
echo "Testing server import..."
|
|
if python -c "import server" 2>/dev/null; then
|
|
echo " Server module imports successfully"
|
|
else
|
|
echo " WARNING: Server import failed. Check for missing dependencies."
|
|
fi
|
|
|
|
# Print summary
|
|
echo ""
|
|
echo "=============================================="
|
|
echo " Setup Complete!"
|
|
echo "=============================================="
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo ""
|
|
echo "1. Configure credentials:"
|
|
echo " cp .env.example .env"
|
|
echo " # Edit .env with your API keys/tokens"
|
|
echo ""
|
|
echo "2. Test the server:"
|
|
echo " source .venv/bin/activate"
|
|
echo " python server.py"
|
|
echo ""
|
|
echo "3. Add to your MCP client config (OpenCode/Claude Desktop)"
|
|
echo " See README.md for configuration examples"
|
|
echo ""
|
|
echo "Configured platforms:"
|
|
if [ -n "$YOUTUBE_API_KEY" ]; then
|
|
echo " - YouTube: API Key set"
|
|
else
|
|
echo " - YouTube: Not configured (will use yt-dlp fallback)"
|
|
fi
|
|
if [ -n "$LINKEDIN_COOKIE" ]; then
|
|
echo " - LinkedIn: Cookie set"
|
|
else
|
|
echo " - LinkedIn: Not configured"
|
|
fi
|
|
if [ -n "$FACEBOOK_ACCESS_TOKEN" ]; then
|
|
echo " - Facebook: Access token set"
|
|
else
|
|
echo " - Facebook: Not configured"
|
|
fi
|
|
if [ -n "$INSTAGRAM_ACCESS_TOKEN" ]; then
|
|
echo " - Instagram: Access token set"
|
|
else
|
|
echo " - Instagram: Not configured"
|
|
fi
|
|
echo ""
|