src / configSchematics.ts
import { createConfigSchematics } from "@lmstudio/sdk";
/**
* Configuration for the OneNote Retrieval plugin.
*
* These settings control how the plugin launches and talks to the underlying
* `local-onenote-mcp` stdio server, and how large each page/slice of a result
* is allowed to be. Keeping each returned slice small is what prevents LM
* Studio from truncating the result: instead of one giant response, the model
* pulls the content across several small, complete responses.
*/
export const configSchematics = createConfigSchematics()
.field(
"serverCommand",
"string",
{
displayName: "OneNote MCP command",
subtitle: "Executable that launches the local-onenote-mcp stdio server.",
hint:
"Default is the global npm launcher 'local-onenote-mcp'. To run the server " +
"directly from a Python virtual environment instead, set this to the full path " +
"of python.exe (e.g. C:\\\\path\\\\to\\\\.venv\\\\Scripts\\\\python.exe) and add the " +
"module args below.",
placeholder: "local-onenote-mcp",
},
"local-onenote-mcp",
)
.field(
"serverArgs",
"stringArray",
{
displayName: "OneNote MCP arguments",
subtitle: "One argument per row. Leave empty when using the global launcher.",
hint:
"When pointing 'OneNote MCP command' at python.exe, set these to: -m and " +
"local_onenote_mcp.server (two separate rows).",
allowEmptyStrings: false,
maxNumItems: 12,
},
[],
)
.field(
"timeoutSeconds",
"numeric",
{
displayName: "OneNote operation timeout (seconds)",
subtitle: "Passed to the server as LOCAL_ONENOTE_MCP_TIMEOUT.",
hint: "How long the OneNote COM bridge may take for a single operation.",
int: true,
min: 10,
max: 600,
slider: { min: 10, max: 300, step: 5 },
},
90,
)
.field(
"requestTimeoutMs",
"numeric",
{
displayName: "Tool request timeout (ms)",
subtitle: "Max time to wait for one call to the underlying server.",
hint: "Should be larger than the OneNote operation timeout above.",
int: true,
min: 5000,
max: 600000,
slider: { min: 30000, max: 300000, step: 5000 },
},
120000,
)
.field(
"underlyingMaxChars",
"numeric",
{
displayName: "Underlying max characters",
subtitle: "Value sent to the server as max_chars so IT never truncates first.",
hint:
"The plugin asks the server for the full document (this large limit), then hands " +
"it back to the model in small pages. Increase for very large pages.",
int: true,
min: 100000,
max: 50000000,
slider: { min: 500000, max: 20000000, step: 500000 },
},
5000000,
)
.field(
"defaultPageChars",
"numeric",
{
displayName: "Default page size (characters)",
subtitle: "Characters returned per call for text/XML tools when the model omits max_chars.",
hint:
"Keep this comfortably under LM Studio's tool-result limit. The model can request " +
"the next slice with the returned next_offset.",
int: true,
min: 500,
max: 60000,
slider: { min: 1000, max: 30000, step: 500 },
},
8000,
)
.field(
"defaultItemLimit",
"numeric",
{
displayName: "Default item page size",
subtitle: "Items returned per call for list/search tools when the model omits limit.",
hint: "Applies to notebooks, sections, pages, hierarchy, search results, and page objects.",
int: true,
min: 1,
max: 500,
slider: { min: 5, max: 200, step: 5 },
},
50,
)
.build();