-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-claude
executable file
·60 lines (49 loc) · 1.28 KB
/
install-claude
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
#!/usr/bin/env bash
set -euo pipefail
usage() {
echo "usage: $(basename "$0") [--no-npm-install]"
exit 1
}
echo "Installing Claude requirements..."
mkdir -p ~/.claude/servers/
mkdir -p ~/.claude/storage/memory
if ! [[ -f ~/.claude/servers/.env ]]; then
echo "Creating .env file"
cat > ~/.claude/servers/.env <<EOF
EXA_API_KEY=
NYTIMES_API_KEY=
EOF
fi
if ! [[ -f ~/.claude/storage/memory/memory.json ]]; then
echo "Creating memory.json file"
cat > ~/.claude/storage/memory/memory.json <<EOF
{}
EOF
fi
if ! command -v tsx &>/dev/null; then
echo "Installing tsx"
npm install --global tsx
fi
ensure_mcp() {
local repo dir
repo=$1
dir=~/.claude/servers/$(basename $repo .git)
echo "Configuring $repo"
if ! [[ -d $dir ]]; then
echo "Cloning $repo"
git clone $repo $dir
(cd $dir && npm install --no-package-lock)
else
(cd $dir && {
local before=""
before=$(git rev-parse HEAD)
git pull >/dev/null
if [[ $before != $(git rev-parse HEAD) ]]; then
npm install --no-package-lock
fi
})
fi
}
ensure_mcp [email protected]:collinvandyck/mcp-servers.git
ensure_mcp [email protected]:exa-labs/exa-mcp-server.git
ensure_mcp [email protected]:angheljf/nyt.git