L Loach Docs
Ctrl K

MCP support

Loach speaks the Model Context Protocol (MCP) over two transports: Streamable HTTP for hosted servers and gateways, and local process (stdio) for the many servers published as a command to run. Add servers in Settings → MCP and their tools become available to the model during a chat - and by default, every call waits for your approval.

What is MCP?

MCP is an open protocol that lets models call structured tools served by a separate process. Where Web fetch just hands the model a page of text, an MCP server can expose typed tools (“list files in this repo”, “search this database”, “send this email”) that the model calls with arguments and gets typed results back. The integration is provider-agnostic from Loach’s point of view - whichever model you are chatting with can use the tools, as long as it supports tool calls.

Adding a server

Open Settings → MCP and click Add server. Every server has:

Streamable HTTP

Local process (stdio)

Loach starts the program in your home folder - so a relative path in its arguments means the same thing however Loach was launched - and talks to it over its standard input and output. Saving doesn’t start it: it first runs when you test it, list tools with /tools, or send a message while it is enabled, and then stays running between turns. When you disable, edit or delete the server, Loach closes its input and gives it two seconds to exit; one that doesn’t is stopped along with every process it started (such as the node behind npx). When Loach quits, idle servers have their input closed and share one second to exit before they are stopped; one in the middle of a call is stopped at once. If the program exits before it answers, Test connection quotes the last lines of its error output (npm ERR! 404, a Python traceback), which usually says why.

On Windows, a bare npx resolves to npx.cmd through Loach’s own PATH, so commands work as typed; a PATH set in the server’s environment isn’t used for that lookup. On macOS and Linux the server gets the PATH your login shell builds - the one a terminal sees - followed by Loach’s own, so tools installed through Homebrew, nvm or ~/.local/bin are found even when Loach was started from the Dock or an app menu. A PATH set in the server’s environment replaces both.

A stdio server runs a program on your computer with your permissions, so Loach asks first in a native system dialog, “Run MCP server …?”. It appears when you test a stdio server, save a new one switched on, change the command, arguments or environment of an enabled one, or turn a disabled one on. Saving a server switched off doesn’t ask; turning it on does.

Approving tool calls

With Ask before each tool call on, every call from that server pauses the reply and shows a card - “Allow server to run tool?” - with the arguments the model wants to pass, and three answers:

A card left unanswered for 10 minutes doesn’t run either: the call is marked No answer, and the model is told nobody answered - not that you declined. Stop cancels the reply as usual. While a card waits, replies in other chats queue behind it; if it’s in a chat you aren’t looking at, a notice names that chat with an Open button, and a queued chat shows what it is waiting for with a Go to it button.

Turn Ask before each tool call off for a server you trust and its tools run without a card; the server’s row then carries an Auto-approve badge so the exception stays visible. Built-in tools never ask, except the file tools that change files - see Work in folders.

In a chat

The calls render in the collapsible “Called N tools” block above the answer - expand it to inspect each call’s name, arguments and result. The same block also covers built-in tools. When a tool returns an image, Loach shows it as an inline attachment on the reply rather than dropping it; the model itself is only told an image was attached.

Safety guards

Backups and imports

Headers and environment variables hold API keys, so they are left out of backups. Arguments are exported as typed, except credentials, which read REDACTED:

An HTTP server’s URL loses anything before the host and the value of every query parameter. Its path is kept, so a secret inside the path itself isn’t redacted. An environment variable or a header is still the better place for a secret.

A backup can’t prove you set up a command on this machine, so imported stdio servers arrive disabled; turning one on raises the consent dialog. HTTP servers keep the on/off state they had in the backup, unless their host couldn’t be looked up during the import - then they arrive switched off too. A server whose name breaks the naming rules (over 100 characters, or with invisible characters) is renamed rather than failing the import: the bad characters are dropped, and a name already taken gets “(2)”. After an import, re-enter any header, variable or redacted value a server needs.

Private Chat deliberately does not expose MCP tools - a tool call inside that surface could side-channel the conversation out to a third party, which would defeat the “leaves no trace” promise. It leaves out the built-in tools too, so it offers no tools at all.

Choosing a model

Loach offers the tools to whichever model you are chatting with; the model has to support tool calling to use them. Hosted models from major providers typically do, and many local Ollama models do too - Ollama refuses a request to one that doesn’t with an error saying it does not support tools.