cambios mcp remoto
This commit is contained in:
@@ -3,6 +3,7 @@ import { withAuth, getSessionCredentials } from "../../auth/index.js";
|
||||
import { handleToolError } from "../helpers/errorHandler.js";
|
||||
import { withAuthParams } from "../helpers/authSchema.js";
|
||||
import { LOCAL_SERVER_URL } from "../../config/index.js";
|
||||
import { resolveCurrentAcaiUser } from "../helpers/sessionHelpers.js";
|
||||
import axios from "axios";
|
||||
|
||||
export function registerNavigateBrowserTool(server) {
|
||||
@@ -30,12 +31,16 @@ export function registerNavigateBrowserTool(server) {
|
||||
const credentials = await getSessionCredentials(extra.sessionId);
|
||||
const project = credentials.website || process.env.ACAI_WEBSITE || "";
|
||||
|
||||
// POST to Python server to set pending navigation
|
||||
// POST to Python server to set pending navigation.
|
||||
// Inyectar X-Acai-User cuando la sesion MCP lo provee.
|
||||
const acaiUser = resolveCurrentAcaiUser();
|
||||
const headers = { "Content-Type": "application/json" };
|
||||
if (acaiUser) headers["X-Acai-User"] = acaiUser;
|
||||
await axios.post(`${LOCAL_SERVER_URL}/api/browser/navigate`, {
|
||||
project: project,
|
||||
enlace: enlace,
|
||||
}, {
|
||||
headers: { "Content-Type": "application/json" },
|
||||
headers,
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user