#!/bin/sh
# Unfragile — install the MCP server into the agent runtime on this machine.
# Source: https://unfragile.ai/install.sh   Docs: https://unfragile.ai/agents
set -eu
PKG="@unfragile/mcp-server"

if command -v claude >/dev/null 2>&1; then
  echo "unfragile: Claude Code found; registering the MCP server"
  claude mcp add unfragile -- npx -y "$PKG"
  echo "unfragile: done. Ask your agent: find the tool that refunds a stripe payment, and tell me its label."
  exit 0
fi

cat <<EOF
unfragile: no supported command-line runtime found on PATH (looked for: claude).
Add this block to your MCP client's configuration (Claude Desktop, Cursor, Windsurf, Cline):

{
  "mcpServers": {
    "unfragile": { "command": "npx", "args": ["-y", "$PKG"] }
  }
}

Then restart the client. Details: https://unfragile.ai/agents
EOF
exit 0
