EO

eshlon/onenotemcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

14 stars 13 forks 质量 73 趋势 20MIT

OneNote MCP Server

概览

The OneNote MCP Server is a powerful Model Context Protocol (MCP) server that enables AI language models (LLMs) like Claude, and other AI assistants, to securely interact with your Microsoft OneNote data. It allows for reading, writing, searching, and comprehensive editing of your OneNote notebooks, sections, and pages directly through your AI interface. This server provides a rich set of tools for advanced OneNote management, including robust text extraction, HTML content processing, and fine-grained page manipulation. * Secure device code flow for Microsoft Graph API access. * * List notebooks, sections, and pages. * Search pages by title. * Get page content in various formats (full HTML, readable text, summary). * * Create new OneNote pages with custom HTML or markdown content. * Update entire page content, preserving or replacing the title. * Append content to existing pages with optional timestamps and separators. * Update page titles.

README

以下为原文 README 节选,完整内容请查看原文。

OneNote MCP Server

The OneNote MCP Server is a powerful Model Context Protocol (MCP) server that enables AI language models (LLMs) like Claude, and other AI assistants, to securely interact with your Microsoft OneNote data. It allows for reading, writing, searching, and comprehensive editing of your OneNote notebooks, sections, and pages directly through your AI interface.

This server provides a rich set of tools for advanced OneNote management, including robust text extraction, HTML content processing, and fine-grained page manipulation.

Features

  • Authentication: Secure device code flow for Microsoft Graph API access.
  • Read Operations:
    • List notebooks, sections, and pages.
    • Search pages by title.
    • Get page content in various formats (full HTML, readable text, summary).
  • Write & Edit Operations:
    • Create new OneNote pages with custom HTML or markdown content.
    • Update entire page content, preserving or replacing the title.
    • Append content to existing pages with optional timestamps and separators.
    • Update page titles.
    • Find and replace text within pages (case-sensitive or insensitive).
    • Add formatted notes (like callouts or todos) to pages.
    • Insert structured tables into pages from CSV data.
  • Advanced Content Processing:
    • Sophisticated HTML to readable text extraction.
    • Markdown-to-HTML conversion for page content.
  • Robust Input Validation: Uses Zod for defining and validating tool input schemas.

Prerequisites

  • Node.js: Version 18.x or later is recommended. (Install from nodejs.org)
  • npm: Usually comes bundled with Node.js.
  • Git: For cloning the repository. (Install from git-scm.com)
  • Microsoft Account: An active Microsoft account with access to OneNote.
  • Azure Application Registration (Recommended for Production/Shared Use):
    • While the server defaults to using the Microsoft Graph Explorer’s public Client ID for easy testing, for regular or shared use, it is strongly recommended to create your own Azure App Registration.
    • Ensure your app registration has the following delegated Microsoft Graph API permissions: Notes.Read, Notes.ReadWrite, Notes.Create, User.Read.
    • You will need the “Application (client) ID” from your app registration.

Installation

  1. Clone the Repository:

    git clone https://github.com/[your-github-username]/onenote-ultimate-mcp-server.git
    cd onenote-ultimate-mcp-server
    

    (Replace [your-github-username]/onenote-ultimate-mcp-server with your actual repository URL)

  2. Install Dependencies:

    npm install
    

Configuration

  1. Azure Client ID:
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "onenote": { "command": "node", "args": ["/full/path/to/your/onenote-ultimate-mcp-server/onenote-mcp.mjs"], "env": { // Recommended: Set AZURE_CLIENT_ID here if not set globally "AZURE_CLIENT_ID": "YOUR_AZURE_APP_CLIENT_ID_HERE" } } } }