Custom agents and scripts · about 5 min

Give your own agent every inbox

Frameworks that speak MCP connect to the same server as Claude and Cursor. Everything else uses the REST API with a key you can scope to specific mailboxes.

curl
curl -H "Authorization: Bearer aik_..." \
  "https://emailgents.com/api/public/v1/messages?q=invoice&unread=true&limit=10"

server: https://emailgents.com/mcp

Setup

Sign in happens in the browser once; the client remembers it.

  1. 01
    Connect your mailboxes in EmailgentsSign up at emailgents.com and add your accounts under Mailboxes.
  2. 02
    Pick MCP or RESTMCP SDKs connect to https://emailgents.com/mcp with OAuth. For plain HTTP, create a key under Agents; keys start with aik_ and can be limited to chosen mailboxes and to read-only.
  3. 03
    Make a callSearch with GET /api/public/v1/messages?q=invoice&unread=true and follow the message id to the body, thread or attachments.
  4. 04
    Watch the logEvery call made with the key appears on your Activity page with the actor, tool and parameters.

Things to ask

  • “Nightly job: collect every invoice attachment from all accounts into cloud storage.”
  • “Support bot: find the customer's previous conversations before answering a ticket.”
  • “Personal agent: morning digest of what arrived overnight across every inbox.”

Good to know

  • REST responses use the same shapes and coverage metadata as the MCP tools, so an agent can switch transports without relearning the data.
  • Keys can be revoked instantly; a revoked key fails with 401 on the next call.

Custom agents questions

Where is the API documented?

See the REST API reference for endpoints, parameters, pagination cursors, coverage metadata and error codes.

Which inboxes will it see?

Every mailbox you have connected in Emailgents: Gmail and Google Workspace, Outlook and Microsoft 365, iCloud, Yahoo, Fastmail, AOL, Zoho, GMX, WEB.DE and any IMAP server. Add or remove mailboxes in Emailgents and the agent sees the change on its next call.

Can it read several accounts at once?

Yes. search_messages and inbox_overview cover every connected mailbox by default. Pass account_ids to narrow to one; each result carries its account so the agent can tell them apart.

Can it send, delete or move my mail?

No. The tool set is read-only apart from set_flags, which toggles read and starred. An instruction hidden inside an email cannot make the agent send anything on your behalf, and every call is listed on your Activity page.

Other agents

Your agents can read mail in five minutes.

One account, as many mailboxes as you need, every agent you run.