OAuth Endpoints
email-connector implements a complete OAuth 2.0 authorization server with PKCE support.Server Metadata
Discover all OAuth endpoints via RFC 8414.Authorization
Start the OAuth flow. Claude opens this in a browser popup.| Parameter | Required | Description |
|---|---|---|
client_id | Yes | OAuth client ID |
redirect_uri | Yes | Must be in the allowlist |
response_type | Yes | Must be code |
code_challenge | Yes | BASE64URL(SHA256(code_verifier)) |
code_challenge_method | Yes | Must be S256 |
state | Yes | CSRF protection token |
https://claude.ai/api/mcp/auth_callbackhttps://claude.com/api/mcp/auth_callbackhttp://localhost:6274/oauth/callbackhttp://localhost:6274/oauth/callback/debug
| Status | Cause |
|---|---|
| 400 | Invalid response_type, missing PKCE, invalid redirect_uri, or missing state |
| 401 | Invalid client_id |
Connect
Submit email credentials from the setup form. Not called directly by Claude.| Parameter | Required | Description |
|---|---|---|
state | Yes | State from the authorization request |
provider | Yes | Email provider (icloud, outlook, yahoo, fastmail, protonmail, generic) |
address | Yes | Email address |
password | Yes | App-specific password |
imap_host | No | Custom IMAP hostname (generic provider) |
imap_port | No | Custom IMAP port |
imap_tls | No | true or false |
smtp_host | No | Custom SMTP hostname |
smtp_port | No | Custom SMTP port |
smtp_secure | No | true or false |
redirect_uri?code=<auth_code>&state=<state>.
On Failure
Re-renders the setup form with a user-friendly error message. Credentials are validated via a live IMAP connection before any code is issued.
Token Exchange
Exchange an authorization code for an access token.| Parameter | Required | Description |
|---|---|---|
grant_type | Yes | Must be authorization_code |
code | Yes | Authorization code from callback |
client_id | Yes | OAuth client ID |
client_secret | Yes | OAuth client secret |
code_verifier | Yes | PKCE code verifier (original random string) |
redirect_uri | No | Must match the original authorization request |
| Status | Error | Cause |
|---|---|---|
| 400 | unsupported_grant_type | Not authorization_code |
| 400 | invalid_request | Missing code_verifier |
| 400 | invalid_grant | Code expired, used, or PKCE mismatch |
| 401 | invalid_client | Wrong client_id or client_secret |
Revocation
Revoke an access token.200 regardless of whether the token existed. This prevents token existence probing.