diff --git a/content/docs/features/mcp.mdx b/content/docs/features/mcp.mdx index f88e15fb5..2f1413cea 100644 --- a/content/docs/features/mcp.mdx +++ b/content/docs/features/mcp.mdx @@ -15,13 +15,13 @@ LLMs are limited to their built-in capabilities. With MCP, LibreChat breaks down - **Connecting to any tool or service** that provides an MCP server - **Standardizing integrations** so you don't need to edit LibreChat's code for each tool - **Supporting multi-user environments** with proper authentication and isolation -- **Providing a growing ecosystem** of dynamic, ready-to-use integrations +- **Adding and updating servers at runtime** from the MCP Settings panel, without editing a config file or restarting ## How MCP Works in LibreChat LibreChat provides two ways to use MCP servers, either in the chat area or with agents. -You can configure MCP servers manually in your `librechat.yaml` file or by using [smithery.ai](https://smithery.ai) to find and install MCP servers into `librechat.yaml` ([see example below](#basic-configuration)). Any time you add or edit an MCP server, you will need to restart LibreChat to initialize the connections. +You can configure MCP servers manually in your `librechat.yaml` file or by using [smithery.ai](https://smithery.ai) to find and install MCP servers into `librechat.yaml` ([see example below](#basic-configuration)). Any time you add or edit a server in `librechat.yaml`, you will need to restart LibreChat to initialize the connections. Servers added through the [MCP Settings panel](#adding-mcp-servers-in-the-ui) take effect without a restart. A panel-created server that uses OAuth is registered on save but starts out disconnected: [authenticate it](#step-3-check-connection-status-and-authenticate) once to connect it. ### OAuth Callback URL diff --git a/content/docs/quick_start/custom_endpoints.mdx b/content/docs/quick_start/custom_endpoints.mdx index ddfc39252..93a00fc4c 100644 --- a/content/docs/quick_start/custom_endpoints.mdx +++ b/content/docs/quick_start/custom_endpoints.mdx @@ -99,21 +99,28 @@ Use `provider: "anthropic"` only for endpoints that speak the native Anthropic M When configuring API keys in custom endpoints, you have three options: -1. **Environment variable** (recommended): `apiKey: "${OPENROUTER_KEY}"` -- reads from `.env` -2. **User provided**: `apiKey: "user_provided"` -- users enter their own key in the UI -3. **Direct value** (not recommended): `apiKey: "sk-your-actual-key"` -- stored in plain text +1. **Environment variable** (recommended): `apiKey: '${OPENROUTER_KEY}'` reads one shared key from `.env`, so the key needs a matching entry in [Step 3](#step-3-set-environment-variables). +2. **User provided**: `apiKey: 'user_provided'` asks each user for their own key in the LibreChat UI instead of reading one from `.env`. No `.env` entry is needed for the key itself. LibreChat stores each user's key encrypted and prompts for it the first time they select the endpoint. +3. **Direct value** (not recommended): `apiKey: 'sk-your-actual-key'` hardcodes the key in `librechat.yaml` in plain text. + +`baseURL` accepts `user_provided` in the same way, which lets each user point the endpoint at their own gateway. + +The example above deliberately mixes styles: OpenRouter and the Anthropic-compatible gateway use option 1, while Ollama passes the literal string `'ollama'` because a local Ollama server ignores the key entirely. ## Step 3. Set Environment Variables -Add the API keys referenced in your `librechat.yaml` to the `.env` file: +This step covers every `${VARIABLE_NAME}` reference in your `librechat.yaml`, whether it sits in `apiKey`, `baseURL`, or a `headers` value. If nothing you added uses that form, skip to [Step 4](#step-4-restart-and-verify). + +Add each variable your `librechat.yaml` references to `.env`. The example above references two: ```bash filename=".env" OPENROUTER_KEY=your_openrouter_api_key +ANTHROPIC_API_KEY=your_anthropic_api_key ``` -Each `${VARIABLE_NAME}` in librechat.yaml must have a matching entry in `.env`. +Every `${VARIABLE_NAME}` in `librechat.yaml` needs a matching entry. A missing one does not drop the endpoint: it still appears in the selector, and the problem only surfaces once someone sends a message through it. An unresolved `apiKey` fails with `Missing API Key for `, and an unresolved `baseURL` with `Missing Base URL for `. An unresolved `headers` value behaves differently: it is sent upstream as the literal text `${VARIABLE_NAME}`, so the failure comes back from the provider rather than from LibreChat. ## Step 4. Restart and Verify