llmstudio-mcp
MCP server that connects LLM agents to a local LM Studio instance, enabling model management, OpenAI-compatible chat completions, text completions, and embeddings through a set of tools.
README
llmstudio-mcp
MCP server exposing a local LM Studio instance to LLM agents — list / load / unload models, run chat and text completions, generate embeddings, and reach any other LM Studio REST endpoint via a raw escape hatch.
Table of contents
Tools
| Tool | Parameters | Description |
|---|---|---|
list_models |
type: "all" | "llm" | "embedding" | "vlm" = "all" |
Lists downloaded models with metadata (type, state, context length, quant) |
get_model |
model_key: str |
Info about a single model |
get_loaded_models |
— | Models currently resident in memory |
load_model |
model_key, context_length?, flash_attention?, offload_kv_cache_to_gpu?, num_experts?, eval_batch_size? |
Loads a model into memory |
unload_model |
instance_id: str |
Frees a model from memory |
chat |
model, messages, temperature?, max_tokens?, top_p?, top_k?, stop?, stream?, tools? |
OpenAI-compatible chat completion (/v1/chat/completions) |
complete |
model, prompt, temperature?, max_tokens?, top_p?, top_k?, stop?, stream? |
OpenAI-compatible text completion (/v1/completions) |
embed |
model, input, normalize=false |
OpenAI-compatible embeddings (/v1/embeddings) |
raw_request |
method, path, json_body? |
Escape hatch for any LM Studio REST endpoint |
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
LMSTUDIO_MCP_BASE_URL |
no | http://localhost:1234 |
LM Studio server URL |
LMSTUDIO_MCP_API_KEY |
no | empty | API token (only if you enabled token auth in LM Studio's Developer tab) |
LMSTUDIO_MCP_TIMEOUT |
no | 60.0 |
HTTP timeout in seconds; raise for slow models or large generations |
Prerequisites
LM Studio running with its API server enabled — either the desktop app with
the Developer tab toggle on, or lms server start from the CLI. At least one
model downloaded (lms get <model>).
Wiring it up
Only requirement: uv (https://docs.astral.sh/uv/). Nothing else to install.
Claude Code
claude mcp add llmstudio-mcp -- uvx --from git+https://github.com/dam2452/llmstudio-mcp.git llmstudio-mcp
If you enabled API token auth in LM Studio:
claude mcp add llmstudio-mcp -e LMSTUDIO_MCP_API_KEY=<token> -- uvx --from git+https://github.com/dam2452/llmstudio-mcp.git llmstudio-mcp
Claude Desktop / other MCP client
{
"mcpServers": {
"llmstudio-mcp": {
"command": "uvx",
"args": ["--from", "git+https://github.com/dam2452/llmstudio-mcp.git", "llmstudio-mcp"]
}
}
}
After pushing a new version: uv cache clean and restart the client.
Local run
uv run --directory . llmstudio-mcp
Tests (manual):
uv run --directory . --with pytest pytest test/
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.