#!/bin/sh
# Starts framx's MCP server. An executable ~/.config/framx/launch runs in place of the framx command, with the
# same arguments, when it exists: use it to run your own framx install or to set environment variables, such
# as the optional cloud listener's FRAMX_CLOUD_* settings.
if [ -x "$HOME/.config/framx/launch" ]; then
  exec "$HOME/.config/framx/launch" mcp
fi
if command -v framx >/dev/null 2>&1; then
  exec framx mcp
fi
if [ -x "$HOME/.local/bin/framx" ]; then  # where uv tool install puts it, which an app's PATH may leave out
  exec "$HOME/.local/bin/framx" mcp
fi
echo "framx is not installed: run uv tool install framx, then start a new session" >&2
exit 1
