activando agent con mcp
This commit is contained in:
@@ -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)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user