Skip to main content
Glama

@bitefoundry/onenote

Read and edit OneNote pages, search cached notebooks, and update checklists from the terminal.

npm version Platforms Built with Rust & Ratatui License: MIT

BiteFoundry · Latest release notes

Microsoft OneNote TUI Demo


Highlights

Capability

Details

Minimal-Chrome 3-Pane TUI

Personal and Teams/Group notebooks, colored section ribbon, nested subpages (level 0/1/2), bidirectional XHTML ↔ Markdown canvas, surgical data-id PATCH edits, optimistic to-do toggles, Link Extractor (u), File Picker with zoxide (Ctrl+F), and 6 themes.

High-Res Terminal Images

Inline thumbnails & fullscreen HD previews (v / Alt+v) with 80ms protocol probing for Kitty, iTerm2, Sixel (Floyd-Steinberg dithering), and 24-bit Unicode Half-Blocks + Ctrl+V clipboard PNG upload.

Local SQLite FTS5 + IPC Daemon

WAL-mode SQLite cache with 4-reader pool, trigram full-text search (/), persistent DraftStore, and a shared background sync daemon (onenote daemon start).

4-in-1 Agent Interface

Interactive TUI (onenote), scriptable --json CLI, local HTTP JSON API (onenote serve, port 8793), and stdio MCP Server (onenote mcp).


Related MCP server: Local OneNote MCP

Quick Start

# 1. Install globally via npm (precompiled native binary for win32 / darwin / linux)
npm i -g @bitefoundry/onenote

# 2. Authenticate with Microsoft 365 (PKCE loopback, --device-code, or --token-file)
onenote login

# 3. Launch the interactive TUI
onenote
onenote read "Meeting notes" --json

Read a page with its key and notebook scope. Local search uses the identified account’s cache. If you use an opaque access token, run onenote whoami once online first. For full detail, add --full in the CLI or pass compact: false to get_page in MCP.

Build from source with cargo build --release. See installation and migration for updating scripts, MCP configurations, and local HTTP clients.

Company-managed Microsoft Entra sign-in

onenote login uses the public Microsoft Graph Command Line Tools client by default. To use a company-owned app, register it as a public client and configure the http://localhost redirect URI. Enable public client flows for headless --device-code sign-in. Company app registration guide

Add the Microsoft Graph delegated permissions your users need and have your Entra administrator grant consent where required.

Feature

Delegated scopes

Profile and session refresh

User.Read, offline_access

Read, create, and edit the user's OneNote content

Notes.Read, Notes.Create, Notes.ReadWrite

Discover joined Teams and read or edit organizational notebooks the user can access

Team.ReadBasic.All, Notes.Read.All, Notes.ReadWrite.All

The default sign-in adds the organizational scopes when you specify your company's tenant ID. Set scopes in config.toml to request a narrower set that matches your workflow.

onenote login --client-id YOUR_APP_ID --tenant-id YOUR_TENANT_ID
onenote whoami --json

For persistent environment configuration, set ONENOTE_CLIENT_ID and ONENOTE_TENANT_ID.

When supplying a token without an embedded user ID (for example an opaque ONENOTE_ACCESS_TOKEN or ONENOTE_TOKEN_FILE), run onenote whoami once while online to record only the token fingerprint and user ID under identity-map/. Running local search (without --refresh) or --offline with an unrecorded token returns an Unknown identity error instead of falling back to an empty default cache. Running onenote search <query> --refresh also records the identity binding. Whenever the token rotates or changes, run onenote whoami once again for the new token.

Enterprise networks / custom CA

HTTPS connections trust the bundled Mozilla roots and the operating system's trust store. If your network inspects HTTPS with a private root CA that is not in either, export that root as PEM and point the CLI at it:

Variable

Behaviour

ONENOTE_EXTRA_CA_PEM

PEM file (one certificate or a bundle) added to the trusted roots. If it cannot be read or parsed, the command fails with an error naming the file.

SSL_CERT_FILE

