# API-Referenz: MCP-Anmeldung

> OAuth-2.1-Endpunkte der Gruppe «MCP-Anmeldung» der Sendtide API: Client-Registrierung, Autorisierung, Token und Widerruf. Die Referenz ist auf Englisch.

URL: https://sendtide.ch/docs/api/mcp-sign-in/

6 Endpunkte der Gruppe «MCP-Anmeldung». Die Referenz stammt aus der englischen OpenAPI-Spezifikation und ist nicht übersetzt.
## Protected Resource Metadata of the MCP server (RFC 9728)

GET /.well-known/oauth-protected-resource/mcp Ohne 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.
### Beispiel

```
curl "https://api.sendtide.ch/.well-known/oauth-protected-resource/mcp"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Metadata |
## Authorization server metadata (RFC 8414)

GET /.well-known/oauth-authorization-server Ohne API-Key
### Beispiel

```
curl "https://api.sendtide.ch/.well-known/oauth-authorization-server"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 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 Ohne 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
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| redirect_uris * | array | |
| client_name | string | |
| client_uri | string | |
| token_endpoint_auth_method | enum: none / client_secret_post / client_secret_basic | |
| grant_types | array | |
| response_types | array | |
### Beispiel

```
curl -X POST "https://api.sendtide.ch/oauth/register" \
  -H "Content-Type: application/json" \
  -d '{"redirect_uris":["string"]}'
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 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 Ohne 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.
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| response_type * | query | enum: code | |
| client_id * | query | string | |
| redirect_uri | query | string | |
| state * | query | string | |
| code_challenge * | query | string | |
| code_challenge_method * | query | enum: S256 | |
| resource | query | string | RFC 8707: the URL of the MCP server, e.g. https://mcp.sendtide.ch |
| scope | query | string | A suggestion for the consent page (read |
### Beispiel

```
curl "https://api.sendtide.ch/oauth/authorize?response_type=code&client_id=…&state=…&code_challenge=…&code_challenge_method=S256"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 302 | To the dashboard or back to the client |
| 400 | Error page |
## Exchange a code or a refresh token

POST /oauth/token Ohne 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
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| grant_type * | enum: authorization_code / refresh_token | |
| code | string | |
| redirect_uri | string | |
| code_verifier | string | |
| refresh_token | string | |
| client_id | string | |
| client_secret | string | |
| resource | string | |
| scope | string | |
### Beispiel

```
curl -X POST "https://api.sendtide.ch/oauth/token" \
  -d token=…
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Tokens |
| 400 | invalid_grant |
| 401 | invalid_client |
## Revoke a token (RFC 7009)

POST /oauth/revoke Ohne 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
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| token * | string | |
| token_type_hint | string | |
| client_id | string | |
| client_secret | string | |
### Beispiel

```
curl -X POST "https://api.sendtide.ch/oauth/revoke" \
  -d token=…
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Revoked (or unknown) |
| 401 | invalid_client |
