iniciada creacion del mcp
All checks were successful
Deploy conversation layer / deploy (push) Successful in 6s

This commit is contained in:
2025-06-06 20:51:06 -06:00
parent b39db9ad06
commit 7eba5b2755
9 changed files with 1316 additions and 0 deletions

15
mcp/lib/api.js Normal file
View File

@@ -0,0 +1,15 @@
export const API_BASE_URL = process.env.PLANILLA_API_URL || "http://localhost:4000";
export async function fetchJSON(path, options = {}) {
const method = options.method || "GET";
console.log(`[API] ${method} ${API_BASE_URL}${path}`);
const res = await fetch(`${API_BASE_URL}${path}`, {
headers: { "Content-Type": "application/json" },
...options,
});
if (!res.ok) {
const txt = await res.text();
throw new Error(`API request failed (${res.status}): ${txt}`);
}
return res.json();
}