Also loaded as extra roots. An unusable file is reported on stderr and skipped. When set, it replaces the OS trust store for the native-roots lookup; the bundled roots still apply.

NODE_EXTRA_CA_CERTS

Also loaded as extra roots, so an existing Node.js setup works unchanged. An unusable file is reported on stderr and skipped.

export ONENOTE_EXTRA_CA_PEM=/path/to/corporate-root.pem
onenote doctor --online

A certificate from an unknown issuer produces a TLS certificate was not trusted (unknown issuer) hint naming these variables. Certificate verification cannot be turned off. Warnings go to stderr only, so onenote mcp stdio output is unaffected.


Keybindings Cheat Sheet

Key

Action

Tab / Shift+Tab

Cycle focus (Notebooks → Pages → Note Canvas)

j / k · ↑ / ↓

Navigate notebooks, pages, subpages, or blocks

[ / ]

Switch to previous / next section tab

n

Create a page (Markdown + Ctrl+V PNG)

a / e

Append Markdown block / surgically edit selected block

Space / x

Toggle selected To-Do checkbox (data-tag="to-do:completed")

B / S / D

Create notebook / create section / delete page

u / h

Open Link Extractor modal / toggle inline href URLs

v / o / y

HD image preview / open in browser / copy page Markdown

Ctrl+F

Interactive File Picker (z for zoxide directory jump)

/

Instant full-text search across cached pages (SQLite FTS5)

Ctrl+P / Ctrl+K

Unified Command Palette & Omni-Switcher

. / Right-click

Context Menu

Ctrl+, / Ctrl+B / ?

Settings / Toggle sidebar / Keyboard shortcuts help


CLI, HTTP API & MCP

CLI

onenote notebooks --json
onenote pages "Acme Engineering/Architecture" --json
onenote rename-section 'me|SECTION_ID' --name 'Architecture Notes' --json
onenote rename-notebook --drive-id DRIVE_ID --item-id ITEM_ID --name 'Engineering Notes' --json
onenote read "Q4 Architecture RFC" --json
onenote read "Q4 Architecture RFC" --json --full
onenote copy-page 'me|PAGE_ID' --section 'me|SECTION_ID' --json
onenote create "Architecture" --title "Release Notes" '## Shipped
- [x] WAL pool' --json
onenote check "Migration Cutover" --block-id 'p:m3' --done --json
onenote search "canary" --json

onenote read PAGE --json returns compact Markdown and identifiers by default; pass --full for parsed blocks, raw XHTML, and resources. Passing an explicit --format <fmt> --json returns the full JSON page, and adding --compact selects the compact shape. Write commands (append, update, check) with --json return a compact summary (ok, page_key, title, last_modified_at, plus block_id / completed where applicable) by default; pass --full to include the full page object.

Page commands (read, append, update, check, delete) accept an optional --section (name, Notebook/Section, ID, or scoped key) to narrow title lookup to one section.

When a --json command fails at runtime, it exits 1 and writes a single JSON object ({"ok":false,"error":{"code","message"}}, plus top-level operation fields for non-completed copy-page) to stdout alongside the stderr error line. Successful read/list --json responses omit ok and signal success with exit 0; CLI argument/usage errors exit 2 on stderr without JSON.

onenote notebooks --json and onenote sections --json return 50 items by default (text output stays unbounded unless --limit is passed); pages defaults to 50 and search defaults to 30. All four JSON list responses include returned, has_more, and next_cursor, which can be passed back with --limit and --cursor to page through results. Full-text body search in onenote search covers pages that have been read or synced (cache.pages_with_body).

Use onenote read PAGE --format blocks to find a checkbox or text block's current element ID. Use --done or --undone to set a checkbox state. Omit both flags to toggle it.

onenote notebooks lists your personal notebooks, plus the notebooks of your joined Teams/Groups with --include-teams. SharePoint site notebooks are not auto-discovered; you can create one with onenote create-notebook NAME --site SITE_ID.

copy-page uses Microsoft Graph to create a new page in the destination section and preserves the original page and its links. If the copy is still pending, pass its operation_url with --operation to check the same copy. Copy a page

