Add DeepSeek AI MCP assistant
This commit is contained in:
2
MES-Manager_View/scripts/ai-status.bat
Normal file
2
MES-Manager_View/scripts/ai-status.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
@echo off
|
||||
powershell -ExecutionPolicy Bypass -File "%~dp0ai-status.ps1"
|
||||
10
MES-Manager_View/scripts/ai-status.ps1
Normal file
10
MES-Manager_View/scripts/ai-status.ps1
Normal file
@@ -0,0 +1,10 @@
|
||||
$connections = Get-NetTCPConnection -LocalPort 3100 -State Listen -ErrorAction SilentlyContinue
|
||||
if (-not $connections) {
|
||||
Write-Output "AI MCP service is not running."
|
||||
exit 1
|
||||
}
|
||||
|
||||
$connections | ForEach-Object {
|
||||
$process = Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue
|
||||
Write-Output ("AI MCP service is running. PID={0}, Process={1}, URL=http://127.0.0.1:3100" -f $_.OwningProcess, $process.ProcessName)
|
||||
}
|
||||
2
MES-Manager_View/scripts/start-daily.bat
Normal file
2
MES-Manager_View/scripts/start-daily.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
@echo off
|
||||
powershell -ExecutionPolicy Bypass -File "%~dp0start-daily.ps1"
|
||||
19
MES-Manager_View/scripts/start-daily.ps1
Normal file
19
MES-Manager_View/scripts/start-daily.ps1
Normal file
@@ -0,0 +1,19 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$logDir = Join-Path $root "mcp-server"
|
||||
$outLog = Join-Path $logDir "ai-mcp.out.log"
|
||||
$errLog = Join-Path $logDir "ai-mcp.err.log"
|
||||
|
||||
Set-Location $root
|
||||
npm run kb:build
|
||||
|
||||
$existing = Get-NetTCPConnection -LocalPort 3100 -State Listen -ErrorAction SilentlyContinue
|
||||
if ($existing) {
|
||||
Write-Output "AI MCP service already listening on port 3100."
|
||||
exit 0
|
||||
}
|
||||
|
||||
Start-Process -FilePath "node" -ArgumentList "mcp-server/server.js" -WorkingDirectory $root -RedirectStandardOutput $outLog -RedirectStandardError $errLog -WindowStyle Hidden
|
||||
Start-Sleep -Seconds 2
|
||||
Write-Output "AI MCP service started: http://127.0.0.1:3100"
|
||||
2
MES-Manager_View/scripts/stop-ai.bat
Normal file
2
MES-Manager_View/scripts/stop-ai.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
@echo off
|
||||
powershell -ExecutionPolicy Bypass -File "%~dp0stop-ai.ps1"
|
||||
13
MES-Manager_View/scripts/stop-ai.ps1
Normal file
13
MES-Manager_View/scripts/stop-ai.ps1
Normal file
@@ -0,0 +1,13 @@
|
||||
$connections = Get-NetTCPConnection -LocalPort 3100 -State Listen -ErrorAction SilentlyContinue
|
||||
if (-not $connections) {
|
||||
Write-Output "AI MCP service is not running on port 3100."
|
||||
exit 0
|
||||
}
|
||||
|
||||
$connections | ForEach-Object {
|
||||
$pidValue = $_.OwningProcess
|
||||
if ($pidValue) {
|
||||
Stop-Process -Id $pidValue -Force
|
||||
Write-Output "Stopped AI MCP process $pidValue."
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user