feat(install): chain MCP configuration after setup
This commit is contained in:
parent
678b966425
commit
b6276776fd
1 changed files with 44 additions and 4 deletions
46
install.sh
46
install.sh
|
|
@ -7,6 +7,9 @@ PROFILE_ENV="EMAIL_MCP_PROFILE"
|
|||
RELEASE_BASE_URL="https://gitea.lclr.dev"
|
||||
RELEASE_REPOSITORY="AI/email-mcp"
|
||||
INSTALLED_BINARY_PATH=""
|
||||
PREFILL_SERVER_NAME=""
|
||||
PREFILL_PROFILE_VALUE=""
|
||||
PREFILL_COMMAND_PATH=""
|
||||
|
||||
if [ -t 2 ] && [ -z "${NO_COLOR:-}" ]; then
|
||||
C_RESET="$(printf '\033[0m')"
|
||||
|
|
@ -386,24 +389,32 @@ run_setup_wizard() {
|
|||
fi
|
||||
|
||||
ui_info "Lancement de $BINARY_NAME setup"
|
||||
if [ -r /dev/tty ] && [ -w /dev/tty ]; then
|
||||
if [ -t 2 ] && [ -r /dev/tty ] && [ -w /dev/tty ]; then
|
||||
env "${PROFILE_ENV}=${profile}" "$binary_path" setup < /dev/tty > /dev/tty
|
||||
else
|
||||
env "${PROFILE_ENV}=${profile}" "$binary_path" setup
|
||||
fi
|
||||
ui_success "Setup termine pour le profil \"$profile\"."
|
||||
|
||||
PREFILL_SERVER_NAME="$(sanitize_server_name "$BINARY_NAME")"
|
||||
PREFILL_PROFILE_VALUE="$profile"
|
||||
PREFILL_COMMAND_PATH="$binary_path"
|
||||
}
|
||||
|
||||
collect_server_inputs() {
|
||||
local default_name
|
||||
default_name="$(sanitize_server_name "$BINARY_NAME")"
|
||||
default_name="$(sanitize_server_name "${PREFILL_SERVER_NAME:-$BINARY_NAME}")"
|
||||
SERVER_NAME="$(prompt "Nom du serveur MCP" "$default_name")"
|
||||
SERVER_NAME="$(sanitize_server_name "$SERVER_NAME")"
|
||||
|
||||
PROFILE_VALUE="$(prompt "Valeur de ${PROFILE_ENV}" "$DEFAULT_PROFILE")"
|
||||
PROFILE_VALUE="$(prompt "Valeur de ${PROFILE_ENV}" "${PREFILL_PROFILE_VALUE:-$DEFAULT_PROFILE}")"
|
||||
|
||||
local default_command
|
||||
if [ -n "${PREFILL_COMMAND_PATH:-}" ]; then
|
||||
default_command="$PREFILL_COMMAND_PATH"
|
||||
else
|
||||
default_command="$(resolve_binary_path)"
|
||||
fi
|
||||
COMMAND_PATH="$(prompt "Chemin du binaire serveur MCP" "$default_command")"
|
||||
}
|
||||
|
||||
|
|
@ -542,6 +553,34 @@ print_header() {
|
|||
printf "%bSelectionne une action dans le menu interactif.%b\n" "$C_DIM" "$C_RESET" >&2
|
||||
}
|
||||
|
||||
post_setup_configure_mcp() {
|
||||
ui_title "Configuration MCP apres setup"
|
||||
local next_action
|
||||
next_action="$(menu_select \
|
||||
"Configurer le MCP maintenant ?" \
|
||||
"Configurer Claude Code (apply direct)" \
|
||||
"Configurer Codex (apply direct)" \
|
||||
"Generer JSON MCP manuel" \
|
||||
"Terminer sans config MCP")"
|
||||
printf "\n" >&2
|
||||
|
||||
case "$next_action" in
|
||||
"Configurer Claude Code (apply direct)")
|
||||
apply_claude_mcp
|
||||
;;
|
||||
"Configurer Codex (apply direct)")
|
||||
apply_codex_mcp
|
||||
;;
|
||||
"Generer JSON MCP manuel")
|
||||
ui_info "JSON MCP genere sur stdout."
|
||||
print_mcp_json
|
||||
;;
|
||||
*)
|
||||
ui_info "Setup termine sans configuration MCP additionnelle."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main() {
|
||||
print_header
|
||||
|
||||
|
|
@ -558,6 +597,7 @@ main() {
|
|||
case "$action" in
|
||||
"Installer/mettre a jour le binaire + setup")
|
||||
run_setup_wizard
|
||||
post_setup_configure_mcp
|
||||
;;
|
||||
"Configurer Claude Code (apply direct)")
|
||||
apply_claude_mcp
|
||||
|
|
|
|||
Loading…
Reference in a new issue