setup.bat•2.89 kB
@echo off
echo Setting up Enhanced File Operations MCP Server with SSH...
echo.
REM Check if uv is installed
uv --version >nul 2>&1
if errorlevel 1 (
echo Error: uv is not installed or not in PATH
echo Please install uv first: https://docs.astral.sh/uv/getting-started/installation/
echo.
pause
exit /b 1
)
echo ✓ uv is installed
REM Initialize the project
echo.
echo Initializing project with uv...
uv init --no-readme
if errorlevel 1 (
echo Error: Failed to initialize project
pause
exit /b 1
)
echo ✓ Project initialized
REM Install dependencies (including paramiko for SSH)
echo.
echo Installing dependencies...
uv add mcp psutil paramiko
if errorlevel 1 (
echo Error: Failed to install dependencies
pause
exit /b 1
)
echo ✓ Dependencies installed
REM Download the enhanced server file if it doesn't exist
if not exist "enhanced_file_ops_server.py" (
echo.
echo Downloading enhanced_file_ops_server.py...
powershell -Command "Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/your-repo/enhanced-file-ops/main/enhanced_file_ops_server.py' -OutFile 'enhanced_file_ops_server.py'"
if errorlevel 1 (
echo.
echo Warning: Could not download the server file automatically.
echo Please manually create the enhanced_file_ops_server.py file in this directory
echo with the enhanced server code including SSH functionality.
echo.
) else (
echo ✓ Server file downloaded
)
) else (
echo ✓ Server file already exists
)
REM Create a batch file in the project directory to run the server
set "PROJECT_BAT=%CD%\StartEnhancedFileOpsServer.bat"
> "%PROJECT_BAT%" echo @echo off
>> "%PROJECT_BAT%" echo cd /d "%CD%"
>> "%PROJECT_BAT%" echo uv run enhanced_file_ops_server.py
REM Create a Startup batch file that runs the project batch file as admin
set "STARTUP_PATH=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup"
set "STARTUP_BAT=%STARTUP_PATH%\StartEnhancedFileOpsServer.bat"
> "%STARTUP_BAT%" echo @echo off
>> "%STARTUP_BAT%" echo powershell -Command "Start-Process '%PROJECT_BAT%' -Verb RunAs"
echo.
echo ✓ A startup script has been created at:
echo %STARTUP_BAT%
echo This will automatically run the server on Windows login WITH ADMINISTRATOR PRIVILEGES.
echo You will see a UAC prompt each time you log in.
echo To disable, delete the file above from your Startup folder.
echo.
echo.
echo Setup complete!
echo.
echo To test the server, run:
echo uv run enhanced_file_ops_server.py
echo.
echo Add this to your MCP client configuration:
echo.
echo {
echo "mcpServers": {
echo "enhanced-file-ops": {
echo "command": "uv",
echo "args": [
echo "--directory",
echo "%CD%",
echo "run",
echo "enhanced_file_ops_server.py"
echo ],
echo "env": {}
echo }
echo }
echo }
echo.
pause