subforge-mcp

v1.3.1
subforge-mcp Checked 4 days ago Published 1 month ago

MCP server for local LM Studio models

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_models List LM Studio models

List models loaded into memory in the local LM Studio server, with their type: llm/vlm (chat, delegate_task), embedding (rank_by_similarity) or decision (decide, ask_decision, eval_decisions). Set include_unloaded to also see downloaded models load_model can load.

ParameterTypeDescription
include_unloadedbooleanAlso list downloaded models that are not loaded yet

chat Chat with local LM Studio model

Send a message to a local model running in LM Studio. Maintains conversation history per session_id across calls; call reset_chat to clear it.

ParameterTypeDescription
message *stringUser message to send
model *stringModel id, e.g. from list_models
max_tokensinteger
session_idstringConversation id to keep history separate across topics
system_promptstringSystem prompt; only applied when starting a new session
temperaturenumber

load_model Load a model into LM Studio memory

Explicitly load a downloaded-but-not-yet-loaded model (llm, embedding or decision) into LM Studio memory. Requires user consent via MCP elicitation before loading — this is the only tool in this server that can bring a new model into memory. Refuses if the connected client does not support elicitation, or if the user declines.

ParameterTypeDescription
model *stringModel id/key to load, e.g. a modelKey or path from a downloaded models listing
ttl_secondsintegerIdle time-to-live in seconds; LM Studio auto-unloads the model after this much inactivity

unload_model Unload a model from LM Studio memory

Explicitly unload a currently-loaded model from LM Studio memory. This is the counterpart to load_model. Unlike load_model, this does NOT require user consent via MCP elicitation: unloading only frees RAM/VRAM and is safely reversible (load it again any time), so it isn't gated behind a confirmation prompt. Returns a plain informative result (not an error) if the requested model isn't currently loaded.

ParameterTypeDescription
model *stringModel to unload — matched against a currently-loaded model's identifier, modelKey, or path (e.g. the identifier returned by load_model or list_models).

reset_chat Reset chat session

Clear the conversation history for a session_id (or all sessions).

ParameterTypeDescription
session_idstringSession to clear; omit to clear all sessions

rank_by_similarity Rank texts by semantic similarity

Embed a query and a list of documents with a loaded LM Studio embedding model and return the documents ranked by cosine similarity to the query (score, original index, preview). Vectors stay inside this server; only the ranking enters the conversation.

ParameterTypeDescription
documents *arrayCandidate texts; results refer to them by their index in this array
model *stringLoaded embedding model id (see list_models)
query *stringText to compare every document against
top_kintegerHow many results to return (10)

decide Pick between options with a local decision model

Ask a loaded LM Studio decision model which of 2-6 options best accomplishes a task given some context. Returns the chosen option id, its probability, the model's confidence and the full ranking. Describe options neutrally — the wording is the whole input. Never throws: on any failure it returns ok:false with an error code and probability 0, so treat probability as the gate for acting on the answer.

ParameterTypeDescription
options *array2-6 options, each {id, description}
task *stringWhat needs to be decided, in one or two sentences
contextstringConstraints and product context that should drive the choice
modelstringDecision model id; defaults to the only loaded decision model. Find one with list_models (include_unloaded) and load it with load_model.

ask_decision Ask a decision model raw typed questions

Send typed questions about one state straight to a loaded LM Studio decision model (POST /v1/systemone) and get the raw answers with probabilities. Use it to prototype a question before relying on it. Types: choice (criteria = {option: description|null}), score (criteria = 2-10 ordered levels, lowest first) and noul (yes/no; optional criteria {true, false}). Question ids are not shown to the model, so put the meaning in instructions. Never throws: failures come back as ok:false with an error code.

ParameterTypeDescription
questions *objectMap of your question id to a question
state *Content to judge: a string, or JSON with named parts
modelstringDecision model id; defaults to the only loaded decision model. Find one with list_models (include_unloaded) and load it with load_model.

eval_decisions Measure a decision model against labeled cases

Run every case in a labeled .jsonl file through a loaded LM Studio decision model and report overall accuracy, accuracy per probability band (0.5-0.6, 0.6-0.7, ...) and the lowest probability threshold whose auto-decisions reach target_accuracy. Each line is either a decide case {id?, task, context?, options: [{id, description}], label: <option id>} or a raw question case {id?, state, question, label}. Use it to set the threshold for acting on decide without asking a human.

ParameterTypeDescription
path *stringAbsolute path to the .jsonl dataset (max 5MB)
current_thresholdnumberThreshold in use today, to compare against the suggestion
min_supportintegerMinimum cases above a threshold before it can be suggested (5)
modelstringDecision model id; defaults to the only loaded decision model. Find one with list_models (include_unloaded) and load it with load_model.
target_accuracynumberAccuracy auto-decisions must reach (0.9)

delegate_task Delegate a mechanical coding task to a local model

Delegate a small, mechanical, multi-step coding task (a variable rename, a boring find/replace, a boilerplate first-draft) to a local model in LM Studio. The local model runs its own read/list/edit-file loop directly against the filesystem, scoped to `dir` — file contents and the back-and-forth never enter this conversation, only the final summary does, so this saves context on rote work. Pass only a plain-language `task`, never file contents. Do NOT use this for anything requiring nuanced judgment, understanding relationships across many files, awareness of the current conversation, or high…

ParameterTypeDescription
dir *stringAbsolute path to the directory the local model's file tools are scoped to. All read_file/list_dir/edit_file calls that would resolve outside this directory are refused.
model *stringLM Studio model id (from list_models); must already be loaded.
task *stringPlain-language instruction for the local model, e.g. 'rename variable foo to bar in utils.ts'. Do not include file contents — the model reads files itself via its own tools.
max_turnsintegerCap on agentic-loop iterations before returning a best-effort summary.
thinkbooleanBest-effort hint to disable the model's reasoning/thinking output for simple tasks (set false for speed). Not guaranteed — LM Studio's Jinja prompt template is the reliable control for this; see REA…