email-mcp: Instructions file for Codex

AGENTS.md

email-mcp AGENTS.md is an instructions file for Codex, OpenCode from sandraschi/email-mcp. It costs 1,953 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

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is sandraschi/email-mcp's own configuration. It tells Codex and OpenCode how to work on email-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything email-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to sandraschi/email-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sandraschi/email-mcp/master/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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for email-mcp AGENTS.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,953 This file is loaded in full into every session.
When invoked 1,953 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01953 $0.01953
Opus 5.5 $0.00781 $0.00781
Sonnet 5.5 $0.00391 $0.00391
Haiku 4.5 $0.00195 $0.00195

Measured 23d ago against content hash 87f8141b5990, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 23d 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 · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 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

  • 45+ 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, email_rag, sync_email_rag, email_rag_stats
  • Neural Email RAG & Vector Store: Local LanceDB vector repository (data/email_lancedb) with FastEmbed 384-dim semantic embeddings (BAAI/bge-small-en-v1.5), GPU accelerator auto-discovery (RAG_GPU=1 / CUDAExecutionProvider), paragraph-aware chunking with email header context injection, and incremental sync skips
  • Standardized RAG Operations REST: Non-blocking asynchronous background sweep worker (POST /api/rag/sweep, GET /api/rag/status/{job_id}, GET /api/rag/stats, GET /api/rag/search, with /api/reindex backward compatibility)
  • 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 · 124 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. 23d ago Changed · +35 lines · +691 tokens per session 87f8141b5990
  2. 2mo 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 (4 stars, last pushed 6d ago), licensed MIT. It adds 1,953 tokens to every session, about $0.0078 per session on Opus 5.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.

Related

email-mcp AGENTS.md compared with instructions from other repositories

email-mcp AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
email-mcp AGENTS.mdsandraschi/email-mcpInstructions file46d agoMITA1,953Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode