API and MCP

Your inbox, programmable.

Let AI assistants read, search, triage and reply to your email through a remote MCP server, or build on the REST API. Both sign in with OAuth 2.1, so nobody handles a password or pastes a token.

MCP server

One click to connect.

Add this URL to any MCP client that supports remote servers. The first time it connects, you sign in to Mail and choose what it may do. The client registers itself, so there are no keys to create.

https://email-api.appwrite.network/mcp
Claude

Settings → Connectors → Add custom connector, then paste the URL.

Open Claude
ChatGPT

Settings → Apps & Connectors → Create, then paste the URL.

Open ChatGPT
Cursor

Installs the server and opens sign-in on first use.

Add to Cursor
VS Code

Adds the server to your MCP settings.

Add to VS Code

Claude Code:

claude mcp add --transport http mail https://email-api.appwrite.network/mcp
ToolScope
get_mailboxmail.read
list_messagesmail.read
read_messagemail.read
read_threadmail.read
list_labelsmail.read
send_emailmail.send
reply_to_emailmail.send
update_messagesmail.modify

Authentication

OAuth 2.1, or a personal key.

OAuth 2.1 for apps

The authorization server is an Appwrite project: authorization code with PKCE, dynamic client registration, refresh token rotation and resource indicators. Point any OAuth library at the discovery document.

API keys for scripts

Create a key in Settings → API keys with just the permissions it needs, and send it as a bearer token. Revoke it any time.

Discovery document:

https://fra.cloud.appwrite.io/v1/oauth2/6ae21f6271db427f12bc/.well-known/openid-configuration
mail.readRead messages, threads and labels
mail.sendSend email and replies
mail.modifyMark, star, label, move and delete

REST API

Simple, JSON, predictable.

Base URL https://email-api.appwrite.network. Every request sends Authorization: Bearer <token>. Errors return a JSON message with a 4xx status.

GET/v1/memail.readYour mailbox
GET/v1/messagesmail.readList or search: folder, q, unread, starred, label, limit, cursor
GET/v1/messages/{id}mail.readOne message; ?html=true adds the HTML body
GET/v1/threads/{id}mail.readA conversation
GET/v1/labelsmail.readYour labels
POST/v1/messagesmail.sendSend: to, cc, bcc, subject, text or html; replyTo for replies
PATCH/v1/messages/{id}mail.modifyUpdate: read, starred, folder, addLabels, removeLabels
PATCH/v1/messagesmail.modifyUpdate many: same fields plus ids
DELETE/v1/messages/{id}mail.modifyMove to Trash

Search your inbox:

curl "https://email-api.appwrite.network/v1/messages?q=invoice&unread=true" \
  -H "Authorization: Bearer $MAIL_KEY"

Send a message:

curl -X POST "https://email-api.appwrite.network/v1/messages" \
  -H "Authorization: Bearer $MAIL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": ["ada@example.com"], "subject": "Hello", "text": "Sent from the API."}'

Archive and mark read:

curl -X PATCH "https://email-api.appwrite.network/v1/messages/<id>" \
  -H "Authorization: Bearer $MAIL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"folder": "archive", "read": true}'