email-mcp AGENTS.md

email-mcp AGENTS.md is an instructions file for Codex, OpenCode from sandraschi/email-mcp. It costs 1,262 tokens per session, scanned A, original, MIT.

Project instructions for an email server that lets AI tools work with email through a standard tool interface, with a web dashboard and support for Microsoft email accounts.

In plain words
What is it for?
Use them when modifying the email server, its dashboard, REST endpoints, tests, or integrations that send, receive, search, organise, and automate email.
Why use it?
They preserve important project context and warn about a specific integration detail: tool calls return result objects that must be unpacked before use in web endpoints.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/sandraschi/email-mcp/agents-md
Clone the repo
git clone --depth 1 https://github.com/sandraschi/email-mcp

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for email-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/sandraschi/email-mcp/agents-md.svg)](https://agentmods.dev/instructions/sandraschi/email-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/sandraschi/email-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/sandraschi/email-mcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,262 This file is loaded in full into every session.
When invoked 1,262 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01262 $0.01262
Opus 5 $0.00631 $0.00631
Sonnet 5 $0.00252 $0.00252
Haiku 4.5 $0.00126 $0.00126

Measured 4d ago against content hash 3725e71483ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

email-mcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md -- Session Context

Repo: email-mcp

Full-featured email server for MCP clients. Web dashboard at 10812, backend at 10813. 188 tests, 42 MCP tools. Microsoft Graph support for personal Outlook/Hotmail (basic SMTP auth is disabled on those accounts — 535 5.7.139).


Key Architecture

Layer Tech Notes
MCP Framework FastMCP 3.2+ fastmcp>=3.2.0,<4
Web Framework FastAPI REST endpoints in web.py
Frontend React 19 + Vite + Tailwind Port 10812
Tests pytest (69) + Playwright (17) 86 total
SMTP Testing aiosmtpd 1.4+ Throwaway servers for testing
DB JSON file storage Contacts, drafts, rules, pending

Critical Gotcha

mcp_app.call_tool() returns CallToolResult objects in FastMCP 3.2, not raw dicts. Always use _extract_tool_result() when calling tools from web.py REST endpoints. See web.py for the helper.


Current State (2026-08-03)

Features

  • 42+ MCP tools: send, receive, search, delete, move, copy, forward, mark-read/unread, folders CRUD, list/configure/remove services, mailing lists, email_help, suggest_subject, agentic_assist, watcher, contacts, workflows, auto-respond, email_connector
  • Microsoft Graph: personal Outlook/Hotmail via Graph REST (send/receive/search/folders); OAuth device flow with public client ID (no Azure registration); service="default" auto-backs onto Graph when a token exists for an Outlook account
  • Folder treeview: Inbox sidebar tree (expandable, unread badges, icons) + inline folder CRUD (new/rename/delete); custom folder names resolve to Graph folder ids
  • Fleet connectors: email_connector tool + REST — aiwatcher fleet ingest and robofang email hook (opt-in env, fail-soft)
  • Auto-Respond: rule engine + AI drafting + pending queue + spam spoof mode (irate/mock-stupid/absurd/polite-but-confused)
  • Bulk Send: paste email lists, max 50, anti-spam warnings
  • Mail Watcher: background IMAP polling with webhook POST
  • Mail Lab: throwaway aiosmtpd SMTP server with AI message generator
  • Contacts: full CRUD + CSV/vCard/Google People/Microsoft Graph import + curated public official lists (US Congress, Austrian Parliament, EU Commission)
  • Creative Workflows: 7 AI presets (love letter, complaint, etc.) with text/ascii/svg output
  • Expander: short-note-to-full-email with 6 fictional contexts
  • Quick Setup: 8 providers (Gmail/Outlook/Yahoo/iCloud/ProtonMail/Zoho/GMX/Fastmail)
  • Prompt injection defense: 37 Unicode chars stripped + safety boundary wrapping
  • Folder CRUD: list/create/delete/rename IMAP folders
  • justfile: SOTA standard (inline dashboard, build=uv sync, check=fmt+lint, ci pipeline)

Read the full file on GitHub · 89 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 89 lines · 1,262 tokens per session scan A 3725e71483ce

Subscribe to this mod's changes

email-mcp AGENTS.md is an instructions file published in the GitHub repository sandraschi/email-mcp (2 stars, last pushed 3d ago), licensed MIT. It adds 1,262 tokens to every session, about $0.0063 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.