diff --git a/content/docs/mcp_servers/index.mdx b/content/docs/mcp_servers/index.mdx index 847cb162a..245575e2c 100644 --- a/content/docs/mcp_servers/index.mdx +++ b/content/docs/mcp_servers/index.mdx @@ -13,6 +13,9 @@ Use these guides to configure specific MCP servers with the right transport, OAu Configure Salesforce Hosted MCP servers with an External Client App and per-user OAuth. + + Let users work on files, Git, commands and local services on computers they approve. + Learn how MCP works in LibreChat before adding product-specific servers. diff --git a/content/docs/mcp_servers/local_commander.mdx b/content/docs/mcp_servers/local_commander.mdx new file mode 100644 index 000000000..d44a1a25f --- /dev/null +++ b/content/docs/mcp_servers/local_commander.mdx @@ -0,0 +1,97 @@ +--- +title: Local Commander MCP +icon: Monitor +description: Let LibreChat users work on computers they approve (files, Git, commands and local services) through Local Commander's hosted MCP server with per-user OAuth. +--- + +[Local Commander](https://localcmd.app) lets a model work on computers the user approves: read and +edit files in approved folders, check Git, run commands and look at local services. It is a hosted +MCP server at `https://localcmd.app/mcp` plus a small agent on each computer. Each LibreChat user +signs in with their own Local Commander account and works only with the computers that account has +approved. + + + Local Commander supports OAuth dynamic client registration. LibreChat registers itself on the + first sign-in, so there is no client ID or secret to create or store in `.env`. + + +## Prerequisites + +- A running LibreChat instance with `librechat.yaml` mounted or otherwise loaded. +- A Local Commander account at [localcmd.app](https://localcmd.app) for each user who connects. +- At least one computer with the Local Commander agent (Node.js 20 or later; Windows, macOS or + Linux). + +## Setup + + + + +### Connect a computer + +On the computer the model should work on, run: + +```bash +npx local-commander-agent@latest +``` + +Approve the pairing at [localcmd.app](https://localcmd.app). Repeat this on every computer you want +to use. + + + + +### Add Local Commander to `librechat.yaml` + +```yaml filename="librechat.yaml" +mcpServers: + local-commander: + type: streamable-http + url: https://localcmd.app/mcp +``` + +Restart LibreChat after changing `librechat.yaml`. + + + If your `librechat.yaml` also configures `mcpSettings.allowedDomains`, add `localcmd.app`. + + + + + +### Sign in + +1. Open **MCP Settings** in the side panel. `local-commander` shows **Needs Auth**. +2. Click **Connect**, then **Continue with OAuth**. +3. Sign in to Local Commander if asked, check the permissions on the "LibreChat MCP Client" screen + and click **Allow connection**. + +LibreChat stores the tokens and loads the Local Commander tools. Finish the sign-in within 10 +minutes; LibreChat cancels an OAuth flow that takes longer, and you start again with **Connect**. + + + + +### Use it in a chat + +Keep `local-commander` selected under the message box and ask, for example, "list my computers" or +"run the tests in my project". + + + + +## Troubleshooting + +- **The model provider could not complete this request:** the tool descriptions take about 18,000 + tokens of context. With a local model, give it a context window of at least 32k tokens. +- **The sign-in page says the connection could not be finished:** the OAuth flow timed out. Click + **Connect** in MCP Settings again and approve within 10 minutes. +- **The model reports no computers:** start the agent on the computer and check that it shows as + online at localcmd.app. + +## What the model can do + +That depends on the access the user gave each computer: Full Access by default after approval, or +only selected folders. Folder rules prevent accidents; they are not a sandbox. Users can see, +cancel and revoke work at [localcmd.app](https://localcmd.app), and remove LibreChat's access there +at any time. diff --git a/content/docs/mcp_servers/meta.json b/content/docs/mcp_servers/meta.json index 396b0e2c6..d9bd60b24 100644 --- a/content/docs/mcp_servers/meta.json +++ b/content/docs/mcp_servers/meta.json @@ -1,5 +1,5 @@ { "title": "MCP Servers", "icon": "Blocks", - "pages": ["index", "google_workspace", "salesforce"] + "pages": ["index", "google_workspace", "salesforce", "local_commander"] }