Tuesday, August 11, 2026
LIVEThe Unrelenting Cyber Battle: Hacking Threats and the Imperative of Robust Data Protection///Navigating the Cyber Labyrinth: Bolstering Defenses Against Evolving Hacking Threats///The Dual Front War: Battling Hacking and Bolstering Data Protection in the Digital Age///The Ever-Evolving Cyber Threat Landscape: Navigating Hacking and Fortifying Data Protection///The Unseen Battle: Fortifying Data in an Age of Relentless Hacking///The Unseen War: Hacking's Relentless Advance and the Imperative of Data Protection///The Evolving Threat Landscape: Hacking, Data Protection, and the Imperative for Proactive Security///Navigating the Digital Minefield: Bolstering Data Protection in an Era of Relentless Hacking///The Dual Fronts of Digital Defense: Combating Hacking and Fortifying Data Protection///Hacking's New Frontier: Fortifying Data Protection in the Age of Advanced Cyber Threats///The Dual Front: Navigating Hacking Threats and Fortifying Data Protection in the Digital Age///Navigating the Digital Gauntlet: The Evolving Nexus of Hacking and Data Protection///The Unrelenting Cyber Battle: Hacking Threats and the Imperative of Robust Data Protection///Navigating the Cyber Labyrinth: Bolstering Defenses Against Evolving Hacking Threats///The Dual Front War: Battling Hacking and Bolstering Data Protection in the Digital Age///The Ever-Evolving Cyber Threat Landscape: Navigating Hacking and Fortifying Data Protection///The Unseen Battle: Fortifying Data in an Age of Relentless Hacking///The Unseen War: Hacking's Relentless Advance and the Imperative of Data Protection///The Evolving Threat Landscape: Hacking, Data Protection, and the Imperative for Proactive Security///Navigating the Digital Minefield: Bolstering Data Protection in an Era of Relentless Hacking///The Dual Fronts of Digital Defense: Combating Hacking and Fortifying Data Protection///Hacking's New Frontier: Fortifying Data Protection in the Age of Advanced Cyber Threats///The Dual Front: Navigating Hacking Threats and Fortifying Data Protection in the Digital Age///Navigating the Digital Gauntlet: The Evolving Nexus of Hacking and Data Protection///
Subscribe
Cyber Security
Independent · Digital
Thehackingpost
CybersecurityAI-assisted

How to Use LlamaIndex.TS to Orchestrate MCP Servers

In this post, we’ll demonstrate how to orchestrate Model Context Protocol (MCP) servers using llamaindex.TS in a real-world TypeScript application. We’ll use the Azure AI Travel Agents project as our base, focusing on best practices for secure, scalable,…

In this post, we’ll demonstrate how to orchestrate Model Context Protocol (MCP) servers using llamaindex.TS in a real-world TypeScript application. We’ll use the Azure AI Travel Agents project as our base, focusing on best practices for secure, scalable, and maintainable orchestration. Feel free to star the repo to get notified of the latest changes. If you are interested in an overview of the Azure AI Travel Agents project, please read our announcement blog! Why llamaindex.TS and MCP? llamaindex.TS provides a modular, composable framework for building LLM-powered applications in TypeScript. MCP enables tool interoperability and streaming, making it ideal for orchestrating multiple AI services. Project Structure The Llamaindex.TS orchestrator lives in src/api/src/orchestrator/llamaindex, with provider modules for different LLM backends and MCP clients. We currently support: Azure OpenAI Docker Models Azure AI Foundry Local Github Model Ollama Feel free to explore the codebase and suggest more providers. // filepath: src/api/src/mcp/mcp- import EventEmitter from 'node:events'; import from '@modelcontextprotocol/sdk/client/index.js'; import from '@modelcontextprotocol/sdk/client/streamable export class MCPClient extends EventEmitter ` } : , }); this.client = new Client(serverName, this.transport); } async connect() async listTools() async callTool(name: string, toolArgs: any) async close() } Best Practice: Always pass the Authorization header for secure access, as shown above. Calling an MCP Tool Manually Suppose you want to get destination recommendations from the MCP server: import from '../../mcp/mcp- const DESTINATION_SERVER_URL = process.env.MCP_DESTINATION_RECOMMENDATION_URL!; const ACCESS_TOKEN = process.env.MCP_DESTINATION_RECOMMENDATION_ACCESS_TOKEN; const mcpClient = new MCPClient('destination-recommendation', DESTINATION_SERVER_URL, ACCESS_TOKEN); await mcpClient.connect(); const tools = await mcpClient.listTools(); console.log('Available tools:', tools); const result = await mcpClient.callTool('getDestinationsByPreferences', ); console.log('Recommended destinations:', result); await mcpClient.close(); Tip: Always close the MCP client gracefully to release resources. Orchestrating LLMs and MCP Tools With Llamaindex.TS The mcp client from <> makes it easy to connect to MCP servers and retrieve tool definitions dynamically. Below is a sample from the project’s orchestrator setup, showing how to use mcp to fetch tools and create agents for each MCP server. Here is an example of what an mcpServerConfig object might look like:const mcpServerConfig = ; You can then use this config with the mcp client:import from "@llamaindex/tools"; import from "llamaindex"; // ...existing code... const mcpServerConfig = mcpToolsConfig["echo-ping"].config; const tools = await mcp(mcpServerConfig).tools(); const echoAgent = agent(); agentsList.push(echoAgent); handoffTargets.push(echoAgent); toolsList.push(...tools); // ...other code... const travelAgent = agent(); agentsList.push(travelAgent); // Create the multi-agent workflow return multiAgent(); You can repeat this pattern to compose a multi-agent workflow where each agent is powered by tools discovered at runtime from the MCP server. See project for a full example. You can then use this LLM instance to orchestrate calls to MCP tools, such as itinerary planning or destination recommendation. Security Considerations Always use access tokens and secure headers. Never hardcode secrets; use environment variables and secret managers. Join the Community: We encourage you to join our Azure AI Foundry Developer Community​ to share your experiences, ask questions, and get support: aka.ms/foundry/discord​ Join our Discord community for real-time discussions and support. aka.ms/foundry/forum - Visit our Azure AI Foundry Developer Forum to ask questions and share your knowledge. Conclusion By combining llamaindex.TS with MCP’s Streamable HTTP transport, you can orchestrate powerful, secure, and scalable AI workflows in TypeScript. The Azure AI Travel Agents project provides a robust template for building your own orchestrator. References: llamaindex.TS Documentation MCP Streamable HTTP Spec Azure AI Travel Agents Sample

Based on reporting by hackernoon.com.

In this post, we’ll demonstrate how to orchestrate Model Context Protocol (MCP) servers using llamaindex.TS in a real-world TypeScript application.
Henry Dalton · Thehackingpost
Advertisement
AI transparency. This article was produced with the assistance of artificial intelligence and published under human editorial oversight. AI systems can make mistakes. Read how we use AI (EU AI Act, Art. 50).
Related Stories