On Windows, desktop-set-page-level and desktop-rename-section work on existing objects in an open notebook. Use the OneNote app's Move command to move a page between sections. Hierarchy operations and permissions

Local HTTP API (onenote serve)

# Start local Axum JSON server (default 127.0.0.1:8793) with your own API key
onenote serve --token dev-secret

# Query pages & FTS5 search from scripts or agents
curl -H "Authorization: Bearer dev-secret" \
  "http://127.0.0.1:8793/v1/onenote/search?q=canary&limit=10"

The API key is required on every route except /health. Without --token (alias of --api-key) or ONENOTE_API_KEY, a loopback server generates a random key and prints it once on stderr; pass --allow-keyless to run a loopback server without one. A non-loopback --bind always needs a key. Browser pages cannot call the API unless their exact origin is listed with --cors-origin, and requests whose Host is not a loopback name, the bind address or an --allowed-host are refused. Authentication and access control

Full route reference & OpenAPI 3.1 spec: docs/API.md · docs/openapi.yaml.

Model Context Protocol (onenote mcp)

Add to Claude Desktop, Claude Code, Cursor, or Codex over stdio JSON-RPC 2.0.

{
  "mcpServers": {
    "onenote": {
      "command": "onenote",
      "args": ["mcp"]
    }
  }
}

Full tool catalog & schemas: docs/MCP.md.


@bitefoundry Enterprise Terminal Suite

Package

Commands

Workspace Coverage

@bitefoundry/teams

teams

Microsoft Teams chats, channels, threads & meetings

@bitefoundry/outlook

outlook

Microsoft Outlook mail, calendar & contacts

@bitefoundry/onenote

onenote

Microsoft OneNote notebooks, sections, pages & XHTML/Markdown

@bitefoundry/sharepoint

sharepoint, bitefoundry-onedrive

Microsoft SharePoint sites, document libraries & OneDrive files

@bitefoundry/atlassian

atlassian, confluence, conf

Atlassian Jira issues, boards, sprints & Confluence pages

@bitefoundry/notion

notion

Notion pages, databases, blocks & Markdown sync


License & Disclaimer

Licensed under the MIT License.

Unofficial terminal client for Microsoft OneNote. Not affiliated with, endorsed by, or sponsored by Microsoft Corporation.

Available Tools

18 tools
append_pageB

Append Markdown blocks and optional inline images to an existing OneNote page.

Inputs: page (required), markdown (required), compact, section, +1 more.

copy_pageA

Copy a page via Microsoft Graph and verify its new ID and section. The original page and its links stay in place. The copy runs asynchronously on the server and wait_seconds polls it. To check a pending or interrupted copy, pass its operation_url with the original page and section.

Inputs: page (required), section (required), wait_seconds, operation_url.

create_notebookC

Create a new Microsoft OneNote notebook.

Inputs: name (required), site_id, group_id.

create_pageC

Create a new OneNote page from Markdown with optional local inline image paths.

Inputs: title (required), section (required), level, markdown, +1 more.

create_sectionC

Create a new OneNote section inside a notebook.

Inputs: name (required), notebook (required).

delete_pageC

Delete a OneNote page. Requires confirm: true to prevent accidental deletion.

Inputs: page (required), confirm (required), section.

download_resourceA

Download an embedded image or file attachment from a OneNote page and return { ok, path, file_name, mime_type, size_bytes, is_image }. Downloads the full binary to disk.

Inputs: page (required), index, out_dir.

get_pageA

Read a OneNote page. Returns compact Markdown by default; pass fields (e.g. ["blocks","resources"]) to fetch specific fields without full raw_xhtml, or compact:false for everything. Fetches from Microsoft Graph unless offline:true; compact:false can be large.

Inputs: page (required), fields, compact, offline, +1 more.

list_notebooksA

