LibreChat
LibreChat is an open-source chat application for different LLM models. Using Anyquery, you can connect LibreChat to your local and online applications (such as Spotify, GitHub, Discord, etc.) and interact with them using natural language.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure that you have the following:
- A working installation of Anyquery (
v0.4.0). Follow the installation guide if you haven’t installed it yet. - A few integrations set up in Anyquery. Refer to each integration guide for more information.
- LibreChat hosted somewhere.
Connect LibreChat to Anyquery
Section titled “Connect LibreChat to Anyquery”To connect Anyquery to LibreChat, you can either use the HTTP api (recommended) or the model context protocol.
Ensuring agents are enabled
Section titled “Ensuring agents are enabled”For both protocols, you need to enable Agents. By default, they should be enabled, and available in the Agents section of the model selection screen. If not,
ensure your librechat.yaml configuration file looks like this:
version: 1.2.1
interface: agents: true
endpoints: agents: recursionLimit: 25 # Can be increased if needed disableBuilder: false capabilities: ["actions", "tools"] # You can add other capabilities here ...If you still cannot see the Agents section, check your environment variables. The ENDPOINTS variable should include agents.
ENDPOINTS=azureOpenAI,gptPlugins,agents,openAIHTTP API
Section titled “HTTP API”-
Start Anyquery
Section titled “Start Anyquery”In a terminal, run the following command to start Anyquery:
Terminal anyquery gptThis command will start a tunnel to Anyquery and provide you a bearer token. You must then use this token to authenticate your requests to Anyquery.
Terminal julien@MacBook-Air-Julien anyquery % anyquery gptYour Anyquery ID is ikabcjde. This is your bearer token that you must set in chatgpt.com2025-02-10 21:29:12.293 [I] [client/service.go:295] try to connect to server...2025-02-10 21:29:12.453 [I] [client/service.go:287] [cc07e04c16c1e59f] login to server success, get run id [cc07e04c16c1e59f]2025-02-10 21:29:12.454 [I] [proxy/proxy_manager.go:173] [cc07e04c16c1e59f] proxy added: [ikabcjde]2025-02-10 21:29:12.494 [I] [client/control.go:168] [cc07e04c16c1e59f] [ikabcjde] start proxy success -
Set up LibreChat
Section titled “Set up LibreChat”Select the
Agentssection in the model selection screen, and create a new one.
In the right panel, fill in the fields for your new agent.
- Name and Description: Give your agent a name and a description.
- Instructions Go to this gist and copy the content to the instructions field.
- Model: Select the LLM model you want to use with LibreChat.
Click on
Createto save your agent.
Now that your agent is created, click on
Add actionsto connect it to Anyquery.
Under authentication, selectAPI Key, selectBeareras Auth Type, and paste the bearer token you received from Anyquery.
Then, go to this gist and copy the content to the Schema field.
Finally, click on
Createto save your action. Go back, and then click onSaveto save your agent.
Congratulations 🎉. LibreChat is connected to Anyquery.
Model Context Protocol
Section titled “Model Context Protocol”Anyquery can also connect to LibreChat using the Model Context Protocol (MCP).
-
Set up LibreChat
Section titled “Set up LibreChat”Open the
librechat.yamlconfiguration file, and add the following configuration:version: 1.2.1mcpServers:anyquery:command: anyqueryargs:- mcp# Rest of your configurationNow, we will create a new agent in LibreChat. Select the
Agentssection in the model selection screen, and create a new one.
In the right panel, fill in the fields for your new agent.
- Name and Description: Give your agent a name and a description.
- Instructions You can leave it empty.
- Model: Select the LLM model you want to use with LibreChat.
Now, click on
Add Toolsto add Anyquery as a tool. Go to the last page, and add:- listTables
- describeTable
- executeQuery

Finally, click on
Createto save your agent. Go back, and then click onSaveto save your agent.
Selecting the agent
Section titled “Selecting the agent”Now that you have set up your agent, go back to the Agents section in LibreChat, and select the agent you just created in the right panel

You can now start interacting with LibreChat using natural language. Here are a few examples:
- What can you do?
- Recommend me a song according to my history.
- Take this PDF, and open the references in my browser.
- Here is a link to my schedule, when should I schedule a meeting?