-
-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathclojure-mcp-dev.sh
More file actions
38 lines (27 loc) · 1.04 KB
/
clojure-mcp-dev.sh
File metadata and controls
38 lines (27 loc) · 1.04 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
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Create logs directory if it doesn't exist
mkdir -p "$SCRIPT_DIR/logs"
cd "$SCRIPT_DIR"
# Generate timestamp for log files
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
STDIN_LOG="$SCRIPT_DIR/logs/mcp_stdin.log"
STDOUT_LOG="$SCRIPT_DIR/logs/mcp_stdout.log"
source ~/.current_api_keys
# Create a named pipe for stdin capture
PIPE=$(mktemp -u)
mkfifo "$PIPE"
PORT=7888
# PORT=44264
# PORT=58709 # conj-talk
# Start tee process to capture stdin in background
tee "$STDIN_LOG" < "$PIPE" | clojure -X:dev-mcp :not-cwd true :enable-logging? true :port $PORT 2>&1 | tee "$STDOUT_LOG" &
# tee "$STDIN_LOG" < "$PIPE" | clojure -X:mcp-shadow :enable-logging? true :port $PORT 2>&1 | tee "$STDOUT_LOG" &
# tee "$STDIN_LOG" < "$PIPE" | clojure -X:mcp-shadow-dual :enable-logging? true :port 7888 :shadow-port $PORT 2>&1 | tee "$STDOUT_LOG" &
# Get the PID of the background pipeline
CLOJURE_PID=$!
# Redirect stdin to the pipe
cat > "$PIPE"
# Clean up
rm "$PIPE"
wait $CLOJURE_PID