Skip to main content
Glama
ibukichi-jp

mcp-server-lmstudio

by ibukichi-jp

mcp-server-lmstudio

LM Studio (ローカル LLM) を Model Context Protocol (MCP) 経由で呼び出すためのブリッジサーバーです。

Antigravity IDE、Claude Desktop、Cursor などの MCP 対応クライアントから、完全ローカルで動作する LM Studio のモデル(Qwen、Llama、DeepSeek 等)をツールとして利用できます。


主な特徴

  • 🚀 WSL2 自動対応: WSL2 と Windows ホスト間の仮想ネットワーク IP を自動検出し、通信エラーを防止します。

  • 🔄 モデル自動追従: LM Studio で現在ロードされているモデルを自動判別するため、モデルを変更しても設定の書き換えは不要です。

  • 🛡️ 安全・軽量: 秘密情報や API キーの管理は不要。完全ローカル環境で通信します。


Related MCP server: LM Studio MCP Bridge

提供するツール (Tools)

  1. ask_local_llm

    • ローカル LLM にプロンプトや質問を送信し、回答を取得します。

    • 引数: prompt (必須), system_prompt (任意), temperature (任意)

  2. list_local_models

    • LM Studio で現在ロード中・利用可能なモデル一覧を取得します。

  3. check_lm_studio_status

    • LM Studio の Local Server が起動・接続可能か確認します。


必要要件

  • Node.js: v18.0.0 以上

  • LM Studio: 最新版


インストール & セットアップ

1. リポジトリのクローンと依存関係のインストール

git clone https://github.com/ibukichi-jp/mcp-server-lmstudio.git
cd mcp-server-lmstudio
npm install

2. LM Studio 側の設定

  1. LM Studio を起動し、使用したいモデルをロードします。

  2. 左サイドバーの 「<-> (Developer / Local Server)」 を開きます。

  3. Serve on local network (0.0.0.0) または Enable CORS を有効にします。

  4. Start Server(ポート 1234)をクリックしてサーバーを起動します。

3. MCP クライアントへの登録

■ Antigravity IDE の場合

~/.gemini/config/mcp_config.jsonmcpServers に追加します:

{
  "mcpServers": {
    "lm-studio": {
      "command": "node",
      "args": [
        "/path/to/mcp-server-lmstudio/index.mjs"
      ]
    }
  }
}

■ Claude Desktop の場合

claude_desktop_config.json に追加します:

{
  "mcpServers": {
    "lm-studio": {
      "command": "node",
      "args": [
        "/path/to/mcp-server-lmstudio/index.mjs"
      ]
    }
  }
}

ライセンス

MIT License

Available Tools

3 tools
ask_local_llmC

Send a prompt or coding question to the local LLM running in LM Studio.

ParametersJSON Schema
NameRequiredDescriptionDefault
modelNoOptional model ID. If omitted, the currently loaded model in LM Studio is used.
promptYesThe prompt / instruction / question to send to the local LLM
temperatureNoSampling temperature (default: 0.7)
system_promptNoOptional system instructions (e.g. 'You are an expert full-stack developer')

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It doesn't state whether the local server must be running, what happens on failure, latency/timeout behavior, output format, or whether it's synchronous. 'Send a prompt' is all the agent gets.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single tight sentence with no waste. Appropriately sized, though its brevity is partly why other dimensions are thin.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that performs inference against an external local server with no annotations and no output schema, the description leaves major gaps: no return value expectations, no error/timeout handling, no environment prerequisites. The agent cannot predict the response shape or failure modes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds nothing about parameters (model defaulting, temperature, system_prompt) beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb+resource: sends a prompt to the local LLM in LM Studio. It distinguishes itself reasonably from siblings (list_local_models, check_lm_studio_status) by being the only one about inference, though it never names them explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use guidance, no prerequisites (e.g., LM Studio must be running), and no mention of alternatives like check_lm_studio_status to verify availability first. The agent must infer all of this.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

check_lm_studio_statusB

Check if LM Studio local server is currently running and accessible.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It states what is verified but not what the result looks like, whether it fails silently, what timeout or error behavior applies, or whether it makes a network call — all relevant for an agent deciding how to react.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler or repetition. Every word contributes to the stated purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Complexity is very low (no parameters, non-mutating check), so a brief description is defensible. However, with no output schema and no annotations, the description omits the one thing an agent most needs: what a 'running' versus 'not running' result actually returns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so there is no parameter semantics to document. Baseline 4 applies; nothing in the description contradicts or confuses the empty schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (check) and resource (LM Studio local server) plus the two conditions verified (running, accessible), so the purpose is unambiguous. It does not, however, distinguish this from siblings like list_local_models or ask_local_llm, which are the tools that logically follow a successful status check.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit guidance on when to call this versus the sibling tools, nor any stated prerequisites or ordering (e.g., 'call before invoking local LLM tools'). The intended usage is only weakly inferable from the name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_local_modelsA

List currently loaded and available models in LM Studio.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. 'List' implies a non-destructive read, and the loaded-vs-available distinction adds some behavioral context, but there is no mention of connection requirements to LM Studio or what happens if the service is unreachable. For a zero-argument read tool this is acceptable, though thin.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence with no filler. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple zero-parameter read tool with no output schema, the description is nearly sufficient. The one omission is any hint about the underlying LM Studio dependency, but little else an agent needs is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Zero parameters, so the baseline of 4 applies. There is nothing for the description to disambiguate or compensate for.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (list) and resource (loaded and available models in LM Studio), and the scope distinction between 'currently loaded' and 'available' is explicit. It is reasonably distinguishable from check_lm_studio_status and ask_local_llm, though it does not name them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the verb – an agent would use this to discover what models exist before invoking ask_local_llm – but the description states no when-to-use condition, prerequisites, or alternatives. Adequate but with a clear gap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.1.0
    • First observedask_local_llm
    • First observedcheck_lm_studio_status
    • First observedlist_local_models

TDQS

A3.6/5.0

Scored across 3 tools

Disambiguation5/5

Each tool targets a clearly distinct function: listing models, asking the LLM, and checking server status. There is no overlap or ambiguity between them.

Naming Consistency5/5

All names use snake_case with a consistent verb-first pattern (list_, ask_, check_). The minor variation in object wording reflects their distinct targets rather than inconsistent convention.

Tool Count5/5

Three tools are well-scoped for the narrow purpose of interacting with a local LM Studio server. Each tool earns its place and no tool feels redundant or missing at this scale.

Completeness4/5

Core operations for checking status, listing models, and querying the LLM are covered. Minor gaps exist, such as model load/unload or generation parameter control, but these are not essential for basic use.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers