Configure a Custom Agent and MCP Server#
Estimated time to read: 4 minutes
This advanced tutorial shows how to configure a user-defined AI Agent that can use the tools provided by a user-defined MCP Server. The scenario uses a Cookie Factory operations assistant that users select from AI.
Before You Start#
Review the configuration information in AI Agent, AI MCP Server, and Prompt Configuration.
Prepare the Scenario#
Prepare the following items before creating the custom configuration:
| Item | Required preparation | Reference |
|---|---|---|
| AI Infrastructure | Verify that the AI Infrastructure is deployed and configured in the environment. | LibreChat Integration |
| MCP-compatible tool server | Obtain the approved endpoint URL, authentication requirements, and credentials from the server owner. Obtain the required trusted certificates when the endpoint uses TLS. | AI MCP Server |
| Model | Identify a Model that is available for the user-defined AI Agent. | AI Agent |
| User access | Confirm that your user can create and manage AI Agents and MCP Servers. | AI Agent and AI MCP Server |
Table: Custom Agent and MCP Server scenario setup
Scenario#
Cookie Factory Scenario
The Cookie Factory scenario is an example only. Use an approved tool server and a business scenario available in your environment. Adapt the Agent, MCP Server, and object names to your own scenario.
Cookie Factory supervisors need an assistant that can answer questions about production operations by using an approved tool server. The configuration includes:
- An MCP Server named
Cookie Factory Tools. - An AI Agent named
Cookie Factory Operations Assistant. - A direct AI conversation that users can start with the configured agent.
Create the MCP Server#
- Open the AI MCP Server page.
- Create a user-defined MCP Server named
Cookie Factory Tools. - Enter the approved URL.
-
Select the Authentication Mode required by the tool server and provide the required authentication information.
-
Save the MCP Server.
-
After the runtime synchronizes the MCP Server, confirm that the Tools section displays the available tool metadata.
The MCP Server provides tools to the runtime. It does not define how the assistant responds to a prompt.
Create the Agent#
- Open the AI Agent page.
- Create a user-defined AI Agent named
Cookie Factory Operations Assistant. -
Select the required Model.
-
Open Instructions and enter instructions that describe the intended scope of the assistant.
Example instructions:
Help Cookie Factory supervisors review production operations. Use the available tools only when they are relevant, and state when the available context is insufficient to answer the question. -
Create the Agent.
-
Open MCP Servers and select Manage.
-
Select the Custom MCP Server
Cookie Factory Toolsand the required Tools. -
Refresh the AI Agent and confirm that it is connected to the custom MCP Server.
The selected MCP Server determines which tools are available to the AI Agent after synchronization.
Use the Agent in AI#
- From the main navigation menu, select AI.
-
Select
Cookie Factory Operations Assistant. -
Enter a question that is relevant to the configured assistant and its available tools.
-
Review the response.
Tip
To make an Agent available in AI, enable isSelectable and Publish to Runtime.
Expected Result#
The selected agent can use the tools provided by Cookie Factory Tools when they are available and relevant to the request.
Next Steps#
Use LibreChat Integration to understand runtime synchronization. For general user scenarios, return to AI Tutorials.










