LMStudio

v1.0.0Coding Agentsstable

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.

lmstudio-mcpmcpai-integration
Share:
156
Stars
0
Downloads
0
Weekly
0/5

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

Use locally-running LLM models through Claude's interface.
infinitimeless

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 9, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx lmstudio-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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'.

2

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]" openai
3

Note 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-MCP
4

Add 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"
      }
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "lmstudio-mcp": { "command": "npx", "args": ["-y", "lmstudio-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides