Since LM Studio 0.3.17, the app acts as a Model Context Protocol (MCP) host: you can connect MCP servers and let your local models call their tools. Servers are added by editing the app’s mcp.json file, in the same notation Cursor uses. This guide adds the Hugging Face MCP server and asks the model to use it.
Before you start
- LM Studio 0.3.17 or newer installed.
- A local model that supports tool use loaded in LM Studio.
- A Hugging Face token if you use the Hugging Face MCP server.
Open mcp.json in LM Studio
Switch to the Program tab in the right-hand sidebar, click Install, then Edit mcp.json. The file opens in the in-app editor. On disk it lives at ~/.lmstudio/mcp.json on macOS and Linux, and %USERPROFILE%/.lmstudio/mcp.json on Windows.
Add the Hugging Face MCP server
Add the server inside the mcpServers object, replacing the token with your own:
{
"mcpServers": {
"hf-mcp-server": {
"url": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer YOUR_HF_TOKEN_HERE"
}
}
}
}
Save the file: LM Studio loads the server and starts a process for it. For local servers that use npx or uvx, those tools must be installed and on your PATH.
Ask the model to use a tool
Start a chat with a tool-capable model and ask it to search for a model on Hugging Face. LM Studio shows a confirmation dialog before running the tool call: read the arguments, edit them if needed, then allow it once or always.
Worked example
Sample prompt:
Search Hugging Face for a small GGUF model for English chat and tell me its name and size.
The expected result is that LM Studio shows a tool-call confirmation, the Hugging Face tool runs, and the reply names a real model with its size. If the model tries to answer from memory instead, the tool was not called: check that the server is loaded in the Program tab.
Expected result
UNTESTED in this guide: no MCP server was connected while writing it. The expected result is a tool-call confirmation dialog, a Hugging Face search result, and a reply naming a real model and size.
Limitations
Never install MCP servers from untrusted sources: some can run arbitrary code, access your local files and use your network. Small models, and models not trained for tools, can produce malformed calls. MCP servers built for large hosted models can use many tokens and overflow a local model’s context.
