Local OneNote MCP

Local OneNote MCP

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.

Category
访问服务器

README

Local OneNote MCP

A high-performance, local Microsoft OneNote MCP server for Windows. It controls the OneNote desktop app directly through the local OneNote COM API—requiring no Azure, Microsoft Graph, API keys, or online OAuth.


Design & Architecture

  • Local-Only Boundary: Every operation executes directly through the local OneNote desktop installation. No data ever leaves your computer.
  • COM-First Engineering: No direct binary .one file manipulation. All writes and reads leverage OneNote’s native COM engine, ensuring maximum data integrity and sync compatibility.
  • Safe Execution Bridge: Inputs are passed safely through JSON-based temp files, completely avoiding PowerShell string interpolation or risk of command injections.
  • Rich Interaction Surface: Full CRUD capabilities for notebooks, section groups, sections, pages, sync, and raw XML manipulation.

Design Note: PowerShell is leveraged as a reliable COM bridge because certain Windows/Office environments expose the OneNote COM interfaces directly to PowerShell while leaving them unavailable or restricted to Python's traditional automation libraries.


Requirements

  • Windows 10 / 11
  • Microsoft OneNote Desktop App (Traditional version; not the legacy Windows 10 UWP app)
  • Python 3.11+
  • Node.js & npm (Required for the standard global launcher)
  • OneMore Desktop Add-in (Optional — only required to enable rich Markdown compilation)

Verify your system environment:

node -v
npm -v
python --version

Quick Start (Recommended)

1. Install the global launcher

Open PowerShell and run:

npm install -g github:Peteroooooooo/local-onenote-mcp

(Once published on the npm registry, you will be able to install it using: npm install -g local-onenote-mcp)

2. Configure your MCP Client

Claude Desktop

Add this to your %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "local-onenote": {
      "command": "local-onenote-mcp",
      "env": {
        "LOCAL_ONENOTE_MCP_TIMEOUT": "90",
        "LOCAL_ONENOTE_MCP_MAX_TEXT_CHARS": "60000"
      }
    }
  }
}

Codex / Cursor (TOML)

Add this to your configuration:

[mcp_servers.local-onenote]
type = "stdio"
command = "local-onenote-mcp"
startup_timeout_ms = 120000

[mcp_servers.local-onenote.env]
LOCAL_ONENOTE_MCP_TIMEOUT = "90"
LOCAL_ONENOTE_MCP_MAX_TEXT_CHARS = "60000"

Restart your MCP client. Upon first execution, the launcher automatically creates a local Python virtual environment, installs the required packages, and hosts the stdio channel.


Alternative Installation Options

Option A: Modern Python Toolchains (No npm required)

If you prefer pure-Python execution, you can configure your MCP client to invoke the server via standard Python package runners.

Using uvx (Ultra-fast, ephemeral execution)

[mcp_servers.local-onenote]
type = "stdio"
command = "uvx"
args = [
  "--from",
  "git+https://github.com/Peteroooooooo/local-onenote-mcp",
  "local-onenote-mcp"
]
startup_timeout_ms = 120000

Using pipx (Isolated user-space CLI)

pipx install git+https://github.com/Peteroooooooo/local-onenote-mcp

Then configure:

[mcp_servers.local-onenote]
type = "stdio"
command = "local-onenote-mcp"
startup_timeout_ms = 120000

Option B: Local Cloning & Active Development

To contribute or run the server from source:

  1. Clone the repository:
    git clone https://github.com/Peteroooooooo/local-onenote-mcp
    cd local-onenote-mcp
    
  2. Build the Python Virtual Environment:
    python -m venv .venv
    .\.venv\Scripts\python.exe -m pip install -e .
    
  3. Configure your Client to use the local dev build:
    {
      "mcpServers": {
        "local-onenote-dev": {
          "command": "C:\\path\\to\\local-onenote-mcp\\.venv\\Scripts\\python.exe",
          "args": ["-m", "local_onenote_mcp.server"],
          "env": {
            "LOCAL_ONENOTE_MCP_TIMEOUT": "90",
            "LOCAL_ONENOTE_MCP_MAX_TEXT_CHARS": "60000"
          }
        }
      }
    }
    
  4. Validate local configurations:
    .\.venv\Scripts\python.exe scripts\check_codex_config.py
    