List accessible Microsoft OneNote notebooks (personal + optional Teams/Group shared notebooks). Calls Microsoft Graph unless offline:true (a recent cached answer is reused only when ONENOTE_CLI_CACHE_SECS is set). include_teams adds one Graph request per joined Team, up to ONENOTE_MAX_TEAMS (default 100), and can take several seconds.

Inputs: limit, cursor, offline, refresh, +1 more.

list_pagesA

List OneNote pages inside a section (supports Notebook/Section, section name, or ID). Calls Microsoft Graph unless offline:true; the request size grows with cursor + limit.

Inputs: section (required), limit, cursor, offline, +1 more.

list_sectionsA

List OneNote sections across all notebooks or within a specific notebook. Calls Microsoft Graph unless offline:true. Without notebook it first lists every notebook, including Teams notebooks, then each notebook's sections: many requests on large accounts, so pass notebook when you can.

Inputs: limit, cursor, offline, refresh, +1 more.

rename_notebookA

Rename an existing OneDrive or SharePoint OneNote package by explicit storage IDs. Supply a token with file write permission. The returned ID is the drive item's ID.

Inputs: name (required), item_id (required), drive_id (required).

rename_sectionA

Rename an existing section under /me/onenote and verify its ID and parent after the write.

Inputs: name (required), section (required).

search_pagesA

Search cached OneNote pages via local SQLite FTS5 (onenote_fts); no network by default. refresh:true first runs a full account sync (many Graph requests, slow on large accounts), so avoid it in loops.

Inputs: query (required), limit, cursor, refresh, +1 more.

toggle_todoB

Set or toggle a OneNote checkbox by block_id or zero-based todo_index.

Inputs: page (required), force, compact, section, +4 more.

update_blockA

Replace a block with Markdown, edit a block text substring, or update the page title/body. Get current Graph element IDs and baseline content from get_page.

Inputs: page (required), force, title, compact, +6 more.

update_pageC

Alias for update_block. Update a page title or body, replace a block, or edit text within a block.

Inputs: page (required), force, title, compact, +6 more.

whoamiA

Return the currently signed-in Microsoft 365 user profile and the active auth mode.

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools target a distinct resource+action pair (notebook/section/page × list/create/rename/delete), so an agent can pick correctly in the common case. The one real overlap is update_page, which is explicitly documented as an alias for update_block, giving two names for the same operation and a redundant entry in the surface. get_page vs search_pages vs append_page are clearly differentiated by description.

    Naming Consistency4/5

    Nearly everything follows a predictable snake_case verb_noun pattern (list_pages, create_section, rename_notebook, delete_page, download_resource). The only deviation is 'whoami', which uses no verb_noun structure and stands out from the rest of the surface. There is also a slight inconsistency in that update_page and update_block differ in granularity within the same verb family.

    Tool Count4/5

    At 18 tools the set sits at the upper edge of comfortable, but the count is largely earned: three resource types needing lifecycle operations plus page-content editing (append_page, update_block, toggle_todo), search, resource download, and an auth check. The only clearly unearned slot is the update_page alias, which adds a tool without adding capability.

    Completeness4/5

    Page-level coverage is strong (create, read, append, update, copy, toggle_todo, delete, search), and notebooks/sections support list/create/rename. The gaps are delete_notebook and delete_section — no terminal operation for two of the three core resources — plus no page move, though an agent can fall back to the OneNote UI or copy+delete for those. Search being cache-only by default is also a soft limitation but is recoverable with refresh.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A pure-local Microsoft OneNote MCP server for Windows that controls the OneNote desktop app through the local OneNote COM API without needing Azure, Microsoft Graph, API keys, or OAuth.
      4
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      An MCP server that lets you talk to your OneNote notebooks, enabling search, reading, creating, and managing pages, sections, and notebooks via natural language. It connects directly to Microsoft Graph from your own computer, so your notes and credentials never leave your machine.
      13
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Enables Windows users to search and retrieve Outlook calendar appointments, tasks, and mail, as well as local/OneDrive files via Windows Search and OneNote pages, with additional OneNote page creation and update capabilities, all through MCP over stdio.
      15
      -