MCP in LM Studio
LM Studio 0.3.17 introduces Model Context Protocol (MCP) support, allowing you to connect your favorite MCP servers to the app and use them with local models.
LM Studio supports both local and remote MCP servers. You can add MCPs by editing the app's mcp.json
file or via the new "Add to LM Studio" Button, when available.
Also new in this release:
Model Context Protocol (MCP) is a set of interfaces for providing LLMs access to tools and other resources. It was originally introduced by Anthropic, and is developed on Github.
Terminology:
mcp.json
Switch to the "Program" tab in the right hand sidebar. Click Install > Edit mcp.json
.
This will open the mcp.json
file in the in-app editor. You can add MCP servers by editing this file.
Edit mcp.json using the in-app editor
LM Studio currently follows Cursor's mcp.json
notation.
This MCP server provides access to functions like model and dataset search.
{ "mcpServers": { "hf-mcp-server": { "url": "https://huggingface.co/mcp", "headers": { "Authorization": "Bearer <YOUR_HF_TOKEN>" } } } }
<YOUR_HF_TOKEN>
with your actual Hugging Face token. Learn more here.Never install MCPs from untrusted sources.
Some MCP servers can run arbitrary code, access your local files, and use your network connection. Always be cautious when installing and using MCP servers. If you don't trust the source, don't install it.
When a model calls a tool, LM Studio will show a confirmation dialog to the user. This allows you to review the tool call arguments before executing it, including editing the arguments if needed.
Tool call confirmation dialog
You can choose to always allow a given tool or allow it only once.
If you choose to always allow a tool, LM Studio will not show the confirmation dialog for that tool in the future. You can manage this later in App Settings > Tools & Integrations
.
When you save the mcp.json
file, LM Studio will automatically load the MCP servers defined in it. We spawn a separate process for each MCP server.
For local MCP servers that rely on npx
or uvx
(or any other program on your machine), you need to ensure those tools are installed and available in your system's PATH.
mcp.json
lives in ~/.lmstudio/mcp.json
on macOS and Linux, and in %USERPROFILE%/.lmstudio/mcp.json
on Windows. It's recommended to use the in-app editor to edit this file.
If you're running into bugs, please open an issue on our bug tracker: https://github.com/lmstudio-ai/lmstudio-bug-tracker/issues.
We're also introducing a one-click way to add MCP servers to LM Studio using a deeplink button.
Enter your MCP JSON entry to generate a deeplink for the Add to LM Studio
button.
👇 This is a real interactive tool that you can use to create your own MCP install links. Try it!
Click on the button to copy the Markdown to clipboard.
Try to copy and paste the following into the link generator above.
{ "hf-mcp-server": { "url": "https://huggingface.co/mcp", "headers": { "Authorization": "Bearer <YOUR_HF_TOKEN>" } } }
<YOUR_HF_TOKEN>
with your actual Hugging Face token. Learn more here.Connecting MCP servers is easy. But what about creating your own tools and custom resources for your models?
Build 10
Build 9
Cmd + Shift + E
on Mac or Ctrl + Shift + E
on PC always opens the system prompt editor for the current chatBuild 8
Build 7
--stats
command to lms chat
command to show prediction statistics (Thanks @Yorkie)Build 6
Build 5
Build 4
Build 3
Build 2
Build 1
[⌘/Ctrl K + T]