Developer rewrites OneNote MCP server in TypeScript, exposes Microsoft Graph auth pitfalls
A developer building a OneNote integration for AI assistants like Claude and Cursor encountered persistent 401 authentication errors when using an existing JavaScript MCP server. The root cause was the use of application-level permission scopes ending in '.All', which personal Microsoft accounts cannot validly consent to, causing Graph API to silently reject tokens. The fix involved switching to delegated, resource-qualified scopes that work for both personal and work or school accounts. The developer also found that personal Microsoft accounts issue non-JWT opaque tokens, meaning any code that validates token format by checking for JWT structure will incorrectly reject them. After resolving the auth issues, a full TypeScript rewrite was undertaken, replacing roughly ten overlapping scripts with a modular architecture using Zod-typed tools and removing 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