A native LM Studio tools-provider plugin that wraps
local-onenote-mcp and defeats
LM Studio's MCP result truncation. It exposes the full OneNote command surface ā
discovery, reading, creation, structural edits, and app control ā as native plugin tools,
with retrieval results returned in model-controlled pages so nothing is silently cut off.
Credits: the underlying OneNote COM server,
local-onenote-mcp, is created and maintained by Peteroooooooo ā https://github.com/Peteroooooooo/local-onenote-mcp. This plugin is only a thin LM Studio wrapper around that server.
When local-onenote-mcp is used as a normal MCP server, LM Studio truncates large
tool results (long pages, big hierarchies, raw XML) and there is no setting to turn
that off. This plugin exposes the same operations as native plugin tools and
returns every large retrieval result in explicit, model-controlled pages:
offset + max_chars and return next_offset / has_more.Internally the plugin asks the underlying server for the full document (a very large
max_chars, so the server never truncates first), caches it, and hands it back to the
model one small, complete slice at a time. The model keeps calling with the returned
next_offset until has_more is false ā so it can read an entire page or list without
anything being silently cut off.
This plugin wraps every local-onenote-mcp command, plus one convenience command
(onenote_save_all_notebook_pages_xml_to_file).
| Tool | Purpose | Paging |
|---|---|---|
onenote_health_check | Verify OneNote connection + counts | ā |
onenote_resolve_identifier | Resolve GUID / path / name to one object | ā |
onenote_get_special_locations | Backup / unfiled / default notebook folder | ā |
onenote_list_notebooks | List notebooks | offset/limit |
onenote_list_sections | List sections (optionally in one notebook) | offset/limit |
onenote_list_pages | List pages in a section | offset/limit |
onenote_list_hierarchy | List hierarchy from a start point | offset/limit |
onenote_get_page | Page text (+ title/objects on first slice) | offset/max_chars |
onenote_get_page_text | Page plain text |
| Tool | Purpose |
|---|---|
onenote_open_hierarchy | Open or create a notebook / section group / section by path |
onenote_create_notebook | Create and open a local notebook |
onenote_create_section | Create a section under a notebook / section group |
onenote_create_section_group | Create a section group |
onenote_create_page | Create a page (plain / html / markdown) |
onenote_update_page_title | Rename a page |
onenote_append_to_page | Append an outline block to a page |
onenote_add_image_to_page | Add a local image to a page |
onenote_replace_page_body | Replace a page's body content (destructive) |
onenote_delete_page_content | Delete one content object by id (destructive) |
onenote_delete_hierarchy | Delete a notebook / group / section / page (destructive) |
onenote_update_page_xml | Advanced: submit raw page XML |
onenote_update_hierarchy_xml | Advanced: submit raw hierarchy XML |
| Tool | Purpose |
|---|---|
onenote_publish_object | Export a notebook / section / page to PDF, Word, XPS, HTML, etc. |
onenote_navigate_to | Focus an object in the OneNote UI |
onenote_navigate_to_url | Open a onenote: URL |
onenote_sync_hierarchy | Sync a notebook hierarchy object |
onenote_close_notebook | Close a notebook |
onenote_merge_sections | Merge one section into another (destructive) |
onenote_set_filing_location | Set filing location for email / clips / printouts |
| Tool | Purpose |
|---|---|
onenote_save_all_notebook_pages_xml_to_file | Read a whole notebook by name and write every page's XML to <notebook name>.xml, preserving the section-group / section / page structure |
Note: the write, structural, and app-control tools can create, modify, delete, and export your OneNote content. Enable the plugin only in chats where you want the model to have that access.
From this folder (lm-studio-plugin):
package-lock.json)LM Studio installs a plugin's dependencies from package.json and
package-lock.json, so this file must exist. (Running npm install here has already
created it.)
The plugin now appears in LM Studio's Program ā Plugins list and hot-reloads when you
edit the source. Keep this terminal open while developing. Once you are happy with it, you
can register it permanently with lms push (see Publishing below) ā after that LM Studio
runs it automatically and you no longer need lms dev.
Open the plugin's settings in LM Studio (gear icon next to the plugin). Defaults work if
local-onenote-mcp is on your PATH. To run the server directly from the Python venv
instead, set:
python.exe, e.g.
C:\Data\AI\MCP\local-onenote-mcp\.venv\Scripts\python.exe-m and local_onenote_mcp.serverOther settings (all optional):
| Setting | Default | Meaning |
|---|---|---|
| OneNote operation timeout (s) | 90 | LOCAL_ONENOTE_MCP_TIMEOUT for the server |
| Tool request timeout (ms) | 120000 | Max wait for one underlying call |
| Underlying max characters | 5,000,000 | max_chars sent so the server never truncates |
| Default page size (characters) | 8000 | Text/XML chars per call when max_chars omitted |
| Default item page size | 50 | List items per call when limit omitted |
Keep Default page size comfortably under LM Studio's tool-result limit. If you still see truncation, lower it (e.g. 4000) ā the model just makes more calls.
local-onenote-mcp MCP server
for chats where you use this plugin (or keep it only for write operations)."Read the full 'Project Launch Checklist' page from my Personal notebook."
Each large result includes has_more and next_offset. The model should:
offset = next_offset until has_more is false (text/XML), andoffset = next_offset for the next batch of list items.The plugin caches the full document after the first call, so paging is fast and does not re-hit OneNote for each slice.
onenote_save_all_notebook_pages_xml_to_file reads an entire notebook and writes one XML
file that mirrors its structure ā <notebook> ā <sectionGroup> ā <section> ā
<page>, with each page's raw OneNote XML embedded inline. The file is named after the
notebook (e.g. Personal.xml).
Example ask:
"Save all pages of my 'Personal' notebook to XML."
To register the plugin so it is always available (no lms dev needed):
Edit manifest.json (name, owner) before pushing if you want a different identity.
name must be kebab-case.
local-onenote-mcp ā the OneNote COM server this plugin wraps ā is created and
maintained by Peteroooooooo:
https://github.com/Peteroooooooo/local-onenote-mcp. All OneNote functionality comes
from that project; this plugin only adapts it to LM Studio's plugin API and adds
pagination plus the notebook-to-XML export convenience command.package.json). Refer to the
upstream repository for its own license terms.offsetlimitnext_offsethas_moreoffset/max_chars |
onenote_get_page_xml | Raw OneNote page XML | offset/max_chars |
onenote_get_page_objects | Outlines / images / attachments + callback IDs | offset/limit |
onenote_get_binary_content | Binary content (base64) by callback ID | offset/max_chars |
onenote_search_pages | Indexed text search with snippets (scope with start_identifier) | offset/limit |
onenote_find_meta | Find objects by OneNote meta name | offset/limit |
onenote_get_hyperlink | Client or web link for an object | ā |
onenote_get_parent | Parent object id | ā |
local-onenote-mcp).local-onenote-mcp already working. The plugin launches it as a child process.
The default assumes the global launcher is installed:
(You already have this if
local-onenote-mcp runs today as an MCP server in LM Studio.)lms CLI available. LM Studio bundles Node.js and the lms
command. If lms is not on your PATH, run its bootstrapper once (from the LM Studio
install directory), e.g.:
then restart your terminal. (You do not need a separate Node.js install ā the one used here for
npm install just generates the lock file.)notebook_name (required), output_dir (optional ā defaults to the
plugin's working directory; on the machine running OneNote), page_info (default
basic), overwrite (default false).pages_written, sections,
section_groups, page_read_errors, bytes).GetPageContent, which loads them into OneNote.
For very large notebooks it can make OneNote sluggish ā restart OneNote afterward if
needed. Pages that fail to read are written as an XML comment placeholder rather than
aborting the whole export.local-onenote-mcp runs in a terminal, or switch the plugin to the venv python.exe
path (step 3). On Windows a bare command / .cmd launcher is run through the shell
automatically; a full python.exe path is not (so paths with spaces are fine there).onenote_health_check; if it fails, the OneNote desktop app is
likely closed or the COM bridge isn't available.[onenote-retrieval] (and [server] for the child
process) appear in LM Studio's developer/plugin logs.GetPageContent, which loads that page inside the running OneNote process; heavy
automation grows OneNote's memory until a restart. Mitigations built in: (1) reads are
cached, so re-reading a page (any offset, including 0) does not re-hit OneNote ā pass
refresh: true only when you need fresh content; (2) passing a page GUID (the id
from list/search results) skips a full-store GetHierarchy that otherwise ran on every
read; (3) prefer onenote_get_page / onenote_get_page_text over onenote_get_page_xml,
and keep page_info: "basic" (avoid "all", which pulls binary). Reading a very large
number of distinct pages will still grow OneNote's memory ā that is an OneNote
limitation; restart it periodically for long sessions.onenote_search_pages defaults to OneNote's
fast search index. Avoid include_unindexed=true (a live scan that loads every page in
scope into OneNote) unless you must, and scope searches with start_identifier. The
bridge also releases its COM object after each call.npm install
lms dev
lms push
lm-studio-plugin/
āāā manifest.json # LM Studio plugin manifest (type/runner/name)
āāā package.json # deps: @lmstudio/sdk, zod
āāā package-lock.json # required by LM Studio to install deps
āāā tsconfig.json
āāā src/
āāā index.ts # registers config + tools provider
āāā configSchematics.ts# settings UI (command, page sizes, timeouts)
āāā mcpClient.ts # tiny stdio JSON-RPC MCP client (no extra deps)
āāā pagination.ts # text/item slicing + small LRU doc cache
āāā notebookDump.ts # builds the structured notebook XML export
āāā toolsProvider.ts # all OneNote tools (retrieval + write + control)
npm install -g github:Peteroooooooo/local-onenote-mcp
& "$env:USERPROFILE\.lmstudio\bin\lms.exe" bootstrap