> For the complete documentation index, see [llms.txt](https://docs.glbnxt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glbnxt.com/tutorials/guides/connect-mcp/mcp-librechat.md).

# Connecting an MCP server to LibreChat

### Introduction

By bridging an MCP server with LibreChat, you transform standard chat models into highly capable, context-aware assistants that can read repositories, fetch live documentation, or interface with your custom databases.

This guide will walk you through the quick process of connecting an MCP server directly to your LibreChat environment and attaching those specialized tools to a custom AI Agent.

### Prerequisites

* **Admin rights:** Make sure you have access to LibreChat with admin or tool management permissions.
* **Open LibreChat:** Open the application from your **Dashboard**.
* **MCP server:** Have your own MCP server.

### Steps

#### Step 1: Start MCP setup

1. In your LibreChat application, select the **MCP Settings** icon on your side sidebar.

   <img src="/files/d8oejMF68jVm8PwT4LMv" alt="" width="400">
2. Click on the **+** icon, the **Add MCP Server** screen will pop up.

<img src="/files/5wqdmySyqwYgQWZd8NHr" alt="" width="400">

3. You are now ready to set up your MCP server.

#### Step 2: Add an MCP server to your chat environment

1. Configure your MCP in the pop up screen. To give you an idea, there is an example MCP (DeepWiki) in the image below.

   <img src="/files/mHmXeuHB3Be3RdeAXrDT" alt="" width="400">
2. Now click on **Create**. In the top of your screen, the message `MCP server created successfully` will appear.
3. Press the **Connect** icon. In the top of your screen, the message `MCP server 'deepwiki-mcp' initialized successfully` will appear.

   <img src="/files/fJoQJ1lP9GTr0k8XBByh" alt="" width="400">
4. You are now able to connect and disconnect your MCP in the chat environment.

   <img src="/files/cUOEOkKKlUQ82K1zQfZX" alt="" width="400">

#### Step 3: Add an MCP server to your Agent

1. If you want to connect your MCP server to a new or existing agent, press the **Agent Builder** on your sidebar and create or edit an agent.

   <img src="/files/wPC5W450jKhoMl35voHv" alt="" width="400">
2. Click on **Add MCP Server Tools** and then **Add**.

   <img src="/files/LIXMkjXL8Mh7mbSdvx7M" alt="" width="400">
3. In the top of your screen, the message `Successfully created/saved DeepWiki Agent` will appear.

**Note:** In the chat environment of your agent you are not able to see that your MCP server is connected to the robot. Look at your agent settings or simply ask the agent if it is connected to your MCP server to be assured of a working connection.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.glbnxt.com/tutorials/guides/connect-mcp/mcp-librechat.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
