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).
- 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)
npm installCopy .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 |
Development (no build step):
npm run devBuild then run:
npm run build
npm startA .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.
| 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 |
| Parameter | Type | Required | Description |
|---|---|---|---|
page_id |
string | No | OneNote page ID. Falls back to PAGE_ID env var. |
| 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. |
| 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) |
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.