agentbox
MCP server that gives AI agents programmable email inboxes with tools to create inboxes, send and list threaded email, and search messages.
README
AgentBox
Open-source email inbox infrastructure for AI agents.
AgentBox gives software agents their own programmable inboxes. Create inboxes over an API, send and receive threaded email, stream realtime events, search messages, and let agents operate email through MCP—on infrastructure you control.
Early-stage software. The API is usable today; production email deliverability still depends on a correctly configured SMTP provider, inbound route, DNS, and abuse controls.
Why AgentBox?
- Self-hostable: MIT licensed, one Docker command, portable SQLite data.
- Agent-native: inboxes, threads, search, SSE events, and an MCP server are first-class.
- Provider-agnostic: use any SMTP provider; connect any inbound email service that can POST a webhook.
- Secure defaults: bearer authentication and HMAC-signed inbound webhooks.
- Honest local mode: without SMTP, sends are recorded as simulated so development never silently contacts real recipients.
Quick start
git clone https://github.com/sagnik11/agentbox.git
cd agentbox
cp .env.example .env
npm install
AGENTBOX_API_KEY=local-secret npm run dev
Create an inbox:
curl -X POST http://localhost:3000/v1/inboxes \
-H 'Authorization: Bearer local-secret' \
-H 'Content-Type: application/json' \
-d '{"username":"researcher","domain":"agents.example.com"}'
Open http://localhost:3000/docs for interactive API documentation. Or run with Docker:
AGENTBOX_API_KEY=local-secret docker compose up --build
API
| Method | Endpoint | Purpose |
|---|---|---|
POST |
/v1/inboxes |
Provision an inbox |
GET |
/v1/inboxes |
List inboxes |
DELETE |
/v1/inboxes/:id |
Delete an inbox |
POST |
/v1/inboxes/:id/messages |
Send a message |
GET |
/v1/inboxes/:id/messages |
Read an inbox |
GET |
/v1/threads/:id |
Read a thread |
GET |
/v1/search?q=... |
Search messages |
GET |
/v1/events |
Stream SSE events |
POST |
/v1/inbound |
Ingest signed inbound mail |
Receiving email
Configure your mail provider to transform inbound messages into this JSON shape and POST it to /v1/inbound:
{"to":"researcher@agents.example.com","from":"alice@example.com","subject":"Hello","text":"Hi agent"}
Set X-AgentBox-Signature to the hex HMAC-SHA256 of the exact JSON body using INBOUND_WEBHOOK_SECRET. Provider-specific adapters are welcome contributions.
MCP
Start the API, then configure an MCP client to run:
{
"mcpServers": {
"agentbox": {
"command": "npx",
"args": ["tsx", "/absolute/path/to/agentbox/src/mcp.ts"],
"env": {"AGENTBOX_URL":"http://localhost:3000","AGENTBOX_API_KEY":"local-secret"}
}
}
}
Tools: create_inbox, list_inboxes, list_messages, send_email, and search_email.
Production checklist
- Put AgentBox behind TLS and replace both development secrets.
- Configure authenticated SMTP plus SPF, DKIM, and DMARC for your sending domain.
- Route inbound MX email through a provider adapter to the signed webhook.
- Add tenant isolation, per-key rate limits, retention rules, and an abuse-reporting workflow before offering a public service.
- Back up the SQLite volume, or contribute a PostgreSQL store for multi-instance deployments.
Roadmap
- Inbound adapters for AWS SES, Mailgun, Postmark, and Cloudflare Email Workers
- Attachments and object-storage backends
- Webhook subscriptions with retries and signatures
- PostgreSQL, multi-tenancy, API key management, and quotas
- Python and TypeScript SDK packages
- Semantic search and structured extraction hooks
Contributing
Issues and pull requests are welcome. Please add tests for behavior changes and run npm test && npm run typecheck before opening a PR. See SECURITY.md for private vulnerability reporting.
License
MIT © Sagnik Ghosh. AgentBox is an independent project and is not affiliated with AgentMail.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.