Obsidian MCP server returns 40101 "Authorization required" — missing Accept header fix
Using obsidian-mcp-server v2.0.7 with the Obsidian Local REST API plugin v3.2.0 on Obsidian v1.8.10, the MCP server fails to load its tools even though the API key and URL are configured correctly. The Local REST API returns {"message": "Authorization required.", "errorCode": 40101}. Why does this happen, and how do I fix it?
Originally asked on GitHub: https://github.com/cyanheads/obsidian-mcp-server/issues/16
4 answers
Fixed in v3 of obsidian-mcp-server. The maintainer verified the fix in the v3 rewrite, closed the issue, and named v3.1.7 as the latest release at that time.
The reporter found via curl that the Local REST API requires an explicit
Acceptheader alongside the bearer token:bash# Works curl -H "Authorization: Bearer YOUR_API_KEY" -H "Accept: application/json" http://127.0.0.1:27123/vault/ # Fails with {"message": "Authorization required.", "errorCode": 40101} curl -H "Authorization: Bearer YOUR_API_KEY" http://127.0.0.1:27123/vault/The maintainer explained that the 40101 "Authorization required" response is misleading: it is a content-negotiation rejection, not a token problem. The reporter suspected the v2.0.7 server was not sending the header; no configuration workaround existed on 2.x.
The v3.0 rewrite (PR #39) replaced the HTTP client in
ObsidianService. It now sends an explicitAcceptheader on every read:text/markdownfor content reads,application/vnd.olrapi.note+jsonfor structured note JSON, andapplication/vnd.olrapi.document-map+jsonfor the document map.Upgrade the
obsidian-mcp-servernpm package to v3.1.7 to get the fix.General advice: the bearer token grants full API access to your vault, so avoid committing it to version control or pasting it into shared logs.
Did this work for you?What a GitHub user tried on GitHub (Worked)
Reporter tested the Local REST API directly with curl against http://127.0.0.1:27123/vault/: sending the bearer token with -H "Accept: application/json" worked, while omitting the header returned the 40101 error. This diagnostic confirmed the missing header as the suspected root cause, not a fix for the MCP server itself.
Source: https://github.com/cyanheads/obsidian-mcp-server/issues/16 (opens external site)
Did this work for you?What @cyanheads tried on GitHub (Outcome unclear)
Maintainer rewrote the HTTP client in the v3.0 rewrite (PR #39) so every Local REST API request sets an explicit Accept header (text/markdown for content reads, JSON variants for structured reads), released v3.1.7, and asked the reporter to try it.
Did this work for you?What @cyanheads tried on GitHub (Worked)
Maintainer verified the fix in v3 and closed the issue, listing the explicit Accept headers now sent for content reads, structured note JSON, and document map operations.
Did this work for you?
Related questions
- Fix 'SSL certificate verification failed' (DEPTH_ZERO_SELF_SIGNED_CERT) in obsidian-mcp-server on Windows
- How do I fix obsidian-mcp-server initialize timeout with Claude for Desktop on Windows?
- How can I tell if obsidian_append_to_note created a file or appended to an existing one?
- How do I search Obsidian notes by created or modified date in obsidian-mcp-server?
- Fix 'Unsupported protocol version: 2025-03-26' in obsidian-mcp-server