Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions content/docs/mcp_servers/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Use these guides to configure specific MCP servers with the right transport, OAu
<Cards.Card title="Salesforce MCP" href="/docs/mcp_servers/salesforce" arrow>
Configure Salesforce Hosted MCP servers with an External Client App and per-user OAuth.
</Cards.Card>
<Cards.Card title="Local Commander MCP" href="/docs/mcp_servers/local_commander" arrow>
Let users work on files, Git, commands and local services on computers they approve.
</Cards.Card>
<Cards.Card title="MCP overview" href="/docs/features/mcp" arrow>
Learn how MCP works in LibreChat before adding product-specific servers.
</Cards.Card>
Expand Down
97 changes: 97 additions & 0 deletions content/docs/mcp_servers/local_commander.mdx
Original file line number Diff line number Diff line change
@@ -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.

<Callout type="info" title="No client credentials needed">
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`.
</Callout>

## 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

<Steps>
<Step>

### 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.

</Step>
<Step>

### 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`.

<Callout type="info" title="Strict MCP domain allowlists">
If your `librechat.yaml` also configures `mcpSettings.allowedDomains`, add `localcmd.app`.
</Callout>

</Step>
<Step>

### 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**.

</Step>
<Step>

### 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".

</Step>
</Steps>

## 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.
2 changes: 1 addition & 1 deletion content/docs/mcp_servers/meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "MCP Servers",
"icon": "Blocks",
"pages": ["index", "google_workspace", "salesforce"]
"pages": ["index", "google_workspace", "salesforce", "local_commander"]
}