-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·56 lines (43 loc) · 1.32 KB
/
Copy pathrun.sh
File metadata and controls
executable file
·56 lines (43 loc) · 1.32 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
#!/bin/bash
# Startup script for MCP File Server
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "$SCRIPT_DIR"
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
echo -e "${GREEN}=== MCP File Server ===${NC}"
echo -e "${YELLOW}Secure web content fetching (NO JavaScript execution)${NC}"
# Check Python 3
if ! command -v python3 &> /dev/null; then
echo -e "${RED}Error: Python 3 not found${NC}"
exit 1
fi
# Create virtual environment
if [ ! -d ".venv" ]; then
echo -e "${YELLOW}Creating virtual environment...${NC}"
python3 -m venv .venv
if [ $? -ne 0 ]; then
echo -e "${RED}Error creating virtual environment${NC}"
exit 1
fi
fi
# Activate virtual environment
source .venv/bin/activate
# Install dependencies
echo -e "${YELLOW}Checking dependencies...${NC}"
pip install -q --upgrade pip
pip install -q -r requirements.txt
if [ $? -ne 0 ]; then
echo -e "${RED}Error installing dependencies${NC}"
exit 1
fi
# Create cache directory
mkdir -p .fetch_cache
echo -e "${GREEN}File Server started!${NC}"
echo -e "${YELLOW}Cache directory: ${SCRIPT_DIR}/.fetch_cache${NC}"
echo -e "${YELLOW}Security features: Path traversal protection, prompt injection detection, cookie handling${NC}"
echo ""
# Start the server
python3 main.py "$@"