-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_tcp_server.ps1
More file actions
57 lines (50 loc) · 1.98 KB
/
start_tcp_server.ps1
File metadata and controls
57 lines (50 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# PowerShell script to start the arXiv Research MCP Server on TCP port
# Usage: .\start_tcp_server.ps1 [--port 8080] [--host localhost]
param(
[int]$Port = 8090,
[string]$HostName = "localhost",
[switch]$Debug
)
Write-Host "Starting arXiv Research MCP Server on TCP port..." -ForegroundColor Green
Write-Host "Host: $HostName" -ForegroundColor Cyan
Write-Host "Port: $Port" -ForegroundColor Cyan
# Activate virtual environment
if (Test-Path ".venv\Scripts\activate.ps1") {
Write-Host "Activating virtual environment..." -ForegroundColor Yellow
& .\.venv\Scripts\activate.ps1
} elseif (Test-Path "venv\Scripts\activate.ps1") {
Write-Host "Activating virtual environment..." -ForegroundColor Yellow
& .\venv\Scripts\activate.ps1
} else {
Write-Host "Virtual environment not found. Please run: python -m venv .venv" -ForegroundColor Red
Write-Host "Or create a virtual environment named 'venv'" -ForegroundColor Red
exit 1
}
# Check if dependencies are installed
Write-Host "Checking dependencies..." -ForegroundColor Yellow
try {
$null = python -c "import mcp, feedparser, httpx, pydantic" 2>$null
if ($LASTEXITCODE -eq 0) {
Write-Host "Dependencies OK" -ForegroundColor Green
} else {
throw "Dependencies missing"
}
} catch {
Write-Host "Installing dependencies..." -ForegroundColor Yellow
pip install -r requirements.txt
if ($LASTEXITCODE -ne 0) {
Write-Host "Failed to install dependencies. Please check requirements.txt" -ForegroundColor Red
exit 1
}
}
# Build command arguments
$scriptArgs = @("scripts/run_server_tcp.py", "--host", $HostName, "--port", $Port)
if ($Debug) {
$scriptArgs += "--debug"
}
# Start the MCP server on TCP port
Write-Host "Starting MCP server on $HostName`:$Port..." -ForegroundColor Green
Write-Host "The server will listen for MCP protocol messages via TCP" -ForegroundColor Cyan
Write-Host "Press Ctrl+C to stop the server" -ForegroundColor Yellow
Write-Host ""
python @scriptArgs