> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# LibreChat

> Add keyless WebRouter search and extract to a self-hosted LibreChat agent over MCP.

LibreChat can start the WebRouter MCP server and make its `search` and `extract`
tools available to an agent. This setup uses LibreChat's MCP Tool Library.

## Install on the LibreChat server

Use [uv](https://docs.astral.sh/uv/getting-started/installation/) where LibreChat
runs. Replace `/absolute/path/to/webrouter` with a directory writable by its
service account. On Docker, use paths inside the LibreChat container and keep
the install directory and any uv-managed Python on persistent storage.

```bash theme={null}
mkdir -p /absolute/path/to/webrouter/empty-home
uv venv --python 3.12 /absolute/path/to/webrouter/venv
uv pip install --python /absolute/path/to/webrouter/venv/bin/python 'webrouter[mcp]==0.17.0'
```

Copy the `webrouter` entry from the [example YAML](https://github.com/Nimbleway/webrouter/blob/main/examples/librechat/librechat.yaml)
into `mcpServers` in your `librechat.yaml`. Set the two absolute paths to the
installed executable and the dedicated empty home, then restart LibreChat.

Keep the MCP child's home empty. The example clears the inherited environment,
skips working-directory and remembered credential files, and disables the
`load_env` tool. WebRouter can then use keyless search and extraction without
using the LibreChat service's provider keys.

Tool discovery and calls through LibreChat's stdio connection were verified
with LibreChat 0.8.9 and WebRouter 0.17.0 on macOS arm64 and in the stock
LibreChat 0.8.9 Linux arm64 container. On that Alpine image, uv built the
Playwright dependency from source. Allow source builds when installing there.

## Add the tools to an agent

1. Open an agent in LibreChat's Agent Builder and choose a model that supports tools.
2. In **Tools**, select **Add**, filter to **MCP servers**, and add `search` and `extract` from `webrouter`.
3. Save the agent and ask it to find the official Python `asyncio` documentation, read the introduction, and cite the page it used.

The WebRouter calls need no provider keys. Chat still uses the model configured
for your LibreChat agent. If the server does not appear, check the operator YAML,
MCP permissions, and executable path on the machine running LibreChat.

[LibreChat MCP setup](https://www.librechat.ai/docs/features/mcp) · [WebRouter MCP server](https://docs.webrouter.net/mcp-server.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.