@echo off
REM AnyDocs MCP Server Windows Startup Script
REM This batch file provides a convenient way to start the server on Windows
setlocal enabledelayedexpansion
REM Set the script directory as current directory
cd /d "%~dp0"
REM Check if Python is available
python --version >nul 2>&1
if errorlevel 1 (
echo Error: Python is not installed or not in PATH
echo Please install Python 3.8+ and try again
pause
exit /b 1
)
REM Check if virtual environment exists
if exist "venv\Scripts\activate.bat" (
echo Activating virtual environment...
call venv\Scripts\activate.bat
) else (
echo Warning: Virtual environment not found
echo Consider creating one with: python -m venv venv
)
REM Check if dependencies are installed
if not exist "src\anydocs_mcp" (
echo Error: Source code not found
echo Please ensure you're in the correct directory
pause
exit /b 1
)
REM Parse command line arguments
set MODE=both
set CONFIG_FILE=
set DEBUG_FLAG=
set INSTALL_DEPS=false
set EXTRA_ARGS=
:parse_args
if "%~1"=="" goto start_server
if "%~1"=="--mode" (
set MODE=%~2
shift
shift
goto parse_args
)
if "%~1"=="--config" (
set CONFIG_FILE=--config %~2
shift
shift
goto parse_args
)
if "%~1"=="--debug" (
set DEBUG_FLAG=--debug
shift
goto parse_args
)
if "%~1"=="--install-deps" (
set INSTALL_DEPS=true
shift
goto parse_args
)
if "%~1"=="--help" (
goto show_help
)
REM Add other arguments to EXTRA_ARGS
set EXTRA_ARGS=!EXTRA_ARGS! %~1
shift
goto parse_args
:start_server
echo.
echo ========================================
echo AnyDocs MCP Server Startup
echo ========================================
echo Mode: %MODE%
if not "%CONFIG_FILE%"=="" echo Config: %CONFIG_FILE%
if not "%DEBUG_FLAG%"=="" echo Debug: Enabled
echo.
REM Install dependencies if requested
if "%INSTALL_DEPS%"=="true" (
echo Installing dependencies...
where uv >nul 2>&1
if not errorlevel 1 (
uv install --dev
) else (
if exist "pyproject.toml" (
pip install -e .[dev]
) else (
echo Error: No pyproject.toml found and uv not available
pause
exit /b 1
)
)
echo Dependencies installed successfully
echo.
)
REM Kill any existing processes on default ports (optional)
REM netstat -ano | findstr :3000 >nul && (
REM echo Killing process on port 3000...
REM for /f "tokens=5" %%a in ('netstat -ano ^| findstr :3000') do taskkill /F /PID %%a >nul 2>&1
REM )
REM Start the server
echo Starting AnyDocs MCP Server...
python start.py --mode %MODE% %CONFIG_FILE% %DEBUG_FLAG% %EXTRA_ARGS%
REM Check exit code
if errorlevel 1 (
echo.
echo Error: Server failed to start
echo Check the logs for more information
pause
exit /b 1
)
echo.
echo Server stopped.
pause
exit /b 0
:show_help
echo.
echo AnyDocs MCP Server Windows Startup Script
echo.
echo Usage: start.bat [options]
echo.
echo Options:
echo --mode MODE Server mode: mcp, web, or both (default: both)
echo --config FILE Configuration file path
echo --debug Enable debug logging
echo --install-deps Install dependencies before starting
echo --help Show this help message
echo.
echo Examples:
echo start.bat Start both MCP server and web interface
echo start.bat --mode mcp Start only MCP server
echo start.bat --mode web Start only web interface
echo start.bat --debug Start with debug logging
echo start.bat --config custom.yaml Use custom config file
echo start.bat --install-deps Install dependencies and start
echo.
pause
exit /b 0
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/funky1688/AnyDocs-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server