chore(vscode): add alpaca mcp env template
This commit is contained in:
parent
4e8bc25b7d
commit
f425ec3bd7
16
.vscode/mcp.json
vendored
16
.vscode/mcp.json
vendored
@ -1,18 +1,4 @@
|
|||||||
{
|
{
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"type": "promptString",
|
|
||||||
"id": "alpaca-api-key",
|
|
||||||
"description": "Alpaca API Key",
|
|
||||||
"password": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "promptString",
|
|
||||||
"id": "alpaca-secret-key",
|
|
||||||
"description": "Alpaca Secret Key",
|
|
||||||
"password": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"servers": {
|
"servers": {
|
||||||
"alpaca": {
|
"alpaca": {
|
||||||
"type": "stdio",
|
"type": "stdio",
|
||||||
@ -21,8 +7,6 @@
|
|||||||
"${workspaceFolder}/scripts/mcp/alpaca-mcp-server.sh"
|
"${workspaceFolder}/scripts/mcp/alpaca-mcp-server.sh"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"ALPACA_API_KEY": "${input:alpaca-api-key}",
|
|
||||||
"ALPACA_SECRET_KEY": "${input:alpaca-secret-key}",
|
|
||||||
"MCP_CLIENT": "vscode"
|
"MCP_CLIENT": "vscode"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
scripts/mcp/.env.example
Normal file
8
scripts/mcp/.env.example
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Copy this file to scripts/mcp/.env and replace the placeholder values.
|
||||||
|
# The real .env file is ignored by git.
|
||||||
|
|
||||||
|
ALPACA_API_KEY=your_alpaca_api_key
|
||||||
|
ALPACA_SECRET_KEY=your_alpaca_secret_key
|
||||||
|
|
||||||
|
# Optional: set to true for paper trading if supported by the installed server version.
|
||||||
|
ALPACA_PAPER_TRADE=true
|
||||||
@ -1,7 +1,28 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="${0:A:h}"
|
||||||
|
ENV_FILE="${ALPACA_MCP_ENV_FILE:-${SCRIPT_DIR}/.env}"
|
||||||
|
|
||||||
|
if [[ -f "${ENV_FILE}" ]]; then
|
||||||
|
set -a
|
||||||
|
source "${ENV_FILE}"
|
||||||
|
set +a
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${1:-}" == "--doctor" ]]; 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
|
||||||
|
echo "ok: Alpaca credential variables are set"
|
||||||
|
else
|
||||||
|
echo "warn: ALPACA_API_KEY and/or ALPACA_SECRET_KEY are not set"
|
||||||
|
fi
|
||||||
|
|
||||||
if command -v uvx >/dev/null 2>&1; then
|
if command -v uvx >/dev/null 2>&1; then
|
||||||
echo "ok: uvx available ($(command -v uvx))"
|
echo "ok: uvx available ($(command -v uvx))"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user