--- alias: user-guide-ai-librechat-integration description: "Explain how Critical Manufacturing MES integrates AI Agents and MCP Servers with the LibreChat runtime" --- # LibreChat Integration LibreChat is the current Generative AI runtime for Critical Manufacturing MES. It provides the runtime in which configured **AI Agents** can use the tools exposed by their associated **MCP Servers**. ## Runtime Synchronization Critical Manufacturing MES synchronizes **AI Agents**, **MCP Servers**, and their associations with LibreChat. The synchronization runs asynchronously after the relevant definitions are deployed or updated. After a synchronization completes successfully, the associated **MCP Server** is available in LibreChat and its tool metadata is updated in MES. The system records runtime metadata, including synchronization status and the most recent tool synchronization. ## Configuration Flow To make tools available to an **AI Agent** in LibreChat: 1. Configure an [[user-guide-ai-mcp-server|MCP Server]] that exposes the required tools. 2. Associate the **MCP Server** with a [[user-guide-ai-agent|AI Agent]]. 3. Configure the prompt behavior through [[user-guide-ai-prompt-configuration|Prompt Configuration]]. For system-defined definitions, the required runtime configuration is created during deployment. Do not manually change synchronized tool metadata. ## Authentication User-defined **MCP Servers** can use OAuth Client Secret Basic authentication or API key authentication. For OAuth authentication, configure the required OAuth client and callback URIs in the **Security Portal**. For API key authentication, configure the API key fields on the [[user-guide-ai-mcp-server|MCP Server]]. Do not expose API keys or OAuth client secrets in **AI Agent** or **UI Page** definitions.