From 5bfcee69187682c0c6d5282b1704b17e53c3d03f Mon Sep 17 00:00:00 2001 From: Jordan Diaz Date: Mon, 6 Apr 2026 19:37:27 +0000 Subject: [PATCH] get_web_url: forzar HTTP en forge + documentar ?pruebas=1 obligatorio Co-Authored-By: Claude Opus 4.6 (1M context) --- docs/knowledge-index-base.md | 6 +++--- mcp-server/tools/project/getWebUrl.js | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/knowledge-index-base.md b/docs/knowledge-index-base.md index 803e96f..b574e6a 100644 --- a/docs/knowledge-index-base.md +++ b/docs/knowledge-index-base.md @@ -4,10 +4,10 @@ This is an Acai CMS website project. Follow these instructions when working with ## Environment -- The site runs in Docker. The development URL is provided via `ACAI_WEB_URL` environment variable (e.g. `https://username_domain.forge.acaisuite.com/`) -- **Before using fetch or Playwright, call the `get_web_url` tool** to get the correct development URL. Never hardcode or guess URLs. +- The site runs in Docker. **Before using fetch or Playwright, call the `get_web_url` tool** to get the correct development URL. Never hardcode or guess URLs. +- **ALWAYS append `?pruebas=1`** to any URL you visit (e.g. `http://.../?pruebas=1`). This query param is required to view the site in development mode. - **NEVER navigate to the production domain** (e.g. `keepsailing.es`, `tienda.com`). The production site is NOT your development environment. -- **NEVER use localhost:8080** — that does not resolve in this environment. +- **NEVER use localhost:8080 or https://** — use HTTP (not HTTPS) with the URL from `get_web_url`. ## Project Structure diff --git a/mcp-server/tools/project/getWebUrl.js b/mcp-server/tools/project/getWebUrl.js index c33cbdc..babf7c1 100644 --- a/mcp-server/tools/project/getWebUrl.js +++ b/mcp-server/tools/project/getWebUrl.js @@ -20,14 +20,20 @@ export function registerGetWebUrlTool(server) { }; } + // Inside Docker, HTTPS is not available — force HTTP for internal requests + let webUrl = credentials.web_url; + if (webUrl && webUrl.startsWith("https://") && webUrl.includes(".forge.")) { + webUrl = webUrl.replace("https://", "http://"); + } + return { content: [{ type: "text", text: JSON.stringify({ - web_url: credentials.web_url, + web_url: webUrl, api_web_url: credentials.api_web_url || null, website: credentials.website || null, - note: "Always use web_url for Playwright/fetch. Never use the production domain directly.", + note: "Always use web_url for Playwright/fetch. IMPORTANT: Always append ?pruebas=1 to any URL you visit (e.g. web_url + '/?pruebas=1' or web_url + '/servicios/?pruebas=1'). Never use the production domain directly.", }) }], };