Skip to main content
Glama
developersorli

mcp-file-system-lmstudio

mcp-file-system-lmstudio

一个 Model Context Protocol (MCP) 服务器,将本地 LM Studio 模型作为工具暴露。它通过 LM Studio 的 OpenAI 兼容 API 进行通信,因此 LM Studio 中加载的任何模型都可以从 MCP 客户端查询。

功能

  • lmstudio_chat — 向本地模型发送提示(或完整的多轮消息历史)并获取其响应

  • lmstudio_list_models — 列出 LM Studio 服务器上当前可用的所有模型

  • 无需 API 密钥 — 一切都在本地针对您自己的 LM Studio 实例运行

Related MCP server: llmstudio-mcp

要求

  • Node.js >= 18(使用内置的 fetch)

  • 一个正在运行的 LM Studio 服务器,且至少加载了一个模型

从 LM Studio 的界面启动服务器(开发者选项卡 → 启动服务器)。默认情况下,它监听 http://localhost:1234。

安装

git clone https://github.com/developersorli/mcp-file-system-lmstudio.git
cd mcp-file-system-lmstudio
npm install

配置

服务器读取两个可选的环境变量:

变量

默认值

描述

LMSTUDIO_BASE_URL

http://localhost:1234/v1

LM Studio OpenAI 兼容 API 的基础 URL

LMSTUDIO_MODEL

(自动)

默认模型 ID。如果未设置,则使用第一个可用的模型

MCP 客户端配置

适用于 Cline / Claude Desktop 风格客户端的示例:

{
  "mcpServers": {
    "mcp-file-system-lmstudio": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-file-system-lmstudio/index.mjs"],
      "env": {
        "LMSTUDIO_BASE_URL": "http://localhost:1234/v1",
        "LMSTUDIO_MODEL": "my-model-id"
      }
    }
  }
}

工具

lmstudio_chat

参数

类型

必需

描述

prompt

string

是

要发送的用户消息 / 提示

system

string

否

可选系统指令,作为系统消息前置

model

string

否

要使用的模型 ID(覆盖默认值)

temperature

number

否

采样温度 0–2(默认 0.7)

max_tokens

number

否

生成的最大 token 数

messages

array

否

完整对话历史;优先于 prompt/system

lmstudio_list_models

无参数。返回 LM Studio 服务器上所有可用模型的 ID。

许可证

MIT — 参见 LICENSE。

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    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.
    9
    1
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Bridges LM Studio local models to Claude Code as MCP tools, enabling private and free AI-assisted subtasks. Includes respond and models tools with automatic model selection and structured output.
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    Enables MCP-compatible clients to use locally running LM Studio models as tools for sending prompts, listing available models, and checking server status. It automatically handles WSL2 networking and follows the currently loaded model without reconfiguration.
    3
    -