-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·154 lines (135 loc) · 4.84 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·154 lines (135 loc) · 4.84 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/bin/bash
# MCP Deck Installation Script
# Installs dependencies and sets up a container runtime + Qdrant for local
# development. Does NOT touch your Claude Desktop / Claude Code config --
# it prints the JSON snippet to add yourself (see the end of this script).
set -e
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${BLUE}MCP Deck Installation${NC}"
echo "This script installs dependencies and sets up a container runtime for Qdrant."
echo ""
# Check platform
PLATFORM=$(uname -s)
ARCH=$(uname -m)
echo -e "${YELLOW}Platform: $PLATFORM $ARCH${NC}"
# Check if we're on macOS
if [[ "$PLATFORM" != "Darwin" ]]; then
echo -e "${YELLOW}Note: Apple Container Framework is only available on macOS${NC}"
echo -e "${YELLOW}Will use Docker as container runtime${NC}"
fi
# Check Python/UV
if ! command -v uv &> /dev/null; then
echo -e "${RED}Error: uv package manager not found${NC}"
echo "Please install uv from: https://docs.astral.sh/uv/getting-started/installation/"
echo "(via pipx: pipx install uv)"
exit 1
fi
echo -e "${GREEN}✓ uv found${NC}"
# Install Python dependencies
echo -e "${YELLOW}Installing Python dependencies...${NC}"
uv sync --extra dev
# Detect and setup container runtime
echo -e "${YELLOW}Detecting container runtime...${NC}"
DOCKER_AVAILABLE=false
APPLE_CONTAINER_AVAILABLE=false
# Check Docker
if command -v docker &> /dev/null && docker info &> /dev/null 2>&1; then
DOCKER_AVAILABLE=true
echo -e "${GREEN}✓ Docker detected and running${NC}"
fi
# Check Apple Container (macOS only)
if [[ "$PLATFORM" == "Darwin" && "$ARCH" == "arm64" ]]; then
if command -v container &> /dev/null; then
APPLE_CONTAINER_AVAILABLE=true
echo -e "${GREEN}✓ Apple Container Framework detected${NC}"
fi
fi
# Determine runtime to use
RUNTIME=""
if [[ "$APPLE_CONTAINER_AVAILABLE" == true ]]; then
RUNTIME="apple"
echo -e "${BLUE}Selected runtime: Apple Container Framework${NC}"
elif [[ "$DOCKER_AVAILABLE" == true ]]; then
RUNTIME="docker"
echo -e "${BLUE}Selected runtime: Docker${NC}"
else
echo -e "${YELLOW}No container runtime found.${NC}"
echo "MCP Deck still works without one -- resilient init means tool selection"
echo "(vector/LLM/RAG routing) is simply unavailable until Qdrant is reachable."
echo ""
echo "To enable it, install one of the following:"
echo " - Docker: https://docs.docker.com/get-docker/"
if [[ "$PLATFORM" == "Darwin" && "$ARCH" == "arm64" ]]; then
echo " - Apple Container Framework: https://github.com/apple/container"
fi
RUNTIME="none"
fi
# Setup container runtime + start Qdrant
if [[ "$RUNTIME" == "apple" ]]; then
echo -e "${YELLOW}Setting up Apple Container Framework...${NC}"
./scripts/setup-apple-container.sh
./scripts/qdrant-apple-container.sh start
elif [[ "$RUNTIME" == "docker" ]]; then
echo -e "${YELLOW}Setting up Docker containers...${NC}"
docker-compose pull qdrant
docker-compose up -d qdrant
fi
# Test installation
echo -e "${YELLOW}Testing installation...${NC}"
if timeout 10 uv run mcpdeck health &> /dev/null; then
echo -e "${GREEN}✓ Installation test passed${NC}"
else
echo -e "${YELLOW}⚠ Installation test inconclusive (this is often normal without Qdrant/LM Studio running)${NC}"
fi
PROJECT_DIR="$(pwd)"
# Determine where Claude Desktop's config lives, for reference only -- this
# script never writes to it.
CONFIG_FILE="$HOME/.config/claude-desktop/claude_desktop_config.json"
if [[ "$PLATFORM" == "Darwin" ]]; then
CONFIG_FILE="$HOME/Library/Application Support/Claude/claude_desktop_config.json"
fi
echo ""
echo -e "${GREEN}Installation Complete!${NC}"
echo ""
echo "Next step: add MCP Deck to your MCP client yourself. This script does not"
echo "modify your Claude Desktop / Claude Code config -- merge this snippet into:"
echo -e "${BLUE} $CONFIG_FILE${NC}"
echo "(Claude Code: add an equivalent entry to .mcp.json in your project, or"
echo "run 'claude mcp add' -- see the Claude Code docs.)"
echo ""
cat <<EOF
{
"mcpServers": {
"mcpdeck": {
"command": "uv",
"args": [
"run",
"--project",
"$PROJECT_DIR",
"mcpdeck",
"serve",
"--mcp-servers-json",
"/absolute/path/to/your/mcp-servers.json"
]
}
}
}
EOF
echo ""
echo "Replace the --mcp-servers-json path with your child-server config (Claude"
echo "Desktop format), then restart your MCP client."
echo ""
echo "Useful commands:"
echo " - Dashboard mode: ./scripts/start-mcpdeck.sh --web-ui"
echo " - Health check: uv run mcpdeck health"
echo " - View logs: tail -f logs/mcpdeck.log"
if [[ "$RUNTIME" == "apple" ]]; then
echo " - Manage Qdrant: ./scripts/qdrant-apple-container.sh status"
elif [[ "$RUNTIME" == "docker" ]]; then
echo " - Manage Qdrant: docker-compose ps"
fi