From 9e3f99e7a9f7ba155113c78cbb66bf2d98c61419 Mon Sep 17 00:00:00 2001 From: Saravana Achu Mac Date: Wed, 6 May 2026 09:37:44 -0700 Subject: [PATCH] fix(vscode): make alpaca mcp launcher sh-compatible --- .vscode/mcp.json | 2 +- scripts/mcp/alpaca-mcp-server.sh | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.vscode/mcp.json b/.vscode/mcp.json index 65076e6..ed734d3 100644 --- a/.vscode/mcp.json +++ b/.vscode/mcp.json @@ -2,7 +2,7 @@ "servers": { "alpaca": { "type": "stdio", - "command": "zsh", + "command": "sh", "args": [ "${workspaceFolder}/scripts/mcp/alpaca-mcp-server.sh" ], diff --git a/scripts/mcp/alpaca-mcp-server.sh b/scripts/mcp/alpaca-mcp-server.sh index 0407c02..a4bbea8 100644 --- a/scripts/mcp/alpaca-mcp-server.sh +++ b/scripts/mcp/alpaca-mcp-server.sh @@ -1,23 +1,23 @@ -#!/usr/bin/env zsh -set -euo pipefail +#!/usr/bin/env sh +set -eu -SCRIPT_DIR="${0:A:h}" +SCRIPT_DIR="$(CDPATH= cd "$(dirname "$0")" && pwd -P)" ENV_FILE="${ALPACA_MCP_ENV_FILE:-${SCRIPT_DIR}/.env}" -if [[ -f "${ENV_FILE}" ]]; then +if [ -f "${ENV_FILE}" ]; then set -a - source "${ENV_FILE}" + . "${ENV_FILE}" set +a fi -if [[ "${1:-}" == "--doctor" ]]; then - if [[ -f "${ENV_FILE}" ]]; then +if [ "${1:-}" = "--doctor" ]; then + if [ -f "${ENV_FILE}" ]; then echo "ok: env file found (${ENV_FILE})" else echo "warn: env file not found (${ENV_FILE}); copy scripts/mcp/.env.example to scripts/mcp/.env" fi - if [[ -n "${ALPACA_API_KEY:-}" && -n "${ALPACA_SECRET_KEY:-}" ]]; then + if [ -n "${ALPACA_API_KEY:-}" ] && [ -n "${ALPACA_SECRET_KEY:-}" ]; then echo "ok: Alpaca credential variables are set" else echo "warn: ALPACA_API_KEY and/or ALPACA_SECRET_KEY are not set"