Developer rewrites OneNote MCP server in TypeScript, exposes Microsoft Graph auth pitfalls
A developer attempting to connect OneNote to AI assistants like Claude via the Model Context Protocol (MCP) encountered persistent 401 authentication errors after using an existing JavaScript MCP server. The root cause was that the original server requested application-level permission scopes ending in '.All', which Microsoft silently rejects for personal accounts despite issuing a token. Switching to delegated, resource-qualified scopes resolved the issue and enabled compatibility with both personal and work accounts. The developer also noted that personal Microsoft accounts return non-JWT opaque tokens, meaning any code that validates JWT format will incorrectly reject valid tokens. Following these fixes, the entire server was rewritten in TypeScript with a modular structure, Zod-typed tool schemas, and removal of unnecessary dependencies.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in