OneMore & Markdown Integration

💡 Crucial Note on Optionality & Power:

  • 100% Optional: The OneMore desktop add-in is not a hard dependency. Without it, the server operates fully, allowing complete notebook hierarchy discovery, search, page reads, exports, navigation, and page creation/modification using plain text or raw HTML.
  • A Formatting Powerhouse: If installed, it unlocks a massive productivity boost. It binds to OneMore's high-performance .NET Markdig rendering pipeline. This lets AI agents write in standard, clean Markdown (including bold, italics, code snippets with styling, bulleted/numbered lists, headers, and blockquotes) and automatically converts them into perfectly formatted, native OneNote components and structured tables.

The server achieves this by querying and binding directly to OneMore's native Markdig.Signed.dll via the Windows Registry or standard program paths:

  • C:\Program Files\River\OneMoreAddIn\Markdig.Signed.dll
  • C:\Program Files (x86)\River\OneMoreAddIn\Markdig.Signed.dll

If installed in a custom location, specify the path in your configuration variables:

[mcp_servers.local-onenote.env]
LOCAL_ONENOTE_MARKDIG_DLL = "C:\\path\\to\\Markdig.Signed.dll"

API & Tool Directory

The server exposes 30+ comprehensive endpoints grouped into four logical categories:

1. Discovery & Content Inspection

  • health_check: Get server version, python location, and active features.
  • list_notebooks / list_sections / list_pages / list_hierarchy: Traverse the live OneNote structure.
  • get_page / get_page_text / get_page_xml: Extract page content as plain text, parsed JSON, or raw XML.
  • get_page_objects / get_binary_content: Query and extract sub-elements (like tables, images, ink, or file attachment payloads).
  • search_pages: Search live text. Supports real-time offline scan (include_unindexed=true) or indexing searches.

2. Creation & Structural Edits

  • open_hierarchy / create_notebook / create_section / create_section_group
  • create_page: Create formatted pages via plain, html, or markdown.
  • update_page_title / append_to_page / replace_page_body
  • add_image_to_page: Add local images. Automatically infers native dimensions if only width or height is provided.

3. File & App Control

  • publish_object: Export any notebook, section, or page to local PDF files.
  • navigate_to / navigate_to_url: Instantly focus and jump the desktop UI to specific elements.
  • sync_hierarchy: Trigger background or immediate synchronization of specific notebooks.
  • close_notebook / merge_sections / set_filing_location

4. Raw Low-Level Control

  • update_page_xml / update_hierarchy_xml: Execute direct, high-performance edits on OneNote's raw underlying XML schemas.

Identifier Resolution Protocol: When querying folders or items, the server sequentially tries to resolve identifiers in this priority:

  1. Exact OneNote Object GUID (Recommended for automation)
  2. Relative Hierarchy Path (e.g., Personal/Quick Notes/My Section)
  3. Unique display name

Verification & Smoke Tests

Ensure everything is configured and operating as expected before starting:

# 1. Run a read-only discovery verification
.\.venv\Scripts\python.exe scripts\smoke_mcp.py

# 2. Run a full write/read/search verification cycle
.\.venv\Scripts\python.exe scripts\smoke_mcp.py --notebook "MyNotebook" --section "MyNotebook/General" --export-dir tmp

Prompt Engineering & Markdown Example

Here is a typical markdown format that can be generated dynamically:

# Project Launch Checklist

- **Project:** Triton Migration
- **Target Date:** 2026-07-01

## Immediate Tasks
- Define system architecture layout.
- Finalize local security boundary reviews.

## Roadmap & Milestones
| Milestone | Responsibility | Status |
| --- | --- | --- |
| Beta Deploy | Infrastructure | **In Progress** |
| Production Cutover | Operations | Pending |

Limits & Boundaries

This server relies on the Windows COM API. While it excels at handling local/offline notebooks with speeds exceeding the Microsoft Graph Cloud API, it is restricted to single-user local contexts and Windows-native environments.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选