Files
my-pal-mcp-server/run_gemini.sh
Fahad 0b424cdd6a fix: handle root directory startup error from Claude Desktop
- When started from Claude Desktop, working directory might be "/"
- Now defaults to user home directory if cwd is "/"
- Startup scripts change to script directory for consistency
- Simplified README to remove implementation details about PROJECT_ROOT

This fixes the "MCP_PROJECT_ROOT cannot be set to '/'" error
while maintaining security by preventing filesystem-wide access.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 20:18:24 +04:00

22 lines
677 B
Bash
Executable File

#!/bin/bash
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check if virtual environment exists
if [ -d "$SCRIPT_DIR/venv" ]; then
# Activate virtual environment
source "$SCRIPT_DIR/venv/bin/activate"
PYTHON_EXEC="python"
else
# Fallback to system Python if venv doesn't exist
echo "Warning: Virtual environment not found at $SCRIPT_DIR/venv" >&2
echo "Using system Python. Make sure dependencies are installed." >&2
PYTHON_EXEC="python3"
fi
# Change to script directory to ensure proper working directory
cd "$SCRIPT_DIR"
# Run the server
exec "$PYTHON_EXEC" "$SCRIPT_DIR/server.py"