#!/bin/sh # OI video MCP — connect to Claude Code # https://oiinc.app # # This script does one thing: it registers the OI video MCP address with # Claude Code on this computer. It downloads nothing else, asks for no keys or # passwords, and never uses sudo. Read it before running if you like: # curl -fsSL https://oiinc.app/install.sh set -eu NAME=cr7 URL=https://mcp.oiinc.app/mcp # Messages: `sh -s -- en` / `sh -s -- ko` picks a language; otherwise follow the locale. case "${1:-${LC_ALL:-${LC_MESSAGES:-${LANG:-}}}}" in ko*) KO=1 ;; *) KO=0 ;; esac say() { if [ "$KO" = 1 ]; then printf '%s\n' "$1"; else printf '%s\n' "$2"; fi; } die() { say "$1" "$2" >&2; exit 1; } command -v claude >/dev/null 2>&1 || die \ "Claude Code를 찾지 못했어요. 먼저 설치한 뒤 다시 실행해 주세요: https://code.claude.com/docs/en/setup" \ "Claude Code was not found. Install it first, then run this again: https://code.claude.com/docs/en/setup" # Under `curl | sh` the standard input is this script itself, so every claude # call reads from /dev/null instead of swallowing the rest of it. if current=$(claude mcp get "$NAME" &1); then if printf '%s\n' "$current" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//' | grep -F -x -q "URL: $URL"; then say "이미 연결되어 있어요: $NAME" "Already connected: $NAME" else die "'$NAME' 이름으로 다른 MCP가 이미 등록되어 있어서 아무것도 바꾸지 않았어요. 확인: claude mcp get $NAME" \ "A different MCP is already registered as '$NAME', so nothing was changed. Check: claude mcp get $NAME" fi else case "$current" in *"No MCP server"*) ;; *) die "기존 등록을 확인하지 못해서 아무것도 바꾸지 않았어요. 잠시 뒤 다시 실행해 주세요." \ "Could not check existing registrations, so nothing was changed. Please run this again in a moment." ;; esac claude mcp add --transport http --scope user "$NAME" "$URL" /dev/null || die \ "연결하지 못했어요. Claude Code를 최신 버전으로 올린 뒤 다시 실행해 주세요." \ "Could not connect. Update Claude Code to the latest version, then run this again." say "OI 영상 MCP를 Claude Code에 연결했어요: $NAME" "Connected the OI video MCP to Claude Code: $NAME" fi say "" "" say "다음 단계" "Next steps" say " 1. Claude Code를 새로 열고 /mcp 를 입력하세요." " 1. Open a new Claude Code session and type /mcp." say " 2. ${NAME}을 고르고, 브라우저가 열리면 안내에 따라 로그인하세요. 승인된 이메일이 필요해요." \ " 2. Pick $NAME and sign in when your browser opens. You need an approved email." say " 도움이 필요하면: https://oiinc.app/mcp" " Need help? https://oiinc.app/en"