register_agent
Register an agent
Creates a new agent with its own email address and returns its API key, shown once.
didlabellocalPartdomainToken
xyz.mailgiPublished by mailgi.xyzOfficial publisherv1.0.0Updated Nov 1, 2026
Email for AI agents: register a real inbox with no human, then send, receive and read mail.
Mailgi gives an AI agent its own real email address, letting it send, receive, read and organize mail over a hosted API.
Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.
Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.
Read https://sourceweft.com/mcp/xyz.mailgi%2Fmailgi/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.Add this to your client's mcpServers config.
{
"mcpServers": {
"mailgi": {
"type": "http",
"url": "https://api.mailgi.xyz/mcp"
}
}
}Email for AI agents. Every agent gets a real, deliverable mailbox and uses it entirely over REST — no SMTP or IMAP client required.
The API and mail infrastructure live in a separate private repository.
Or from code:
Workspaces are listed explicitly in the root package.json rather than globbed,
so non-Node packages such as packages/python can sit alongside them without
confusing npm.
Release tags are namespaced per package — ts-sdk-v0.2.0, py-sdk-v0.1.0 —
because the SDKs version independently.
MIT
Source: README.md at commit fcb0912
Register an agent
Creates a new agent with its own email address and returns its API key, shown once.
didlabellocalPartdomainTokenRequest dashboard login code
Emails a 6-digit dashboard login code to a human's address. Creates the account on first login.
emailrequiredVerify dashboard login code
Exchanges an emailed login code for a dashboard session token.
coderequiredemailrequiredLook up a top-up
Shows which wallet a top-up for a Mailgi address would credit, and the allowed amounts.
addressrequiredStart a top-up
Creates a card payment link for the wallet behind any Mailgi address. Give it to a human to pay.
addressrequiredamountUsdrequiredCheck a top-up
Returns whether a top-up payment has been paid and credited.
sessionIdrequiredService health
Checks that the Mailgi API, its database and the mail server are up.
Takes no parameters.
Get agent profile
Returns this agent's profile: its addresses, label and domain.
Takes no parameters.
Get agent usage
Returns this agent's daily send and API counters; the latest day is partial.
tofromDelete agent
Permanently deletes this agent, its mailbox and all its API keys.
Takes no parameters.
List messages
Lists message headers in the mailbox, newest first by default; filter by folder with mailboxId.
sortlimitpositionmailboxIdRead a message
Returns one message with its full text and HTML body.
idrequiredSend email
Sends an email from this agent's address. Mail to outside addresses is charged to the wallet.
cctorequiredbccreplyTosubjectrequiredhtmlBodytextBodyMove message to Trash
Moves a message to the Trash folder.
idrequiredMove message
Moves a message to another folder.
idrequiredmailboxIdrequiredSet message flags
Marks a message as seen or unseen, flagged or unflagged.
idrequiredseenflaggedList folders
Lists all folders, including Inbox, Sent and Trash.
Takes no parameters.
Create folder
Creates a folder, optionally nested under another.
namerequiredparentIdRename folder
Renames a folder.
idrequirednamerequiredDelete folder
Deletes a custom folder.
idrequiredList API keys
Lists this agent's API keys. Key values are never shown again.
Takes no parameters.
Create API key
Creates another API key for this agent. The key is shown once.
labelexpiresAtRevoke API key
Revokes an API key immediately.
keyIdrequiredGet wallet
Returns the wallet this agent spends from: balance, prices and how to top up.
Takes no parameters.
Create top-up link
Creates a card payment link for this agent's wallet. Give it to a human to pay.
amountUsdrequiredList wallet transactions
Lists the wallet ledger, newest first.
limitoffsetList webhooks
Lists this agent's webhook endpoints.
Takes no parameters.
Create webhook
Registers an HTTPS URL to be notified when mail arrives. The signing secret is shown once.
urlrequiredeventTypesDelete webhook
Deletes a webhook endpoint.
idrequiredList webhook deliveries
Lists recent delivery attempts for a webhook endpoint.
idrequiredResend webhook delivery
Queues a delivery attempt to be sent again.
idrequireddeliveryIdrequiredRe-enable webhook
Re-enables a webhook endpoint that was switched off after repeated failures.
idrequiredWho am I
Returns the signed-in user and the organizations they belong to.
Takes no parameters.
Sign out
Revokes the current dashboard session token.
Takes no parameters.
List organizations
Lists the organizations the signed-in user belongs to.
Takes no parameters.
Create organization
Creates an organization; the signed-in user becomes its owner.
namerequiredslugGet organization
Returns one organization.
orgIdrequiredRename organization
Renames an organization.
namerequiredorgIdrequiredList members
Lists an organization's members and their roles.
orgIdrequiredChange member role
Changes a member's role.
rolerequiredorgIdrequireduserIdrequiredRemove member
Removes a member from the organization, or leaves it when userId is your own.
orgIdrequireduserIdrequiredInvite member
Emails an invitation to join the organization.
roleemailrequiredorgIdrequiredList invites
Lists pending invitations.
orgIdrequiredRevoke invite
Revokes a pending invitation.
orgIdrequiredinviteIdrequiredAccept invite
Accepts an organization invitation with the token from the invite email.
tokenrequiredAttach domain
Attaches a custom domain and returns the DNS records to publish.
orgIdrequireddomainrequiredList domains
Lists an organization's custom domains.
orgIdrequiredGet domain
Returns a domain's verification status and the DNS records it needs.
orgIdrequireddomainIdrequiredVerify domain
Re-checks the domain's DNS records and verifies it if they are correct.
orgIdrequireddomainIdrequiredDetach domain
Detaches a custom domain from the organization.
orgIdrequireddomainIdrequiredList inboxes
Lists the inboxes (agents) on a domain.
orgIdrequireddomainIdrequiredCreate inbox
Creates an inbox with a chosen address on a domain. Its API key is shown once.
labelorgIdrequireddomainIdrequiredlocalPartrequiredDelete inbox
Removes an inbox and its mail from a domain.
orgIdrequiredagentIdrequireddomainIdrequiredCreate registration token
Creates a token that lets an agent register its own address on this domain. Shown once.
labelorgIdrequireddomainIdrequiredList registration tokens
Lists a domain's registration tokens.
orgIdrequireddomainIdrequiredRevoke registration token
Revokes a registration token.
orgIdrequiredtokenIdrequireddomainIdrequiredGet organization usage
Returns daily send, receive and API counters across the organization.
tofromorgIdrequiredbreakdownGet domain usage
Returns daily send, receive and API counters for one domain.
tofromorgIdrequireddomainIdrequiredbreakdownGet organization wallet
Returns the organization's shared wallet: balance, prices and how to top up.
orgIdrequiredCreate organization top-up link
Creates a card payment link for the organization wallet.
orgIdrequiredamountUsdrequiredList organization transactions
Lists the organization wallet ledger, newest first.
limitorgIdrequiredoffsetList organization webhooks
Lists webhook endpoints across the organization's inboxes.
orgIdrequiredCreate organization webhook
Registers an HTTPS URL to be notified when mail arrives at one of the organization's inboxes.
urlrequiredorgIdrequiredagentIdrequiredeventTypesDelete organization webhook
Deletes a webhook endpoint.
idrequiredorgIdrequiredList organization webhook deliveries
Lists recent delivery attempts for a webhook endpoint.
idrequiredorgIdrequiredResend organization webhook delivery
Queues a delivery attempt to be sent again.
idrequiredorgIdrequireddeliveryIdrequiredRe-enable organization webhook
Re-enables a webhook endpoint that was switched off after repeated failures.
idrequiredorgIdrequired100% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
npm install -g @mailgi/mailgi
mailgi register --label my-agent # saves to ~/.mailgi/config.jsonmailgi send --agent <handle> --to [email protected] --subject Hi --body Hellomailgi inbox --agent <handle>import { AgentMailboxClient } from "@mailgi/mailgi";
const client = AgentMailboxClient.withApiKey("https://api.mailgi.xyz", process.env.MAILGI_API_KEY!);await client.sendMail({ to: ["[email protected]"], subject: "Hi", textBody: "Hello" });npm install # installs all workspacesnpm run build # builds every packagenpm test # runs every package's testsnpm run dev -w @mailgi/ui # developer UI on :5173