LM Studio MCP Setup: Connect MCP Servers to Local Models (2026)
Use MCP servers in LM Studio: edit mcp.json from the Program tab, add local (npx/uvx) or remote servers, use the Add to LM Studio deeplink, approve tool calls, and avoid context overflows.
Can LM Studio Use MCP Servers?
Yes. Since version 0.3.17, LM Studio is an MCP host: you can connect local and remote MCP servers to the desktop app and let the models you run locally call their tools. You add servers by editing LM Studio's mcp.json file in the in-app editor, or with a one-click Add to LM Studio button when a server publishes one. The file uses the same mcpServers notation as Cursor, so most configs you find on MCP.so work after a copy and paste.
This guide covers where the file lives, how to add a local and a remote server, the deeplink format, the tool-call confirmation dialog, and the problems people hit most often with local models. It is checked against LM Studio's MCP documentation, the Add to LM Studio button docs and the 0.3.17 release notes.
Where LM Studio Keeps MCP Configuration
| OS | File |
|---|---|
| macOS / Linux | ~/.lmstudio/mcp.json |
| Windows | %USERPROFILE%/.lmstudio/mcp.json |
LM Studio recommends editing it through the app: open the Program tab in the right-hand sidebar and click Install > Edit mcp.json. The file opens in the in-app editor.
Add an MCP Server to LM Studio
- Update LM Studio to 0.3.17 or later.
- Open the Program tab in the right sidebar and choose Install > Edit mcp.json.
- Paste a server entry inside
"mcpServers"and save. A remote server only needs a URL (plus headers if it uses a token):
{
"mcpServers": {
"hf-mcp-server": {
"url": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer <YOUR_HF_TOKEN>"
}
}
}
}
A local (stdio) server uses command and args, the same as in Cursor or Claude Desktop:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}
- Start a chat with a model that supports tool use. When the model calls a tool, LM Studio shows a confirmation dialog first (see below).
When you copy a config from somewhere else, paste only what sits inside "mcpServers": { ... }, not a second mcpServers wrapper. For servers launched with npx or uvx, Node.js or uv must be installed and on your system PATH, because LM Studio runs that command on your machine.
One-Click Install: the Add to LM Studio Button
Server authors can publish an Add to LM Studio button. It is a deeplink:
lmstudio://add_mcp?name=<server-name>&config=<base64-encoded JSON>
name is the server name and config is the server's JSON entry (for example {"url": "...", "headers": {...}}) encoded in Base64. LM Studio's docs page has a generator that turns a JSON entry into the link plus Markdown or HTML for the button. You still need to fill in any token placeholders after installing.
Tool Call Confirmations
Every time a model calls an MCP tool, LM Studio asks first. The dialog shows the tool and its arguments, lets you edit the arguments before it runs, and lets you allow the call once or always allow that tool. Choosing "always allow" skips the dialog for that tool from then on, so keep it for read-only tools you trust.
Limits and Gotchas
- Only install servers you trust. Some MCP servers can run arbitrary code, read local files and use your network.
- Context size. Many MCP servers were designed for Claude, ChatGPT or Gemini and return long tool descriptions and results. On a local model this can quickly fill the context window and cause frequent overflows. Connect only the servers a chat needs, and raise the model's context length if your hardware allows.
- Model support. Tool calling depends on the model; small models may ignore tools or call them badly. Try a model that LM Studio marks as tool-capable.
- Placeholders. Replace tokens like
<YOUR_HF_TOKEN>before saving, or the server will fail to connect.
FAQ
Which LM Studio version supports MCP? 0.3.17 (build 10) and later support both local and remote MCP servers.
Is the LM Studio mcp.json the same format as Cursor's? Yes. LM Studio follows Cursor's mcp.json notation, so command/args/env entries and url/headers entries carry over.
Can I stop LM Studio from asking before every tool call? Yes, choose "always allow" for a tool in the confirmation dialog. It applies per tool, so you can keep confirmations for tools that write data.
Find Servers to Try
Browse MCP servers on MCP.so or remote MCP servers and paste their config into mcp.json. Popular starting points are Playwright MCP for browser automation and the filesystem server. For other local-model setups, see Ollama MCP setup; for client concepts, see the MCP client guide.
Sources checked on 2026-11-16: LM Studio: Use MCP Servers, Add to LM Studio button, LM Studio 0.3.17 release notes.