OneNote MCP Server
A Model Context Protocol (MCP) server implementation that enables AI language models like Claude and other LLMs to interact with Microsoft OneNote.
This project is based on azure-onenote-mcp-server by Zubeid Hendricks, with modifications to simplify authentication and improve usability.
What Does This Do?
This server allows AI assistants to:
- Access your OneNote notebooks, sections, and pages
- Create new pages in your notebooks
- Search through your notes
- Read complete note content, including HTML formatting and text
- Analyze and summarize your notes directly
All of this happens directly through the AI interface without you having to switch contexts.
Using with AI Assistants
Setup for Cursor
- Clone this repository and follow the installation steps below
- Start the MCP server:
npm start
- Register the server in Cursor:
- Open Cursor preferences (Cmd+, on Mac or Ctrl+, on Windows)
- Go to the "MCP" tab
- Add a new MCP server with these settings:
- Name:
onenote
- Command:
node
- Args:
["/path/to/your/onenote-mcp.mjs"]
(use absolute path)
- Name:
Here's the complete JSON configuration example:
Copy - Restart Cursor
- In Cursor, you can now interact with your OneNote data using natural language:
The first time you ask about OneNote, the AI will guide you through the authentication process.
Setup for Claude Desktop (or other MCP-compatible assistants)
- Clone this repository and follow the installation steps below
- Start the MCP server:
npm start
- In the Claude Desktop settings, add the OneNote MCP server:
- Name:
onenote
- Command:
node
- Args:
["/path/to/your/onenote-mcp.mjs"]
(use absolute path)
JSON configuration example:
Copy - Name:
- You can now ask Claude to interact with your OneNote data
Features
- Authentication with Microsoft OneNote using device code flow (no Azure setup needed)
- List all notebooks, sections, and pages
- Create new pages with HTML content
- Read complete page content, including HTML formatting
- Extract text content for AI analysis and summaries
- Summarize content of all pages in a single operation
- Read full content of all pages in a readable format
- Search across your notes
Installation
Prerequisites
- Node.js 16 or higher (install from nodejs.org)
- An active Microsoft account with access to OneNote
- Git (install from git-scm.com)
Step 1: Clone the Repository
Step 2: Download the TypeScript SDK
This project requires the MCP TypeScript SDK, which needs to be downloaded separately:
Step 3: Install Project Dependencies
Step 4: Start the MCP Server
This will start the MCP server, and you'll see a message:
Step 5: Authenticate Through Your AI Assistant
Once the server is running, you can authenticate directly through your AI assistant:
- In Cursor, Anthropic's Claude Desktop, or any MCP-compatible assistant, ask to authenticate with OneNote:Copy
- The AI will trigger the authentication flow and provide you with:
- A URL (typically microsoft.com/devicelogin)
- A code to enter
- Go to the URL, enter the code, and sign in with your Microsoft account
- After successful authentication, you can start using OneNote with your AI assistant
Available MCP Tools
Once authenticated, the following tools are available for AI assistants to use:
Tool Name | Description |
---|---|
authenticate | Start the Microsoft authentication flow |
listNotebooks | Get a list of all your OneNote notebooks |
getNotebook | Get details of a specific notebook |
listSections | List all sections in a notebook |
listPages | List all pages in a section |
getPage | Get the complete content of a specific page, including HTML formatting |
createPage | Create a new page with HTML content |
searchPages | Search for pages across your notebooks |
Example Interactions
Here are some examples of how you can interact with the OneNote MCP through your AI assistant:
Advanced: Direct Script Usage
For testing or development purposes, you can also use the provided scripts directly:
Troubleshooting
Authentication Issues
- If authentication fails, make sure you're using a modern browser without tracking prevention
- Try clearing browser cookies and cache
- If you get "expired_token" errors, restart the authentication process
Server Won't Start
- Verify Node.js is installed (version 16+):
node --version
- Make sure all dependencies are installed:
npm install
- Check that the TypeScript SDK was built correctly
AI Can't Connect to the Server
- Ensure the MCP server is running (
npm start
) - Check your AI assistant's settings to make sure it's configured to use MCP
- For Cursor, make sure it's the latest version that supports MCP
Security Notes
- Authentication tokens are stored locally in
.access-token.txt
- Tokens grant access to your OneNote data, so keep them secure
- Tokens expire after some time, requiring re-authentication
- No Azure setup or API keys are required
Credits
This project builds upon the azure-onenote-mcp-server by Zubeid Hendricks, with a focus on simplifying the authentication process and improving the user experience with AI assistants.
License
This project is licensed under the MIT License - see the LICENSE file for details
This server cannot be installed
A 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.