[BUG] MCP client doesn't automatically handle `-32001` insufficient scope errors per specification
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Summary
According to the MCP specification for Runtime Insufficient Scope
Errors, when a tool
returns a -32001 error code indicating insufficient OAuth scope, the MCP client should automatically detect this and re-initiate the
authorization flow.
Claude Code currently does not handle this automatically, requiring users to manually reconnect via /mcp to grant additional
permissions.
## Current Behavior
When an MCP tool returns an insufficient scope error:
```json
{
"error": {
"code": -32001,
"message": "Insufficient scope: This tool requires additional permissions for account acct_xxx. Please reauthorize with <scope_name>
scope."
}
}
Claude Code displays the error but does not automatically trigger reauthorization. The assistant must either:
- Manually call a reauthorization tool (if available)
- Instruct the user to run /mcp to reconnect
What Should Happen?
Expected Behavior
Per the MCP spec, the client should:
- Detect the -32001 error code
- Automatically re-initiate the OAuth authorization flow
- Prompt the user to grant the additional scopes
- Retry the operation once reauthorization completes
- MCP server: OAuth-enabled MCP server
Error Messages/Logs
MCP Specification Reference
https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#runtime-insufficient-scope-errors
Steps to Reproduce
Reproduction Steps
- Connect to an MCP server with OAuth support
- Authorize with limited scopes for a specific resource
- Attempt to call a tool that requires additional permissions
- Observe that a -32001 error is returned
- Note that no automatic reauthorization flow is triggered
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.39 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