OneNote-MCP-For-GeminiSpark
Enables Google Gemini to interact with Microsoft OneNote, allowing AI agents to list notebooks, sections, and pages, and read page content for analysis and search.
Click on "Install 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-For-GeminiSparkList my OneNote notebooks"
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-For-GeminiSpark
A robust Model Context Protocol (MCP) server for Microsoft OneNote integration with Gemini Spark. This repository contains code, configuration, and examples to synchronize OneNote content with GeminiSpark workflows, export OneNote notes into GeminiSpark-ready formats, and demonstrate common automation scenarios.
šÆ What This Does
Transform your OneNote notebooks into an AI-accessible knowledge base:
List all your notebooks, sections, and pages
Read page content for analysis and search
Natural language queries like "Show me my DevOps notes" or "Find pages about project planning"
Secure OAuth authentication with Microsoft Graph API
Bulletproof error handling with detailed debugging
⨠Why This Implementation
Unlike other OneNote MCP servers, this one:
ā Actually works - tested extensively with real OneNote data
ā Complete functionality - all core OneNote operations implemented
ā Robust authentication - two-step device flow that handles edge cases
ā Production ready - proper error handling and logging
ā Easy setup - detailed instructions for non-technical users
š Quick Start
Prerequisites
Python 3.10+
uv package manager (recommended) or pip
Google Gemini Account
Microsoft Azure account (free)
1. Install uv (if you don't have it)
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# or with Homebrew
brew install uv2. Clone and Setup
git clone https://github.com/yourusername/onenote-mcp-server.git
cd onenote-mcp-server
# Create virtual environment and install dependencies
uv sync3. Azure App Registration
You need to create an Azure app to access OneNote. Don't worry, it's free and takes 5 minutes:
Go to Azure Portal (sign in with your Microsoft account)
Navigate to Azure Active Directory ā App registrations ā New registration
Fill out the form:
Name: "OneNote MCP Server" (or whatever you like)
Supported account types: "Accounts in any organizational directory and personal Microsoft accounts"
Click Register
Copy the Application (client) ID - you'll need this!
4. Add Permissions
Still in your Azure app:
Go to API permissions ā Add a permission
Select Microsoft Graph ā Delegated permissions
Add these permissions:
Notes.Read- Read OneNote notebooksNotes.ReadWrite- Create/modify OneNote content (optional but recommended)User.Read- Read user profileOffline.access- Permit Refresh Token Access
Click Grant admin consent (the button at the top)
Go to Manifest -> Update signInAudience to AzureADandPersonalMicrosoftAccount and requestedAccessTokenVersion to 2 and Save.
5. Generate Azure Refresh Token (One Time Activity)
Update Azure Client ID in refresh_token.py file and run it on cmd.
Browser window will open. Login with your Microsoft ID.
Post successful login, Token will be generated in cmd.
6. Deploy MCP Server on Cloud/Locally
e.g. for Google Cloud Deployment run following command.
gcloud run deploy onenote-mcp-server --source . --region us-central1 --set-env-vars="AZURE_REFRESH_TOKEN=YOUR_AZURE_REFRESH_TOKEN,AZURE_CLIENT_ID=YOUR_ACTUAL_CLIENT_ID" --allow-unauthenticatedPost Deployment MCP Server URL will be generated.
7. Setup Custom Connected App in Gemini Spark
Click on Connected Apps
Fill MCP Server URL/sse (Do not forget to add /sse at the of the URL)
In Advance Settings -> Fill Azure Client ID
Click on Copy Redirect URI and Go to Azure Portal --> Azure Client App --> Authentication --> Redirect URIs --> Add URI --> Web --> Paste the Copied Link --> Remove any other Redirect URIs
On the Connected App Dialog box -> Click next and Follow screens.
Onenote Mcp server will be created in Connected App Screen
Usage
Once Connected App is setup, try these tasks in Gemini Spark :
List my OneNote notebooks
Show me sections in my Work notebook
What pages are in my Ideas section?
Read the content of my "Project Plan" pageš Troubleshooting
"No tools available" in Gemini Spark Connected Apps Screen
Make sure you copied redirect URI from Screen and updated on Microsoft Azure App correctly.
Check if your cloud deployment of MCP server is enabled for unauthenticated access.
Verify uv is installed:
uv --version
Authentication issues
Safari OAuth problems: Safari may not handle Microsoft's OAuth redirect properly - use Firefox or Chrome instead
"nativeclient" prompts: Normal Microsoft OAuth behavior, but if it blocks authentication, try a different browser
Recommended browsers: Firefox (confirmed working), Chrome, or Edge for best compatibility
"Command not found" errors
Make sure uv is in your PATH
Alternative: replace
"uv"with"python"in the config and use the full path to your Python interpreter
Permission denied errors
Check the file permissions in your project directory
š Development
Project Structure
onenote-mcp-server/
āāā onenote_mcp_server.py # Main server implementation
āāā pyproject.toml # Dependencies and metadata
āāā refresh_token.py # Generate Refresh Token
āāā README.md # This file
āāā LICENSE # MIT License
āāā .gitignore # Git ignore rulesKey Features
Complete Graph API integration: All OneNote operations supported
Robust error handling: Detailed logging and graceful failures
FastMCP framework: Clean, maintainable code structure
Environment variable configuration: Secure credential handling
Adding New Features
The server is built with FastMCP, making it easy to add new tools:
if method == "tools/list":
await custom_send({"type": "http.response.start", "status": 200, "headers": [(b"content-type", b"application/json")]})
tools = [
# Your implementation here
return š¤ Contributing
Contributions welcome! Please:
Fork the repo
Create a feature branch
Add tests for new functionality
Submit a pull request
š License
MIT License - see LICENSE file for details.
š Acknowledgments
Built with FastMCP framework
Uses Microsoft Graph API for OneNote access
Inspired by the amazing work of purpleslurple
ā ļø Important Notes
This server only reads/writes data you already have access to
Your Azure app credentials stay on your machine
All authentication happens directly between you and Microsoft
No data is sent to third parties
Built with ā¤ļø for the Gemini Spark + OneNote community
Turn your OneNote into an AI-accessible knowledge base!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
MCP-native open-source Notion alternative: read & write pages, databases and kanban boards.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/abhivishwa2/OneNote-MCP-For-GeminiSpark'
If you have feedback or need assistance with the MCP directory API, please join our Discord server