Skip to content

mikefactorial/OneNoteMCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OneNote MCP

An MCP (Model Context Protocol) server that lets an AI agent read and write Microsoft OneNote pages via the Microsoft Graph API. Authentication uses Azure AD client credentials (tenant ID, client ID, client secret).

Prerequisites

  • Node.js 18+
  • An Azure AD app registration with the following application permissions granted and admin-consented including device flows:
    • Notes.ReadWrite.All (Microsoft Graph)

Setup

1. Clone and install

npm install

2. Configure environment variables

Copy .env.example to .env and fill in your values:

Variable Description
TENANT_ID Azure AD tenant (directory) ID
CLIENT_ID App registration application (client) ID
CLIENT_SECRET Client secret created in the app registration
USER_ID UPN (user@domain.com) or object ID of the target user
PAGE_ID (Optional) Default OneNote page ID to read/write

3. Run

Development (no build step):

npm run dev

Build then run:

npm run build
npm start

VS Code MCP integration

A .vscode/mcp.json is included. Open the workspace in VS Code — it will prompt you for the credentials and launch the server automatically when an agent needs it.

Tools

Tool Description
read_note Returns the plain-text content of a OneNote page
write_note Replaces the body of a OneNote page with new plain-text content
list_pages Lists the user's OneNote pages (with optional keyword filter) to discover page IDs

read_note

Parameter Type Required Description
page_id string No OneNote page ID. Falls back to PAGE_ID env var.

write_note

Parameter Type Required Description
content string Yes Plain-text content to write
page_id string No OneNote page ID. Falls back to PAGE_ID env var.

list_pages

Parameter Type Required Description
search string No Filter pages whose title contains this string
top number No Max results to return (default 20, max 100)

Finding a Page ID

Use the list_pages tool (or Graph Explorer) to find the ID of the page you want to work with, then set it as PAGE_ID or pass it directly in each call.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors