A Model Context Protocol server that integrates with Microsoft OneNote through Microsoft Graph API, allowing Claude and other LLMs to create, manage, and interact with OneNote notebooks, sections, and pages.
- 📓 Notebook Management: Create, list, get, and delete OneNote notebooks
- 📑 Section Management: Create, list, get, and delete sections within notebooks
- 📄 Page Management: Create, list, get, update, and delete OneNote pages
- 🔍 Content Search: Search for pages containing specific text across notebooks
- 📋 Page Operations: Copy pages between sections and retrieve page content
- 🔧 Environment Defaults: Support for default notebook and section configuration
- 🔁 Model Context Protocol: Follows MCP standards for LLM tool integration
- 🛡️ Type Safety: Full TypeScript implementation with Zod validation
- Node.js 18+
- Microsoft 365 account with appropriate permissions
- Microsoft Azure App Registration with Graph API permissions (OneNote)
-
Register an application in Azure Active Directory:
-
Go to Azure Portal
-
Navigate to "App registrations"
-
Create a new registration with a redirect URI of type "Public client/native (mobile & desktop)"
- Register
http://localhostas the redirect URI
- Register
-
Configure API permissions:
- Choose Microsoft Graph and type delegated, as we will act on the users behalf
- For OneNote: "Notes.ReadWrite" and "Notes.Read"
- For User Profile: "User.Read"
-
-
Note the values from your Azure app registration (Overview) to use for the MCP config as environment variables:
- Client ID (Application (client) ID)
- Authority ID (Directory (tenant) ID)
- Register the MCP server
For Claude Desktop, create or update your configuration in
~/.claude/config.json:
{
"mcpServers": {
"onenote": {
"command": "npx",
"args": [
"mcp_onenote"
],
"env": {
"AUTHORITY": "your-authority-id",
"CLIENT_ID": "your-client-id",
"MCP_SERVER_NAME": "onenote-mcp",
"MCP_SERVER_VERSION": "1.0.0",
"ONENOTE_DEFAULT_NOTEBOOK": "My Notebook",
"ONENOTE_DEFAULT_SECTION": "Quick Notes"
}
}
}
}Make sure to replace the path and environment variables with your actual values.
AUTHORITY: Azure tenant IDCLIENT_ID: Azure application (client) IDONENOTE_DEFAULT_NOTEBOOK: Default notebook name or ID (optional)ONENOTE_DEFAULT_SECTION: Default section name or ID (optional)
- listNotebooks: Lists all notebooks accessible to the user
- createNotebook: Creates a new notebook
- getNotebook: Gets details of a specific notebook
- deleteNotebook: Deletes a notebook
- listSections: Lists sections in a notebook
- createSection: Creates a new section in a notebook
- getSection: Gets details of a specific section
- deleteSection: Deletes a section
- listPages: Lists pages in a section
- createPage: Creates a new page in a section
- getPage: Gets details of a specific page
- getPageContent: Gets the HTML content of a page
- updatePage: Updates the content of a page
- deletePage: Deletes a page
- copyPage: Copies a page to another section
- searchPages: Searches for pages containing specific text
- notebooks: Resource containing all notebooks data
- sections: Resource containing all sections data
- pages: Resource containing all pages data
- default-notebook: Resource containing the default notebook information
- default-section: Resource containing the default section information
The default resources provide easy access to the configured default notebook and section. If environment variables ONENOTE_DEFAULT_NOTEBOOK and ONENOTE_DEFAULT_SECTION are set, these will be used. Otherwise, the system will attempt to find the default notebook (marked as default in OneNote) and the first section within it.
Run in development mode with live reloading:
npm run dev
Run linting:
npm run lint
Build the project:
npm run build
Configure your MCP locally for development:
{
"mcpServers": {
"onenote": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/onenote_mcp/build/index.js"
],
"env": {
"AUTHORITY": "your-authority-id",
"CLIENT_ID": "your-client-id",
"MCP_SERVER_NAME": "onenote-mcp",
"MCP_SERVER_VERSION": "1.0.0",
"ONENOTE_DEFAULT_NOTEBOOK": "My Notebook",
"ONENOTE_DEFAULT_SECTION": "Quick Notes"
}
}
}
}// Create a page in the default section
await createPage({
title: "Meeting Notes",
content: "<h1>Meeting Notes</h1><p>Discussion points...</p>"
});
// Create a page in a specific section
await createPage({
title: "Project Plan",
content: "<h1>Project Plan</h1><ul><li>Task 1</li><li>Task 2</li></ul>",
sectionId: "0-A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0"
});// Search across all notebooks
await searchPages({
searchTerm: "project timeline"
});
// Search within a specific notebook
await searchPages({
searchTerm: "meeting",
notebookId: "0-A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0"
});This server uses the following Microsoft Graph API endpoints:
/me/onenote/notebooks- Notebook operations/me/onenote/sections- Section operations/me/onenote/pages- Page operations/me/onenote/pages/{id}/content- Page content operations
ISC