MCP in LM Studio: web search and image generation for a local modelMCP servers: what they are and how to connect one

MCP in LM Studio: web search and image generation for a local model

The short version: from version 0.3.17 LM Studio can connect MCP servers through an mcp.json file. A remote server is added with two fields — url and headers with a key. After that, a local model can search the web, read pages and generate images, none of which it can do on its own.

Why a local model needs MCP

A model in LM Studio knows the world as of its training date and can only write text. Ask it about yesterday's news and it will either admit it does not know or, worse, invent an answer. Ask it to draw a logo and it will describe one in words: LM Studio is built for language models, and language models do not draw.

MCP closes both gaps without touching the model itself. You connect tools, and the model starts deciding for itself when to go and search and when to call a generator. The heavy lifting happens on the remote server: image generation needs no second graphics card and no wrestling with separate diffusion models.

TaskWithout MCPWith MCP
Fresh news, rates, documentationAn answer from memory, as of the training dateweb-search finds it, web-crawl reads the page
A picture from a descriptionOnly a description in wordstext-to-image returns a link to a finished image
Refine the picture you just gotNot possibleimage-to-image, by the file id from the previous generation
VideoNot possibleA separate set of video tools; generation takes minutes

What stays on your computer

The conversation and the model itself still run locally. What goes to the server is only the parameters of a call — the search query or the image description the model wrote itself. If that matters to you, simply do not enable tools in chats holding sensitive data.

Step 1. A model that can call tools

MCP only works with models trained to call functions (tool use, function calling). In LM Studio's catalogue those models carry a corresponding badge. Modern mid-sized models do the job — the Qwen3 and gpt-oss families, for instance. Very small models technically support calls but get confused about parameters and reach for tools at the wrong moments.

The second requirement is context. Tool descriptions take up room in every request, and a search result or a fetched page takes up more. Set the context length to at least 8–16 thousand tokens in the model's load settings, or tool responses will be truncated.

Step 2. Get a key

LM Studio passes the server a static header, so sign-in here is by key rather than through an OAuth window. The button below issues one, no registration:

A key for LM Studio

Get an sk-… key right here on the page

Pick any model series — LM Studio uses its own local model, and the MCP server only needs the key. It is substituted into the mcp.json below.

Press it and get your base_url and API key.

No sign-up, no card.

Free. Your key appears right here.

Step 3. Write the servers into mcp.json

In LM Studio, open the Program tab in the right-hand panel and choose Install → Edit mcp.json. The file opens in the built-in editor. Add the servers inside the mcpServers block:

Template — this will not work as ismcp.jsonThe highlighted parts are stand-ins. The button above issues them in seconds, no sign-up.
{
  "mcpServers": {
    "twelver-web-search": {
      "url": "https://twelver.app/api/mcp/v1/web-search",
      "headers": {
        "Authorization": "Bearer sk-<your-key>"
      }
    },
    "twelver-image": {
      "url": "https://twelver.app/api/mcp/v1/image-generation",
      "headers": {
        "Authorization": "Bearer sk-<your-key>"
      }
    }
  }
}

The common mistake: a nested mcpServers

If the file already has servers in it, do not paste a second "mcpServers": {…} block. Copy only the entries themselves — what is between its braces — and separate them with a comma. A doubled block is the single most common reason LM Studio "does not see" a server.

Save the file. The servers appear in the list on the Program tab, where a toggle switches each on and off without removing it from the config.

Step 4. Check it in a chat

Load a tool-capable model, open a new chat and ask for something the model cannot possibly know:

  • "Search the web for the latest version of LM Studio and summarise what's new in it" — the model will call web-search, and then most likely web-crawl on the link it found.
  • "Draw a cover for a podcast about coffee, square" — the model will call text-to-image and return a link to the picture.

Before a call, LM Studio shows which tool the model wants to run and with which parameters — you can allow or decline. For search it is convenient to always allow; for generation, confirm by hand, since it spends your balance.

What comes back from a generation

The generation server returns not the picture itself but a link to a file — the model puts it in its answer, and the image opens in the browser when you click it. That keeps the result from bloating the local model's context with megabytes of data, and the file stays reachable after the chat is closed.

On the starting tokens the picture arrives with a small wordmark on it; after the first purchase files are available in the original and can be downloaded. Everything about choosing engines — Nano Banana, Seedream, video through Seedance and Hailuo — is in image and video generation over MCP; the finer points of search are in MCP for web search.

If it does not work

SymptomCauseWhat to do
The server is not in the Program listBroken JSON — most often a doubled mcpServers or a missing commaRun the file through any JSON validator
The server is there, but the model never calls the toolsA model without tool-use support, or the server is switched offTake a model with the tools badge and check the server toggle
Error 401No key, or the header is missing the word BearerThe header must look like this: Authorization: Bearer sk-…
The model calls a tool with garbage parametersThe model is too smallTake a larger model, or connect fewer servers at once
The answer stops right after a searchNot enough context for the resultIncrease the context length when loading the model
LM Studio's interface checked against the documentation on 17 September 2026.

The same server connects to Claude and Cursor — and the big picture, what MCP is and what it is for, is in the overview of MCP servers.

Frequently asked questions

Does LM Studio support MCP?
Yes, from version 0.3.17. Servers are declared in an mcp.json file, opened on the Program tab through Install → Edit mcp.json. Both local servers (a launch command) and remote ones (a URL and headers) are supported.
How do I add an MCP server to LM Studio?
Open Program → Install → Edit mcp.json and add an entry to the mcpServers block: for a remote server, a url field and, if sign-in is needed, headers with Authorization: Bearer your-key. Save the file — the server appears in the list, and a tool-capable model can call it.
Can I generate images in LM Studio?
The language models in LM Studio do not draw, but MCP lets you connect a generator as a tool. The model then calls text-to-image when you ask and returns a link to the finished image. No graphics card for a diffusion model is needed — the generation runs on the server.
How do I get web search in LM Studio?
Connect a web-search MCP server in mcp.json and load a model that can call tools. The model decides for itself when to search, and a page-reading tool lets it open the source it found in full. In detail: MCP for web search.
Which model in LM Studio works best with MCP?
Any with tool-use support — the catalogue marks those with a tools badge. In practice, mid-sized models from recent families behave most reliably, for example Qwen3 and gpt-oss. Very small models get lost in the parameters, and with a small context window tool results get truncated.
Does my conversation leave the machine if I connect MCP?
No. The conversation and the model stay on your computer; what goes to the MCP server is only the parameters of a specific call — for example the search query or the image description the model wrote.

Try it yourself

Everything in this guide runs inside Twelver

One chat for text, images, video, music and voice — no separate services or subscriptions.

Open Twelver chat
Rate your experience