Logo van OneNote

OneNote

Community
purpleslurple

Complete OneNote MCP Server for Claude Desktop - Access your entire OneNote knowledge base through AI with robust authentication and full API support

Uitgeverpurpleslurple
Repositoryonenote-mcp-server
TaalPython
Forks
28
Sterren
52
Beschikbare tools
0
Transporttypestdio
Categorieën
LicentieMIT
Links
  • Koppel tools aan AI-workflows

    OneNote biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    52 sterren en 28 forks in de gekoppelde repository.

OneNote MCP Server

A complete, robust Model Context Protocol (MCP) server for Microsoft OneNote integration with Claude Desktop. Access your entire OneNote knowledge base through natural language queries.

🎯 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
  • Claude Desktop
  • Microsoft Azure account (free)

1. Install uv (if you don't have it)

bash
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# or with Homebrew
brew install uv

2. Clone and Setup

bash
git clone https://github.com/yourusername/onenote-mcp-server.git
cd onenote-mcp-server

# Create virtual environment and install dependencies
uv sync

3. Azure App Registration

You need to create an Azure app to access OneNote. Don't worry, it's free and takes 5 minutes:

  1. Go to Azure Portal (sign in with your Microsoft account)
  2. Navigate to Azure Active Directory → App registrations → New registration
  3. Fill out the form:
    • Name: "OneNote MCP Server" (or whatever you like)
    • Supported account types: "Accounts in any organizational directory and personal Microsoft accounts"
    • Redirect URI: Select "Public client/native" and enter: https://login.microsoftonline.com/common/oauth2/nativeclient
  4. Click Register
  5. Copy the Application (client) ID - you'll need this!

4. Add Permissions

Still in your Azure app:

  1. Go to API permissions → Add a permission
  2. Select Microsoft Graph → Delegated permissions
  3. Add these permissions:
    • Notes.Read - Read OneNote notebooks
    • Notes.ReadWrite - Create/modify OneNote content (optional but recommended)
    • User.Read - Read user profile
  4. Click Grant admin consent (the button at the top)

5. Configure Claude Desktop

Edit your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\\Claude\\claude_desktop_config.json

Add this configuration (replace /ABSOLUTE/PATH/TO/PARENT/FOLDER/weather with your actual path):

Basic configuration:

json
{
  "mcpServers": {
    "onenote": {
      "command": "uv",
      "args": [
        "--directory", "/FULL/PATH/TO/onenote-mcp-server",
        "run", "python", "onenote_mcp_server.py"
      ],
      "env": {
        "AZURE_CLIENT_ID": "your-azure-client-id-here"
      }
    }
  }
}

With explicit token caching control:

json
{
  "mcpServers": {
    "onenote": {
      "command": "uv",
      "args": [
        "--directory", "/FULL/PATH/TO/onenote-mcp-server",
        "run", "python", "onenote_mcp_server.py"
      ],
      "env": {
        "AZURE_CLIENT_ID": "your-azure-client-id-here",
        "ONENOTE_CACHE_TOKENS": "true"
      }
    }
  }
}

Replace /FULL/PATH/TO/onenote-mcp-server with the actual path to this project.

6. Restart Claude Desktop

Completely quit and restart Claude Desktop. You should see OneNote tools in the 🔨 menu.

🔐 First Time Authentication

  1. In Claude Desktop, say: "Start OneNote authentication"
  2. Claude will give you a URL and code
  3. Visit the URL in your browser, enter the code, and sign in
  4. Browser compatibility:
    • ✅ Firefox (tested with 139.0.4) - works perfectly
    • ❌ Safari - may have issues with Microsoft OAuth redirect
    • ✅ Chrome/Edge - should work (Microsoft's browsers)
  5. Come back to Claude and say: "Complete OneNote authentication"
  6. You're ready to go!

Token Persistence

By default, authentication tokens are cached securely on your local machine so you only need to authenticate once every few weeks/months.

To disable token caching (for security-sensitive environments):

json
{
  "mcpServers": {
    "onenote": {
      "command": "uv",
      "args": [
        "--directory", "/FULL/PATH/TO/onenote-mcp-server",
        "run", "python", "onenote_mcp_server.py"
      ],
      "env": {
        "AZURE_CLIENT_ID": "YOUR_CLIENT_ID_HERE",
        "ONENOTE_CACHE_TOKENS": "false"
      }
    }
  }
}

Token caching options:

  • ONENOTE_CACHE_TOKENS=true (default) - Tokens persist across sessions
  • ONENOTE_CACHE_TOKENS=false - Authenticate every session (more secure)

📖 Usage Examples

Once authenticated, try these commands in Claude Desktop:

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 Claude Desktop

  • Make sure you restarted Claude Desktop after config changes
  • Check that the path in your config is correct (use full absolute path)
  • 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
  • Authentication expired: Use "Check OneNote authentication status" to see token expiry
  • Clear cached tokens: Use "Clear OneNote token cache" if you need to reset authentication
  • 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
  • Make sure Claude Desktop can read the files

🏗 Development

Project Structure

onenote-mcp-server/
├── onenote_mcp_server.py      # Main server implementation
├── pyproject.toml             # Dependencies and metadata  
├── README.md                  # This file
├── LICENSE                    # MIT License
└── .gitignore                 # Git ignore rules

Key Features

  • Two-step authentication: Handles device code flow properly
  • 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:

python
@mcp.tool()
async def your_new_tool(param: str) -> str:
    """Description of what your tool does."""
    # Your implementation here
    return result

🤝 Contributing

Contributions welcome! Please:

  1. Fork the repo
  2. Create a feature branch
  3. Add tests for new functionality
  4. 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 potential of AI + personal knowledge bases

⚠️ 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 Claude + OneNote community

Turn your OneNote into an AI-accessible knowledge base!

Gebruik OneNote MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra OneNote is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg OneNote toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van OneNote.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "onenote-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van OneNote in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van OneNote in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je OneNote gebruiken om me hiermee te helpen?
OneNote
Zeker. Ik heb het gelezen.
Dit vond ik met OneNote.

Veelgestelde vragen

Waarvoor wordt de MCP-server OneNote gebruikt?

OneNote is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik OneNote MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je OneNote gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom OneNote MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als OneNote verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik OneNote MCP met TypingMind?

OneNote werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt OneNote MCP in TypingMind?

OneNote biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om OneNote MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als OneNote authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