MCP in LM Studio: Connecting Servers to a Local Model
Where mcp.json lives in LM Studio, how to add a local or remote MCP server, why servers built for cloud models can break a local one, and what actually stays on your computer.
LM Studio does more than chat with a local model. Since version 0.3.17, the app works as an MCP host: connect servers, and the model gets access to files, databases, trackers, and other tools. The setup itself takes a couple of minutes. The harder part is understanding which servers won't hurt a local model, and what stays on your computer once you've connected them.
What MCP does here
Model Context Protocol is a shared way to describe tools a model can use. The host (LM Studio, in this case) runs the servers, reads their list of tools, and shows the model what it's allowed to call. The protocol itself is explained in detail in what MCP is.
The model itself doesn't "connect" anything. It only asks for a tool to be called, and the host runs it. Which servers are available and what happens before a command executes depends on the host.
Where mcp.json lives
The configuration lives in a file called mcp.json. You can open it right from the
app: go to the Program tab in the right panel and choose Install → Edit
mcp.json. A built-in editor opens.
The format matches Cursor's mcp.json notation, so ready-made examples from other
hosts' documentation usually carry over without changes. Inside is a single
mcpServers object, where each key describes one server:
{
"mcpServers": {
"my-server": {
"url": "https://example.com/mcp",
"headers": {
"Authorization": "Bearer <TOKEN>"
}
}
}
}
That's how a remote server is described. A local one starts with a command — instead
of url, you specify command with arguments. The exact set of fields differs per
server, so check it against that specific project's README, not someone else's guide.
If you're copying a snippet from a server's documentation, take only the content after
"mcpServers": {. Otherwise the file ends up with two nested mcpServers objects,
and LM Studio won't see any servers at all.
Why servers built for cloud models break a local one
LM Studio's documentation warns about this directly: some servers are built for Claude, ChatGPT, and Gemini and burn through too many tokens for a local model.
The mechanics are simple. Tool descriptions land in the context on every request. A server with thirty tools and detailed schemas can eat up several thousand tokens before you even type your first message. A cloud model with a large window won't notice. A local model with 8,000 tokens of context hits the wall right away.
What helps:
- Connect servers one at a time and watch how the model's behavior changes.
- Raise the context in the model-loading settings if you have the memory for it.
- Disable servers you don't need for the current task instead of keeping everything on at once.
- For agentic scenarios, take a bigger model — confused tool arguments are a typical sign the model is too small for the job.
Security: what not to do
The documentation puts this bluntly: don't install MCP servers from untrusted sources, because some of them get broad access to the system. A server is a regular program that runs on your computer with your permissions. That means it can read files, write to them, and reach out over the network.
Minimal hygiene:
- Look at the source, or at least the repository, before adding a server to
mcp.json. - Don't give a filesystem server root access to a whole drive — scope it to a specific folder.
- Store tokens and keys in environment variables, not in config text that can end up in a screenshot by accident.
- Keep a human confirmation step for irreversible actions. There's a separate breakdown of this in the article on connecting an MCP server.
What stays local, and what doesn't
When LM Studio computes the model on your machine, the request text and the answer don't leave. The model, chat history, and settings live locally.
But MCP doesn't change that. A local MCP client doesn't turn a cloud service into a local one: the GitHub server still talks to GitHub, the Notion server to Notion, a web-search server sends a request to a search engine. What's local is only what physically computes and is stored on your side.
So you have to check the whole chain, not one checkbox: where the model computes, which servers are enabled, and where each one connects to. You get fully offline if you stick to servers that never reach the network — a filesystem or a local database, for instance, following the pattern in the article on MCP and a database.
Where to start checking
Take one filesystem server and one test folder with a few documents. Ask the model to find a specific fact in them and name the file. That request alone shows whether the tools actually reached the model, whether it has enough context, and whether it's reciting from memory instead of actually reading.
If the tools get called but the arguments come out wrong, that's usually the model, not the config. A roundup of servers worth trying first is in the article on useful MCP servers.
LM Studio or Doka
LM Studio is great when you want flexibility at the config level: several models
side by side, manual context tuning, your own set of servers in mcp.json. In
exchange, you assemble the setup yourself and keep an eye on whether the model is
choking on too many tools.
Doka is built differently. It's a desktop agent that already works with files, the terminal, and documents from the start, and MCP servers connect as part of a ready-made workflow; a local GGUF model can be downloaded from the interface. If comparing models and hand-assembling a config sounds interesting, LM Studio is closer to what you want. If you need to install an app and start working with MCP the same day, Doka is the shorter path — download it for free.
The difference between Ollama and LM Studio as a base for a local endpoint is covered separately.