forked from alpadalar/fortigate-mcp-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_http_server.sh
More file actions
executable file
·37 lines (31 loc) · 855 Bytes
/
start_http_server.sh
File metadata and controls
executable file
·37 lines (31 loc) · 855 Bytes
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
#!/bin/bash
# Start FortiGate MCP HTTP Server
set -e
# Default values
HOST="${MCP_HTTP_HOST:-0.0.0.0}"
PORT="${MCP_HTTP_PORT:-8814}"
PATH="${MCP_HTTP_PATH:-/fortigate-mcp}"
CONFIG="${FORTIGATE_MCP_CONFIG:-$(pwd)/config/config.json}"
# Check if config exists
if [ ! -f "$CONFIG" ]; then
echo "Error: Configuration file not found at $CONFIG"
echo "Please create config.json from config.example.json"
exit 1
fi
echo "Starting FortiGate MCP HTTP Server..."
echo "Host: $HOST"
echo "Port: $PORT"
echo "Path: $PATH"
echo "Config: $CONFIG"
echo ""
# Activate virtual environment if it exists
if [ -d ".venv" ]; then
echo "Activating virtual environment..."
source .venv/bin/activate
fi
# Run the server
exec python -m src.fortigate_mcp.server_http \
--host "$HOST" \
--port "$PORT" \
--path "$PATH" \
--config "$CONFIG"