LMStudio
A bridge that allows Claude to communicate with locally running LLM models via LM Studio, enabling users to leverage their private models through Claude's interface.
What is LMStudio?
LMStudio is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to bridge that allows claude to communicate with locally running llm models via lm studio, enabling users to leverage their private models through claude's interface.
A bridge that allows Claude to communicate with locally running LLM models via LM Studio, enabling users to leverage their private models through Claude's interface.
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A bridge that allows Claude to communicate with locally runn
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx lmstudio-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use LMStudio
LMStudio-MCP is a Python-based bridge that connects Claude AI to locally running language models via LM Studio's OpenAI-compatible API. It exposes nine tools covering model listing, chat and text completions, embedding generation, and stateful multi-turn conversations — all routed to whatever model you have loaded in LM Studio. This means you can use Claude's interface and tool-calling capabilities to interact with private, local models like Llama, Mistral, or Phi without sending data to any external service.
Prerequisites
- LM Studio installed and running with at least one model loaded (download at lmstudio.ai)
- LM Studio's local server enabled (default: http://localhost:1234)
- Python 3.8 or later installed
- pip packages: requests, mcp[cli], openai
- An MCP-compatible client such as Claude Desktop
Install and start LM Studio
Download LM Studio from lmstudio.ai, install a model of your choice, and start the local server. By default it runs on http://localhost:1234. In LM Studio, go to the 'Local Server' tab and click 'Start Server'.
Install LMStudio-MCP
Clone the repository and install the required Python dependencies.
git clone https://github.com/infinitimeless/LMStudio-MCP.git
cd LMStudio-MCP
pip install requests "mcp[cli]" openaiNote the server path
Record the absolute path to the cloned LMStudio-MCP directory. You will need the path to the main server Python file for the MCP configuration.
# Find the full path:
pwd
# This will be something like /Users/yourname/LMStudio-MCPAdd the server to your MCP client configuration
Open your Claude Desktop configuration file and add the lmstudio-mcp entry. Set LMSTUDIO_HOST and LMSTUDIO_PORT if your LM Studio is not on the default localhost:1234.
{
"mcpServers": {
"lmstudio": {
"command": "python",
"args": ["/absolute/path/to/LMStudio-MCP/server.py"],
"env": {
"LMSTUDIO_HOST": "localhost",
"LMSTUDIO_PORT": "1234"
}
}
}
}Restart Claude Desktop and verify the connection
Save the configuration and restart Claude Desktop. Ask Claude to run a health check on the LM Studio connection or list available models. LM Studio must be running with its local server active for the tools to work.
LMStudio Examples
Client configuration
Claude Desktop configuration for LMStudio-MCP. Adjust the Python path and LMStudio-MCP directory path for your system. Use LMSTUDIO_HOST to point to a remote machine if LM Studio runs on a different host.
{
"mcpServers": {
"lmstudio": {
"command": "python",
"args": ["/Users/yourname/LMStudio-MCP/server.py"],
"env": {
"LMSTUDIO_HOST": "localhost",
"LMSTUDIO_PORT": "1234"
}
}
}
}Prompts to try
Use these prompts to interact with your locally running models through Claude's interface.
- "Check if the LM Studio server is healthy and list available models"
- "Which model is currently loaded in LM Studio?"
- "Ask the local model: what are the key differences between REST and GraphQL?"
- "Generate embeddings for this text using the local model: 'machine learning fundamentals'"
- "Start a conversation with the local model using the system prompt: you are a code review expert"Troubleshooting LMStudio
health_check fails: 'Connection refused' or 'Cannot connect to LM Studio'
Ensure LM Studio is running and the local server is started — look for the green 'Server Running' indicator in LM Studio's Local Server tab. The default port is 1234. If you changed it, update LMSTUDIO_PORT in your config to match.
list_models returns an empty list
You must load a model in LM Studio before it appears in the API. In LM Studio, go to the 'Chat' or 'My Models' tab, select a model, and load it. Only loaded models appear in the /v1/models endpoint.
Python path errors when starting the server
Ensure you are using the Python interpreter that has the required packages installed. If using a virtual environment, specify the full path to the venv Python binary (e.g., /Users/yourname/LMStudio-MCP/.venv/bin/python) in the command field of your MCP config.
Frequently Asked Questions about LMStudio
What is LMStudio?
LMStudio is a Model Context Protocol (MCP) server that bridge that allows claude to communicate with locally running llm models via lm studio, enabling users to leverage their private models through claude's interface. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install LMStudio?
Follow the installation instructions on the LMStudio GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with LMStudio?
LMStudio works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is LMStudio free to use?
Yes, LMStudio is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
LMStudio Alternatives — Similar Coding Agents Servers
Looking for alternatives to LMStudio? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up LMStudio in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use LMStudio?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.