Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
LMSTUDIO_MCP_API_KEYNoAPI token (only if you enabled token auth in LM Studio's Developer tab)
LMSTUDIO_MCP_TIMEOUTNoHTTP timeout in seconds; raise for slow models or large generations60.0
LMSTUDIO_MCP_BASE_URLNoLM Studio server URLhttp://localhost:1234

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/ui": {}
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_modelsA

List models available in the local LM Studio instance.

Queries /api/v0/models which returns every downloaded model with rich metadata: type (llm / vlm / embeddings), publisher, arch, quantization, state (loaded / not-loaded), and max_context_length.

Examples: list_models() list_models(type="llm") list_models(type="embeddings")

get_modelB

Get detailed info about a single model.

Examples: get_model(model_key="qwen/qwen3-4b-2507") get_model(model_key="text-embedding-nomic-embed-text-v1.5")

get_loaded_modelsA

List models currently loaded into memory (ready for inference).

Examples: get_loaded_models()

load_modelA

Load a model into memory so it is ready for inference.

If context_length is omitted, the model's configured default is used. Only LLMs loaded via LM Studio's llama.cpp engine honor flash_attention, num_experts, eval_batch_size and offload_kv_cache_to_gpu.

Examples: load_model(model_key="qwen/qwen3-4b-2507") load_model(model_key="openai/gpt-oss-20b", context_length=16384, flash_attention=True)

unload_modelA

Unload a model instance from memory, freeing RAM / VRAM.

The instance_id is the identifier returned by load_model (usually equal to the model key, but may differ when multiple instances of the same model are loaded). Use get_loaded_models to discover currently loaded instance_ids.

Examples: unload_model(instance_id="qwen/qwen3-4b-2507")

chatA

Send a chat completion request to a model (OpenAI-compatible /v1/chat/completions).

The model is auto-loaded if not already in memory (JIT loading enabled by default in LM Studio). Set stream=True only when the MCP client supports streamed responses; most do not.

Examples: chat(model="qwen/qwen3-4b-2507", messages=[{"role":"user","content":"Hello"}]) chat(model="qwen/qwen3-4b-2507", messages=[{"role":"system","content":"Be terse."},{"role":"user","content":"Hi"}], temperature=0.2, max_tokens=64)

completeA

Send a raw text-completion request to a model (OpenAI-compatible /v1/completions).

Prefer chat() for instruction-tuned conversational models. complete() is useful for base / completion models or for prompt-template experimentation.

Examples: complete(model="qwen/qwen3-4b-2507", prompt="The meaning of life is", max_tokens=20)

embedA

Generate an embedding vector for the given text (OpenAI-compatible /v1/embeddings).

input can be a single string or a list of strings for batch embedding.

Examples: embed(model="text-embedding-nomic-embed-text-v1.5", input="hello world") embed(model="text-embedding-nomic-embed-text-v1.5", input=["hello", "world"], normalize=True)

raw_requestA

Escape hatch: send an arbitrary request to the LM Studio REST API.

Use this when you need an endpoint not covered by a dedicated tool (e.g. /api/v1/chat stateful chats, /api/v1/models/download, /v1/responses, the Anthropic-compatible /v1/messages, etc.). path must start with a slash and is appended to the configured base URL.

Examples: raw_request(method="GET", path="/api/v0/models") raw_request(method="POST", path="/api/v1/chat", json_body={"model":"qwen/qwen3-4b-2507","messages":[{"role":"user","content":"hi"}]})

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dam2452/llmstudio-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server