#!/usr/bin/env bash
# usage: mcp.sh <before|after> <tool> <json-args>   (token read from file, never echoed)
set -u
case $1 in before) dir=/tmp/ev-23636/base; port=4361;; after) dir=/home/ubuntu/wt/pr-23636; port=4362;; esac
cd "$dir"
T3_ACP_MCP_ENDPOINT="http://127.0.0.1:$port/mcp" T3_ACP_MCP_AUTHORIZATION="Bearer $(tr -d '\n' < /tmp/ev-23636/driver/.tok-$1)" \
  node apps/server/src/bin.ts acp-mcp-call "$2" "$3"
