#!/bin/bash# Determine the directory where this script is locatedSCRIPT_DIR="$(cd"$(dirname"${BASH_SOURCE[0]}")"&&pwd)"PROJECT_ROOT="$SCRIPT_DIR"# Run from the same directory# Define the server script pathSERVER_SCRIPT="${SCRIPT_DIR}/mcp_server.py"# Navigate to the project root directorycd"$PROJECT_ROOT"# Check if the virtual environment existsif[-d".venv"];thenecho"Activating virtual environment..."source.venv/bin/activate
elseecho"Creating virtual environment..."python3-mvenv.venv
source.venv/bin/activate
echo"Installing requirements..."pipinstall-rrequirements.txt
fiif[!-f"$SERVER_SCRIPT"];thenecho"Error: Server file $SERVER_SCRIPT not found"exit1fiecho"Starting MCP Inspector with server..."echo"URL should open in your browser shortly..."echo"Press Ctrl+C to stop."# Use the python executable from the virtual environmentPYTHON_EXEC="$PROJECT_ROOT/.venv/bin/python3"npx@modelcontextprotocol/inspector"$PYTHON_EXEC""$SERVER_SCRIPT"