dam2452

llmstudio-mcp

Community dam2452
Updated

llmstudio-mcp

Polski

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
  • Environment variables
  • Prerequisites
  • Wiring it up
  • Local run

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 withthe Developer tab toggle on, or lms server start from the CLI. At least onemodel 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/

MCP Server ยท Populars

MCP Server ยท New

    healthchainai

    healthchain

    Python SDK for healthcare AI โ€” typed, validated FHIR tools for agents, real-time EHR connectivity, production deployment โœจ ๐Ÿฅ

    Community healthchainai
    deverman

    FocusRelay โ€” Fast Swift OmniFocus MCP Server and CLI for macOS

    Fast native Swift OmniFocus MCP server and CLI for macOS. Let AI assistants safely read, update, complete, and organize tasks and projects through documented Omni Automation APIs.

    Community deverman
    Glade-tool

    GladeKit MCP

    Connect any MCP-compatible AI client (Claude Code, Cursor, Windsurf) to Unity or Godot. 235+ granular tools, an editor aware system prompt, game design document project context, script semantic search, and skill calibration.

    Community Glade-tool
    Consiliency

    Code-Index-MCP

    Code indexing MCP server to provide context to coding agents.

    Community Consiliency
    semihbugrasezer

    seerxo

    AI-powered Etsy product listing generator for Claude Desktop Generate perfect SEO titles, descriptions, and tags in seconds

    Community semihbugrasezer