Skip to main content

Email MCP server for Claude Code — read, search, send, and manage email

Project description

CLAUDE.md — eidos-mail

Email service for Eidos AGI. IMAP sync, vector search, HTMX web UI, REST API.

Architecture

Migadu IMAP/SMTP <-> FastAPI (eidos-mail) <-> Postgres + pgvector
                         |
                    HTMX web UI (humans)
                    REST API (agents)

Stack

  • Python 3.12, FastAPI, uvicorn, asyncpg, pgvector
  • sentence-transformers (all-MiniLM-L6-v2, 384 dims)
  • HTMX 2.0.4 for web UI
  • Railway: Dockerfile + railway.toml + Postgres addon

Project Structure

eidos-mail/
├── CLAUDE.md
├── Dockerfile
├── railway.toml
├── requirements.txt
├── app/
│   ├── main.py           <- FastAPI app + HTMX routes + API routes
│   ├── config.py          <- Settings from env
│   ├── database.py        <- asyncpg pool + migrations
│   ├── sync.py            <- IMAP sync
│   ├── embeddings.py      <- Vector embedding generation
│   └── templates/
│       └── layout.html    <- HTMX UI
└── migrations/
    └── 001_init.sql       <- emails + email_vectors tables

Environment Variables

Variable Description
DATABASE_URL Postgres connection string (Railway provides this)
IMAP_HOST IMAP server (imap.migadu.com)
IMAP_PORT IMAP port (993)
SMTP_HOST SMTP server (smtp.migadu.com)
SMTP_PORT SMTP port (465)
EMAIL_ADDRESS Email address (daniel@eidosagi.com)
EMAIL_PASSWORD Email password

Endpoints

Web UI (HTMX)

  • GET / — inbox
  • GET /search — semantic search
  • GET /compose — compose form

API (agents)

  • POST /api/sync — trigger IMAP sync
  • GET /api/search?q=... — vector search (JSON)
  • GET /api/emails?recent=N — recent emails (JSON)
  • GET /api/emails/{id} — single email (JSON)
  • POST /api/send — send email (JSON)
  • POST /api/emails/mark-read — mark emails read/unread (JSON: {ids, read})
  • POST /api/emails/{id}/delete — soft-delete an email
  • POST /api/emails/{id}/reply — reply with threading (JSON: {body})
  • POST /api/emails/{id}/forward — forward email (JSON: {to, body})
  • POST /api/emails/{id}/undelete — restore a soft-deleted email from trash
  • GET /health — health check

Development

# Install deps
pip install -r requirements.txt

# Run locally
DATABASE_URL=postgresql://... python -m uvicorn app.main:app --reload --port 8000

Rules

  • No raw secrets in code — use environment variables
  • Soft deletes only (deleted_at column)
  • All queries filter WHERE deleted_at IS NULL

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eidos_mail-0.1.0.tar.gz (78.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eidos_mail-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file eidos_mail-0.1.0.tar.gz.

File metadata

  • Download URL: eidos_mail-0.1.0.tar.gz
  • Upload date:
  • Size: 78.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for eidos_mail-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4de4d57ea2aeae2a44865c8c737fd377d9a66ec5958b44922ef3bc46e3c6abe4
MD5 87f59ef7bdbbacb745aed8aeb7712b69
BLAKE2b-256 95ec82c38d19c2828a857b51cb663c00d25bdf966e55bbeea94fd453797f44fe

See more details on using hashes here.

File details

Details for the file eidos_mail-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: eidos_mail-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for eidos_mail-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 801c863ea76ba89d819b9a8656340b61fe8f67c21d38648b454582df61b79fce
MD5 9fbf7c4c60d43a589565f92e7df408de
BLAKE2b-256 e981eeb195f9f1169d3a0a2f61cd448dc61e364f0ea27cf783b46ea2d8ac5f6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page