Skip to content

Commit b0f9255

Browse files
fix: add 'invalid_target' to AuthorizationErrorCode (RFC 8707)
RFC 8707 §2 defines 'invalid_target' as the error code for resource indicator mismatches. Without it, AuthorizeError(error='invalid_target') triggers a pydantic ValidationError instead of an OAuth-compliant response. Fixes #2641
1 parent f475344 commit b0f9255

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/mcp/server/auth/provider.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class RegistrationError(Exception):
6464
"invalid_scope",
6565
"server_error",
6666
"temporarily_unavailable",
67+
"invalid_target", # RFC 8707 §2 — resource indicator mismatch
6768
]
6869

6970

0 commit comments

Comments
 (0)