activando agent con mcp

This commit is contained in:
2025-06-05 01:05:15 -06:00
parent 7d0495eff6
commit 3904051af9
3 changed files with 6 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ console.log(`Using Gemini API key: ${API_KEY}`);
const genAI = API_KEY ? new GoogleGenAI({ apiKey: API_KEY }) : null;
const MCP_URL = process.env.MCP_URL || 'http://planilla.interno.mcp';
const MCP_URL = process.env.MCP_URL || 'http://planilla.interno.com/mcp';
let mcpClient: Client | undefined;
let mcpTransport: StreamableHTTPClientTransport | undefined;
@@ -45,6 +45,7 @@ app.post('/', async (req, res) => {
const contents = `Repo information: ${repoInfo}\nUser message: ${message}`;
const config: any = {};
if (message.toLowerCase().includes('/planilla')) {
console.log('Using Model Context Protocol tools ', MCP_URL);
const client = await getMcpClient();
config.tools = [mcpToTool(client)];
}