fix(vscode): make alpaca mcp launcher sh-compatible

This commit is contained in:
Saravana Achu Mac 2026-05-06 09:37:44 -07:00
parent f425ec3bd7
commit 9e3f99e7a9
2 changed files with 9 additions and 9 deletions

2
.vscode/mcp.json vendored
View File

@ -2,7 +2,7 @@
"servers": {
"alpaca": {
"type": "stdio",
"command": "zsh",
"command": "sh",
"args": [
"${workspaceFolder}/scripts/mcp/alpaca-mcp-server.sh"
],

View File

@ -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"