This repository was archived by the owner on Feb 16, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·61 lines (49 loc) · 1.87 KB
/
install.sh
File metadata and controls
executable file
·61 lines (49 loc) · 1.87 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
#!/usr/bin/env bash
# Todoist MCP Server - Claude Code Installation Script
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONFIG_FILE="${SCRIPT_DIR}/config.json"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
info() { echo -e "${GREEN}[INFO]${NC} $1"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
error() { echo -e "${RED}[ERROR]${NC} $1"; exit 1; }
# Check for jq
command -v jq >/dev/null 2>&1 || error "jq is required. Install with: sudo apt install jq"
# Check for config.json
if [[ ! -f "$CONFIG_FILE" ]]; then
if [[ -f "${SCRIPT_DIR}/config.json.example" ]]; then
info "Creating config.json from example..."
cp "${SCRIPT_DIR}/config.json.example" "$CONFIG_FILE"
warn "Please edit config.json with your Todoist API token, then re-run this script."
warn "Get your token from: Todoist → Settings → Integrations → Developer"
exit 0
else
error "config.json not found. Create it from config.json.example"
fi
fi
# Parse config.json
TODOIST_TOKEN=$(jq -r '.todoist_api_token // ""' "$CONFIG_FILE")
# Validate
if [[ -z "$TODOIST_TOKEN" ]]; then
error "todoist_api_token not configured in config.json"
fi
# Create Python venv if needed
if [[ ! -d "${SCRIPT_DIR}/.venv" ]]; then
info "Creating Python virtual environment..."
python3 -m venv "${SCRIPT_DIR}/.venv"
info "Installing dependencies..."
"${SCRIPT_DIR}/.venv/bin/pip" install -q -r "${SCRIPT_DIR}/requirements.txt"
fi
# Register with Claude Code
MCP_NAME="todoist"
PYTHON_PATH="${SCRIPT_DIR}/.venv/bin/python"
info "Registering MCP server with Claude Code..."
claude mcp add "$MCP_NAME" -s user \
--env "TODOIST_API_TOKEN=${TODOIST_TOKEN}" \
-- "$PYTHON_PATH" "${SCRIPT_DIR}/todoist_mcp.py"
info "Todoist MCP server registered successfully!"
info "Restart Claude Code to use the new server."