MCP Server for OneNote Integration
The Model Context Protocol (MCP) server enables AI assistants to interact with Microsoft OneNote for reading, creating, and managing notebooks, sections, and pages.
Details
Description
The MCP server provides seamless integration capabilities between AI models and Microsoft OneNote. Built on Node.js and TypeScript, the server uses the Microsoft Graph API for communication and MSAL for authentication. It offers tools for note-taking automation, content creation, and HTML-to-text conversions, compatible with Docker for containerized deployment. MCP unlocks the potential of AI-driven workflows within productivity applications.
Features
- Authentication via MSAL with device code flow
- Tools for reading and creating content in OneNote
- Token caching for streamlined authentication
- Docker compatibility for deployment
- Integration with Microsoft Graph API for communication
- Built-in support for RAG operations with HTML-to-text conversion
Running Instructions
Installation
- Clone the repository.
git clone https://github.com/rajvirtual/MCP-Servers/tree/master/onenote
- Install dependencies:
npm install
- Create a
.env.local
file with your Azure client ID:
CLIENT_ID=your-client-id-from-azure
Development
Run the application in development mode:
npm run dev
Building
Compile TypeScript to JavaScript:
npm run build
Running
Run the compiled application:
npm start
Docker Instructions
- Create a data directory for persistence:
mkdir -p data
- Build the Docker image:
docker build -t onenote-mcp-server .
- Run the container:
docker run -d \
--name onenote-mcp-server \
-e CLIENT_ID=your-client-id \
-v $(pwd)/data:/app/dist \
onenote-mcp-server
- Authentication:
Check the device code file within the container:
cat data/device-code.txt
Visit the given URL and enter the code to authenticate. Tokens are cached in data/token-cache.json
for future use.
Tools
MCP Tools
- **onenote-read**: Reads content from notebooks, sections, or pages. Parameters include `pageId`, `sectionId`, `notebookId`, `includeContent`, and `includeMetadata`. - **onenote-create**: Creates new content, including notebooks, sections, or pages. Parameters include `type`, `title`, `content`, and `parentId`.
Use Cases
- Automating note-taking workflows
- Enabling AI-driven search and retrieval operations within OneNote
- Contextual assistance for summarization and editing of OneNote content
- Creating structured notes programmatically
- Integrating AI for content generation within OneNote notebooks
Frequently Asked Questions
No frequently asked questions available.