Skip to content

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#

  1. Open the AI MCP Server page.
  2. Create a user-defined MCP Server named Cookie Factory Tools.
  3. Enter the approved URL.
  4. Select the Authentication Mode required by the tool server and provide the required authentication information.

    Custom MCP Server Configuration

  5. Save the MCP Server.

    Custom MCP Server Synchronization Status

  6. After the runtime synchronizes the MCP Server, confirm that the Tools section displays the available tool metadata.

    Custom MCP Server Tools Synchronized

The MCP Server provides tools to the runtime. It does not define how the assistant responds to a prompt.

Create the Agent#

  1. Open the AI Agent page.
  2. Create a user-defined AI Agent named Cookie Factory Operations Assistant.
  3. Select the required Model.

    Custom Agent Configuration

  4. 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.

    Custom Agent Instructions

  5. Create the Agent.

    Created Agent

  6. Open MCP Servers and select Manage.

    Add the Custom MCP Server - Manage

  7. Select the Custom MCP Server Cookie Factory Tools and the required Tools.

    Add the Custom MCP Server - Select

  8. Refresh the AI Agent and confirm that it is connected to the custom MCP Server.

    Add the Custom MCP Server - Updated

The selected MCP Server determines which tools are available to the AI Agent after synchronization.

Use the Agent in AI#

  1. From the main navigation menu, select AI.
  2. Select Cookie Factory Operations Assistant.

    Custom Agent Available on AI

  3. Enter a question that is relevant to the configured assistant and its available tools.

  4. Review the response.

    Custom Agent in use on AI

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.