AI agents

claude.ai and ChatGPT

Web apps such as claude.ai and ChatGPT connect with OAuth: you give them the MCP address, mailrust asks you to sign in and shows what the app wants, and you choose the rights. There is no key to copy.

claude.ai

  1. Open Settings → Connectors and choose Add custom connector.
  2. Enter a name, for example mailrust, and the address https://mail.example.com/mcp.
  3. Press Connect. mailrust opens in a new tab; sign in if you are not signed in yet.
  4. The consent screen shows that Claude asks for access and returns to claude.ai. Choose the rights and press Allow.

Claude can now use mailrust in your chats. The connector appears on your Agents screen as an agent that signs in itself.

ChatGPT

  1. Open Settings → Apps & Connectors. Custom connectors need developer mode, under Advanced settings.
  2. Choose Create, enter the name and the address https://mail.example.com/mcp, and pick OAuth.
  3. ChatGPT opens mailrust: sign in, choose the rights on the consent screen and press Allow.

The consent screen tells you three things before you allow anything:

LineWhat it means
ProgramThe app's name
Returns toWhere your browser goes after you answer: the app's own site
Your accountThe person the agent will act for

If the app published a description of itself at its own address, as claude.ai does, mailrust downloads it and says so. If the app registered itself instead, mailrust warns that the name is the app's own claim: allow it only if you are connecting it right now.

Below are the rights, the same as on the Agents screen. Connecting the same app again replaces its rights instead of adding a second agent.

How the sign-in works

mailrust follows the MCP authorization standard, so any client that implements it can connect the same way:

  • the MCP address answers 401 and points to /.well-known/oauth-protected-resource/mcp;
  • /.well-known/oauth-authorization-server describes the sign-in: authorization, token, registration and revocation addresses;
  • apps register themselves (/mcp/register) or use a client metadata document at their own address;
  • codes are single use and need PKCE with SHA-256;
  • an access token lasts an hour and a refresh token 90 days; each refresh replaces the refresh token, and a replaced one used again cancels the whole sign-in.

Turning it off

Revoke the agent on the Agents screen: its tokens stop working at once. Removing the connector in claude.ai or ChatGPT only forgets it on their side.