onenote_mcp_server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@onenote_mcp_server Create a section called 'Meeting Notes' in my Project notebook"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OneNote MCP Server
A Model Context Protocol (MCP) server that connects GitHub Copilot (and other MCP-compatible AI tools) to Microsoft OneNote for Business via the Microsoft Graph API.
Features
Tool | Description |
| List all OneNote notebooks accessible to the configured service account |
| List sections in a notebook |
| Create a new section in a notebook |
| Create a new page in a section (HTML content) |
| Update an existing page with patch commands |
| Retrieve a page's HTML content |
Related MCP server: OneNote MCP Server
Prerequisites
Node.js 18 or later
A Microsoft 365 / Office 365 work or school account
An Azure AD app registration with a client secret and application permissions (one-time setup, free, takes ~5 minutes)
Step 1 — Register an Azure AD App
This is a one-time setup. You need an Azure account that has access to your organisation's Azure AD.
Go to https://entra.microsoft.com and sign in.
Navigate to Identity → Applications → App registrations → New registration.
Fill in:
Name:
OneNote MCP Server(or any name you prefer)Supported account types: Single tenant is recommended for background-service access.
Click Register.
On the app overview page, copy:
Application (client) ID → this is your
ONENOTE_CLIENT_IDDirectory (tenant) ID → this is your
ONENOTE_TENANT_ID
Go to Certificates & secrets → New client secret and copy the secret value.
Go to API permissions → Add a permission → Microsoft Graph → Application permissions.
Add
Notes.ReadWrite.All.Click Grant admin consent for your tenant.
Step 2 — Install the MCP Server
# Clone or download this repository, then:
cd onenote-mcp-server
npm install
npm run buildStep 3 — Use from GitHub in any project (no local clone required)
After you push this repo to GitHub, you can reference it directly from MCP host configs:
{
"servers": {
"onenote": {
"command": "npx",
"args": ["-y", "github:<YOUR_GITHUB_USERNAME>/onenote_mcp_server"],
"env": {
"ONENOTE_CLIENT_ID": "your-client-id-from-step-1",
"ONENOTE_TENANT_ID": "your-tenant-id",
"ONENOTE_CLIENT_SECRET": "your-client-secret",
"ONENOTE_USER_PRINCIPAL_NAME": "service-account@yourtenant.com"
}
}
}
}Replace
<YOUR_GITHUB_USERNAME>/onenote_mcp_serverwith your actual GitHub repo path. Thepreparescript builds TypeScript automatically when the package is installed from GitHub.
Step 4 — Configure GitHub Copilot Desktop
Option A: Workspace configuration (recommended for team sharing)
Edit .vscode/mcp.json in this project (already provided) and fill in your values:
{
"servers": {
"onenote": {
"command": "node",
"args": ["/absolute/path/to/onenote-mcp-server/build/index.js"],
"env": {
"ONENOTE_CLIENT_ID": "your-client-id-from-step-1",
"ONENOTE_TENANT_ID": "your-tenant-id",
"ONENOTE_CLIENT_SECRET": "your-client-secret",
"ONENOTE_USER_PRINCIPAL_NAME": "service-account@yourtenant.com"
}
}
}
}Windows path example:
"C:\\Users\\you\\onenote-mcp-server\\build\\index.js"
Option B: User-level configuration (applies to all your workspaces)
In VS Code, open the Command Palette (Ctrl+Shift+P) → MCP: Open User Configuration, then add:
{
"servers": {
"onenote": {
"command": "node",
"args": ["/absolute/path/to/onenote-mcp-server/build/index.js"],
"env": {
"ONENOTE_CLIENT_ID": "your-client-id",
"ONENOTE_TENANT_ID": "your-tenant-id"
}
}
}
}Step 5 — Start Using the Server
The server authenticates automatically with the configured app registration and accesses OneNote for the user principal name you set in ONENOTE_USER_PRINCIPAL_NAME.
Environment Variables
Variable | Required | Default | Description |
| ✅ Yes | — | Azure AD Application (client) ID |
| ✅ Yes | — | Tenant ID for the Entra app registration |
| ✅ Yes | — | Client secret value for the app registration |
| ✅ Yes | — | User principal name whose OneNote notebooks the service accesses |
| No |
| Log verbosity: |
Usage Examples
Once configured, you can ask Copilot things like:
"List all my OneNote notebooks"
"Show me the sections in my Work notebook"
"Create a section called 'Meeting Notes' in my Project notebook"
"Create a OneNote page titled 'Sprint Planning' with a bullet list of our team goals"
"Get the content of page [ID] so I can update it"
"Add a new paragraph to the end of page [ID]"
Token Cache Location
After the service first authenticates, the token cache is stored here (never committed to git):
Platform | Location |
Windows |
|
macOS |
|
Linux |
|
The cache file is restricted to owner-only permissions (chmod 600 on Unix).
To force re-authentication, delete this file.
Security
Confidential client app — client secrets are required and kept in environment variables
Application permissions —
Notes.ReadWrite.Allvia the Graph.defaultscopeClient credentials flow — the server authenticates headlessly in the background
Tokens never logged — the
Authorizationheader and token values are never written to logsInput validation — all resource IDs are validated against a safe-ID pattern before URL interpolation
HTML sanitisation — script tags, event handlers, and dangerous URI schemes are stripped from page content
Atomic cache writes — token cache is written via temp file + rename to prevent corruption
Scopes and Permissions
The server requests Notes.ReadWrite.All as an application permission, which covers:
Reading notebooks, sections, and pages for the configured user principal name
Creating notebooks, sections, and pages
Updating pages
Admin consent is required for the app permission.
Troubleshooting
"ONENOTE_CLIENT_ID environment variable is not set"
→ Make sure ONENOTE_CLIENT_ID is set in your mcp.json env block.
"ONENOTE_CLIENT_SECRET environment variable is not set"
→ Make sure the client secret value is set in your mcp.json env block.
"ONENOTE_USER_PRINCIPAL_NAME environment variable is not set"
→ Make sure the service account UPN is set in your mcp.json env block.
"Graph API error: 403"
→ The app registration is missing Notes.ReadWrite.All, admin consent was not granted, or the configured user principal name cannot access the requested notebook.
"Graph API error: 401"
→ Delete the token cache file (listed above under "Token Cache Location") and re-authenticate.
"Request timed out"
→ Network issue connecting to graph.microsoft.com. Check your proxy/firewall settings.
Use with other MCP hosts (Claude Desktop / Cursor / others)
Any MCP host that supports stdio can use this server with the same command/env pattern:
{
"mcpServers": {
"onenote": {
"command": "npx",
"args": ["-y", "github:<YOUR_GITHUB_USERNAME>/onenote_mcp_server"],
"env": {
"ONENOTE_CLIENT_ID": "your-client-id",
"ONENOTE_TENANT_ID": "your-tenant-id",
"ONENOTE_CLIENT_SECRET": "your-client-secret",
"ONENOTE_USER_PRINCIPAL_NAME": "service-account@yourtenant.com"
}
}
}
}If your host expects servers instead of mcpServers, keep the same inner object and rename only the top-level key.
Development
# Run without building (uses tsx)
npm run dev
# Build TypeScript
npm run build
# Start the built server
npm startAPI Reference
All operations use the Microsoft Graph API v1.0 endpoints:
Operation | Endpoint |
List notebooks |
|
List sections |
|
Create section |
|
Create page |
|
Update page |
|
Get page |
|
Note: The server uses application permissions to access OneNote for the configured user principal name. Admin consent is required.
Available Tools
6 toolscreate_pageA
Create a new page in a OneNote section. The content should be HTML. Script tags and event handlers are stripped for security.
Inputs: title (required), section_id (required), html_content.
create_sectionB
Create a new section in a OneNote notebook for the configured account.
Inputs: notebook_id (required), display_name (required).
get_pageA
Get the HTML content of a OneNote page. Set include_ids=true to get element IDs needed for targeted update_page commands.
Inputs: page_id (required), include_ids.
list_notebooksA
List all OneNote notebooks accessible to the configured service account. Returns notebook IDs, names, share status, and direct links.
Inputs: no named parameters.
list_sectionsA
List all sections in a specific OneNote notebook. Use list_notebooks first to get the notebook ID.
Inputs: notebook_id (required).
update_pageA
Update an existing OneNote page by applying patch commands. Supports append, prepend, insert, replace, and delete operations on specific elements. Call get_page with include_ids=true first to obtain element IDs for precise targeting.
Inputs: page_id (required), commands (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct resource (notebooks, sections, pages) and action (list, create, get, update). No overlapping purposes; list_sections and create_section are clearly differentiated by action.
All tool names follow a consistent verb_noun pattern: list_notebooks, list_sections, create_section, create_page, update_page, get_page. No mixed conventions or vague verbs.
Six tools is well-scoped for OneNote management, covering the essential notebook/section/page hierarchy without unnecessary bloat or trivial additions.
The tool set covers the core lifecycle: read notebooks, list/create sections, and create/get/update pages. Minor gaps exist (no delete operations, no rename section), but the primary workflows are supported.
Related MCP Connectors
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that enables AI assistants to programmatically browse and interact with OneNote notebooks shared via web links through browser automation.47 npm4MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI language models like Claude to interact with Microsoft OneNote, allowing access to notebooks, creating pages, searching notes, and analyzing content directly through the AI interface.34 npm135MIT
- AlicenseCqualityDmaintenanceA Model Context Protocol server that enables AI language models like Claude to securely interact with Microsoft OneNote data, allowing for reading, writing, searching, and comprehensive editing of notebooks, sections, and pages directly through an AI interface.1314MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to read, write, and manage Microsoft OneNote notebooks, sections, and pages through OAuth-authenticated MCP tools, resources, and prompts.1647 npm5MIT