Waitlist open: get early access

API reference: MCP sign-in

6 endpoints of the MCP sign-in group.

Protected Resource Metadata of the MCP server (RFC 9728)

GET/.well-known/oauth-protected-resource/mcp No API key

The MCP server answers a request without a token with 401 and WWW-Authenticate with resource_metadata pointing here. mcp.sendtide.ch serves it at /.well-known/oauth-protected-resource.

Example

curl "https://api.sendtide.ch/.well-known/oauth-protected-resource/mcp"

Responses

StatusDescription
200 Metadata
Response fields
resourcestring
authorization_serversarray<string>
scopes_supportedarray<enum: read | send | full>
bearer_methods_supportedarray<string>

Authorization server metadata (RFC 8414)

GET/.well-known/oauth-authorization-server No API key

Example

curl "https://api.sendtide.ch/.well-known/oauth-authorization-server"

Responses

StatusDescription
200 Metadata with the endpoints, code_challenge_methods_supported [S256], grant types authorization_code and refresh_token

Register a client (Dynamic Client Registration, RFC 7591)

POST/oauth/register No API key

Open to anyone, at most 20 registrations per client address and hour. Redirect URIs are https, http to localhost, 127.0.0.1 or [::1] (any port at use), or a private-use scheme of a native app; never a fragment. A client with token_endpoint_auth_method none proves itself with PKCE only; client_secret_post and client_secret_basic get a secret.

Request body application/json

FieldTypeDescription
redirect_uris *array<string>
client_namestring
client_uristring
token_endpoint_auth_methodenum: none | client_secret_post | client_secret_basic
grant_typesarray<enum: authorization_code | refresh_token>
response_typesarray<enum: code>

Example

curl -X POST "https://api.sendtide.ch/oauth/register" \
  -H "Content-Type: application/json" \
  -d '{"redirect_uris":["string"]}'

Responses

StatusDescription
201 Registered
400 invalid_redirect_uri or invalid_client_metadata
429 Too many registrations

Start the sign-in (authorization code with PKCE)

GET/oauth/authorize No API key

Opened in the browser. An unknown client or redirect URI shows an error page. Otherwise errors go back to the redirect URI with error, state and iss; a valid request goes to the dashboard, where the user picks the account, the access (read, send, full) and whether real mail may be delivered (off by default: test mode), and comes back with code, state and iss. The code is valid once, for 60 seconds.

Parameters

NameInTypeDescription
response_type *queryenum: code
client_id *querystring
redirect_uriquerystring
state *querystring
code_challenge *querystring
code_challenge_method *queryenum: S256
resourcequerystringRFC 8707: the URL of the MCP server, e.g. https://mcp.sendtide.ch
scopequerystringA suggestion for the consent page (read

Example

curl "https://api.sendtide.ch/oauth/authorize?response_type=code&client_id=…&state=…&code_challenge=…&code_challenge_method=S256"

Responses

StatusDescription
302 To the dashboard or back to the client
400 Error page

Exchange a code or a refresh token

POST/oauth/token No API key

authorization_code needs code, redirect_uri, code_verifier and client_id; refresh_token needs refresh_token and client_id. Access tokens are valid one hour. Each refresh gives a new refresh token; using an old one again revokes the whole grant. A used code presented again revokes what it gave. resource, when sent, must be the MCP server.

Request body application/x-www-form-urlencoded

FieldTypeDescription
grant_type *enum: authorization_code | refresh_token
codestring
redirect_uristring
code_verifierstring
refresh_tokenstring
client_idstring
client_secretstring
resourcestring
scopestring

Example

curl -X POST "https://api.sendtide.ch/oauth/token" \
  -d token=…

Responses

StatusDescription
200 Tokens
Response fields
access_tokenstring
token_typeenum: Bearer
expires_ininteger
refresh_tokenstring
scopeenum: read | send | full
400 invalid_grant
401 invalid_client

Revoke a token (RFC 7009)

POST/oauth/revoke No API key

Revoking either token of a grant ends the whole grant. Answers 200 also for unknown tokens.

Request body application/x-www-form-urlencoded

FieldTypeDescription
token *string
token_type_hintstring
client_idstring
client_secretstring

Example

curl -X POST "https://api.sendtide.ch/oauth/revoke" \
  -d token=…

Responses

StatusDescription
200 Revoked (or unknown)
401 invalid_client