diff --git a/app-hooks/before-starting/25-configure-mcp-server-url.sh b/app-hooks/before-starting/25-configure-mcp-server-url.sh new file mode 100755 index 00000000..3132672d --- /dev/null +++ b/app-hooks/before-starting/25-configure-mcp-server-url.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Configure MCP server URL for Astrolabe background sync +# This URL is used by Astrolabe to send app passwords to the MCP server + +set -e + +if [ -z "${MCP_SERVER_URL:-}" ]; then + echo "MCP_SERVER_URL not set, skipping Astrolabe MCP server URL configuration" + exit 0 +fi + +echo "Configuring MCP server URL: $MCP_SERVER_URL" + +# Set the mcp_server_url in config.php via occ +php occ config:system:set mcp_server_url --value="$MCP_SERVER_URL" + +echo "MCP server URL configured successfully" diff --git a/app-hooks/post-installation/26-configure-astrolabe-oauth.sh b/app-hooks/before-starting/26-configure-astrolabe-oauth.sh similarity index 100% rename from app-hooks/post-installation/26-configure-astrolabe-oauth.sh rename to app-hooks/before-starting/26-configure-astrolabe-oauth.sh diff --git a/docker-compose.yml b/docker-compose.yml index 256bb1c2..7a1d8751 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,6 +47,9 @@ services: - MYSQL_USER=nextcloud - MYSQL_HOST=db - REDIS_HOST=redis + # Set MCP_SERVER_URL to enable Astrolabe OAuth client auto-creation + # (before-starting hook creates OIDC client + stores credentials in config.php) + # Example: MCP_SERVER_URL=http://mcp-login-flow:8004 docker compose --profile login-flow up -d - MCP_SERVER_URL=${MCP_SERVER_URL:-} healthcheck: test: ["CMD-SHELL", "curl -Ss http://localhost/status.php | grep '\"installed\":true' || exit 1"]