- 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>
27 lines
954 B
Batchfile
27 lines
954 B
Batchfile
@echo off
|
|
REM Windows batch script to run Gemini MCP server
|
|
|
|
REM Get the directory where this script is located
|
|
set SCRIPT_DIR=%~dp0
|
|
|
|
REM Change to script directory to ensure proper working directory
|
|
cd /d "%SCRIPT_DIR%"
|
|
|
|
REM Check if virtual environment exists
|
|
if exist "%SCRIPT_DIR%venv\Scripts\activate.bat" (
|
|
REM Activate the virtual environment
|
|
call "%SCRIPT_DIR%venv\Scripts\activate.bat"
|
|
python "%SCRIPT_DIR%server.py"
|
|
) else (
|
|
REM Try to use python directly if no venv
|
|
echo Warning: Virtual environment not found at %SCRIPT_DIR%venv >&2
|
|
echo Attempting to run with system Python... >&2
|
|
python "%SCRIPT_DIR%server.py"
|
|
if errorlevel 1 (
|
|
echo Error: Failed to run server. Please ensure Python is installed and dependencies are available. >&2
|
|
echo Run: python -m venv venv >&2
|
|
echo Then: venv\Scripts\activate >&2
|
|
echo Then: pip install -r requirements.txt >&2
|
|
exit /b 1
|
|
)
|
|
) |