#!/bin/bash # Lambda Web Adapter bootstrap for workspace-mcp # Dependencies are in /opt/python (Lambda layer) set -e PYTHON=/var/lang/bin/python3 export PYTHONPATH="/opt/python:/opt/python/lib/python3.12/site-packages:$PYTHONPATH" export PATH="/opt/python/bin:$PATH" # workspace-mcp tries to write logs to home dir — redirect to /tmp export HOME=/tmp export WORKSPACE_MCP_LOG_DIR=/tmp export GOOGLE_WORKSPACE_MCP_CREDENTIALS_DIR=/tmp/workspace_mcp_credentials echo "[workspace-mcp] Fetching Google credentials..." >&2 $PYTHON /var/task/fetch_credentials.py if [ -f /tmp/workspace-mcp-env ]; then source /tmp/workspace-mcp-env fi echo "[workspace-mcp] Starting on port $PORT..." >&2 exec $PYTHON /opt/python/bin/workspace-mcp \ --transport streamable-http \ --tool-tier extended