From 5849a29aa839c89017411d1d81429a33af4de6dd Mon Sep 17 00:00:00 2001 From: latinogino <154024559+latinogino@users.noreply.github.com> Date: Fri, 29 Aug 2025 15:13:10 +0200 Subject: [PATCH] Add direct server runner that bypasses module installation --- run_server.bat | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 run_server.bat diff --git a/run_server.bat b/run_server.bat new file mode 100644 index 0000000..a4e049d --- /dev/null +++ b/run_server.bat @@ -0,0 +1,49 @@ +@echo off +echo 🚀 Run Dolibarr MCP Server (Direct Source) +echo. + +REM Set environment variables for Python path and encoding +set PYTHONPATH=%cd%\src +set PYTHONIOENCODING=utf-8 + +REM Check if virtual environment exists +if not exist venv_dolibarr\Scripts\python.exe ( + echo ❌ Virtual environment not found! + echo 💡 Run setup.bat first to create the environment + pause + exit /b 1 +) + +REM Check if .env exists +if not exist .env ( + echo ❌ Configuration file .env not found! + echo 💡 Please create .env file with your Dolibarr credentials + echo. + echo Example .env content: + echo DOLIBARR_URL=https://your-dolibarr-instance.com/api/index.php + echo DOLIBARR_API_KEY=your_api_key_here + echo LOG_LEVEL=INFO + echo. + pause + exit /b 1 +) + +echo 🎯 Starting Dolibarr MCP Server... +echo 📡 Server will run until you press Ctrl+C +echo ⚙️ Using direct source execution (no package installation required) +echo. + +REM Start the server with direct Python execution +cd /d "%~dp0" +venv_dolibarr\Scripts\python.exe -c " +import sys +import os +sys.path.insert(0, 'src') +from dolibarr_mcp.dolibarr_mcp_server import main +import asyncio +asyncio.run(main()) +" + +echo. +echo 🛑 Server stopped +pause