LM Studio MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
LM Studio MCP Server
An MCP (Model Context Protocol) server that wraps the official LM Studio Python SDK to provide tools for interacting with LM Studio - a local AI model runner for macOS, Windows, and Linux.
Features
Health Check: Verify LM Studio is running and get an overview
Model Management: List, load, and unload models
Model Search: Search for models in LM Studio Hub
Chat: Send chat messages with customizable parameters
Completions: Generate text completions
Embeddings: Get embeddings for text
Related MCP server: mcp-file-system-lmstudio
Requirements
Python 3.10+
LM Studio installed and running
Installation
From PyPI
pip install lms-mcpFrom Source
git clone https://github.com/sweeden-ttu/lms-mcp.git
cd lms-mcp
pip install -e .Quick Start
Make sure LM Studio is running on your machine
Start the MCP server:
lms-mcpOr run directly:
python -m src.serverConfiguration
Environment Variables
Variable | Description | Default |
| Base URL for LM Studio API |
|
| API token for authentication | None |
Available MCP Tools
health_check
Check if the LM Studio server is running and get an overview of models.
Returns: Server status, total models count, loaded models count, and available models count.
list_models
List all available models (both loaded and downloaded).
Returns: Formatted list showing loaded models and available (downloaded but not loaded) models.
search_models
Search for models in LM Studio Hub.
Parameters:
query(str): Search termlimit(int): Number of results (default: 10)
Returns: List of matching models with descriptions.
load_model
Load a model into memory.
Parameters:
model(str): Model identifier (e.g., 'mistralai/Mistral-7B-Instruct-v0.3.Q4_K_M')context_length(int, optional): Context window sizegpu_offload(float, optional): GPU offload ratio (0.0 to 1.0)
Returns: Success message.
unload_model
Unload a model from memory.
Parameters:
model(str): Model identifier to unload
Returns: Success message.
chat
Send a chat message and get a response.
Parameters:
model(str): Model identifiermessage(str): The user's messagesystem_prompt(str, optional): System prompt overridetemperature(float, optional): Sampling temperature (default: 0.7)max_tokens(int, optional): Max tokens to generate (default: -1 for unlimited)context_length(int, optional): Context window override
Returns: Model response with optional stats (tokens/sec, TTFT, generation time).
chat_session
Continue a multi-turn chat session.
Parameters:
model(str): Model identifiermessages(list[dict]): List of message dicts with 'role' and 'content' keyssystem_prompt(str, optional): System prompt overridetemperature(float, optional): Sampling temperaturemax_tokens(int, optional): Max tokens to generate
Returns: Model response.
complete
Generate a text completion.
Parameters:
model(str): Model identifierprompt(str): The prompt texttemperature(float, optional): Sampling temperaturemax_tokens(int, optional): Max tokens to generatestop(str, optional): Stop sequence
Returns: Completed text.
get_embeddings
Get embeddings for text.
Parameters:
model(str): Embedding model identifiertext(str): Text to embed
Returns: Embedding dimension and first 5 values.
Usage with Claude Desktop
Add this to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"lms-mcp": {
"command": "lms-mcp",
"args": []
}
}
}Or for development:
{
"mcpServers": {
"lms-mcp": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/path/to/lms-mcp"
}
}
}Cursor, OpenCode, and Other Editors
See docs/integrations.md for detailed setup instructions for:
Cursor
OpenCode
VS Code
Windsurf
Development
Running Tests
pytestRun with coverage:
pytest --cov=src --cov-report=term-missingLinting and Formatting
ruff check . --fix
ruff format .Type Checking
mypy src/License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Access Pollinations models and API capabilities through agent tools.
Account, billing, team, API key and model discovery tools for agents that use ModelsLab.
Run any Relay model (image, video, audio, LLM), poll tasks, upload files and search Relay's docs.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to manage LM Studio models, including listing, loading, and unloading models through the LM Studio API.65ISC
- AlicenseNot gradedqualityDmaintenanceExposes local LM Studio language models as MCP tools, enabling chat completions and model listing through a local OpenAI-compatible API without requiring API keys.MIT
- FlicenseBqualityCmaintenanceEnables MCP clients to administer a local LM Studio instance: loading, estimating, downloading, configuring and unloading models, running chat and embedding inference, diagnosing the server, engines and hardware, and managing MCP connectors with conflict-safe configuration. It also builds a local document index supporting citation-checked search and answers grounded in TXT, Markdown, PDF and DOCX files.28-
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to interact with models running locally in LM Studio, including listing loaded models, chatting with per-session history, and loading models into memory with user consent.46 npmMIT