open-inbox-chatgpt
Allows the MCP server to send and receive email through Resend, providing tools to search, read, send, update (star/archive/trash/restore), and delete messages for a configured mailbox.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@open-inbox-chatgptCheck my inbox for any unread emails from my bank"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Open Inbox + ChatGPT
Self-host a small email inbox without paying for a Google or Microsoft Workspace account. The web app uses Next.js, Resend inbound/outbound email, and Neon Postgres. A separate private MCP server lets supported ChatGPT accounts search, read, send, and organize mail through their own connection.
This repository contains source code and setup skills, not a hosted email service or a pre-connected ChatGPT app. Each installation uses its own mailbox, database, credentials, and MCP tunnel. No personal messages or credentials are included.
What you can do
Receive email through a verified domain or a Resend-provided inbound address.
Read, search, reply, send, star, archive, trash, and restore messages in the web inbox.
Import an existing MBOX export into your own database.
Connect the private MCP server to ChatGPT through Secure MCP Tunnel, when your ChatGPT plan and permissions allow it. MCP tools can also read attachments up to 2 MB and send attachments up to 10 MB.
Related MCP server: Mail-MCP
Costs and ChatGPT access
The source code is free under MIT. Providers have their own quotas and may change them. A custom domain and hosting may cost money. Resend offers an inbound address on a Resend domain, so receiving mail can be tested without buying a domain; sending mail to arbitrary recipients requires a sending identity permitted by Resend. Review Resend pricing, Resend inbound, and the current limits of your database and host before relying on a free tier.
ChatGPT access depends on your plan. OpenAI currently documents Pro custom MCP apps as read/fetch only, while write/modify actions are in beta for Business and Enterprise/Edu. This repository cannot unlock write actions on an ineligible plan. See OpenAI's plan-specific developer-mode guide. You do not need a Google Workspace or Microsoft 365 subscription for this email app.
Secure MCP Tunnel is for each person's private connection. It cannot be used as the public endpoint for a universal OpenAI plugin submission. The included OpenAI plugin package is skills-only; it teaches setup and safe usage. To submit one shared MCP plugin to OpenAI's public directory, a separate multi-user HTTPS MCP service with authentication, domain verification, and OpenAI review would be required.
Quick start: web inbox
Requirements: Node.js 22.13+, pnpm, a Neon Postgres database, a Resend account, and a reachable HTTPS deployment for inbound webhooks.
Clone this repository and run
pnpm install.Copy
.env.exampleto.env.local. Replace every example value.MAILBOX_EMAILis the one address the MCP server may access. Use a long uniqueMAILBOX_PASSWORD.Run
pnpm db:migrate, thenpnpm devto preview the web app.Deploy the app to a host that supports Next.js. Set the same secrets in the host's secret manager. Keep the web inbox behind its Basic Auth credentials.
In Resend, configure receiving for your address and register a signed
email.receivedwebhook athttps://YOUR-HOST/api/webhooks/resend. Set its signing secret asRESEND_WEBHOOK_SECRET.Send a message from an address you control to the new inbox, then verify it appears in the web UI. Send an outbound test only after Resend has verified your sender.
The webhook verifies its signature before storing received mail. The inbox returns 401 when its Basic Auth credentials are absent. The webhook path is exempt from Basic Auth because it uses signature verification.
Optional: import an existing mailbox
Export your own mailbox to MBOX and run:
pnpm email:import /private/path/messages.mbox you@example.comThe import writes message content and attachments to your Neon database. Keep MBOX files outside the repository and delete unneeded exports securely. Do not point the command at another person's mailbox without their authorization.
Connect to ChatGPT
The MCP server is in mcp/. It reads MAILBOX_EMAIL, DATABASE_URL, and RESEND_API_KEY from its process environment. It does not call an OpenAI model API. Its seven tools are mailbox_profile, search_emails, read_email, read_attachment, send_email, update_email, and delete_email_permanently.
Run
cd mcp && pnpm install.Test locally:
node --env-file=../.env.local server.mjs(it waits for MCP input on stdio).Follow OpenAI's Secure MCP Tunnel guide to create your own tunnel and limited runtime key. Download
tunnel-clientfrom OpenAI; this repository does not bundle a binary or credentials. Use the profile template inmcp/tunnel.example.yamland replace its placeholders privately.In ChatGPT developer mode, create a new MCP app using your tunnel. Scan and review the tools. Never choose another user's tunnel or paste your database URL into ChatGPT.
Start a new ChatGPT conversation and select your app. Test
mailbox_profile, search, and read before using any write tool.
Keep tunnel-client running on a machine with access to this MCP server. If that process stops, ChatGPT loses the connection. OpenAI's connection guide describes the current UI. Each ChatGPT account or workspace must create its own app connection.
Reusable OpenAI skills
plugins/open-inbox/ is a skills-only Agent Plugins package. Its setup skill walks through private deployment; its usage skill explains how to use a connected mailbox safely. The repository marketplace at .agents/plugins/marketplace.json makes it available to Codex from a cloned repository. The package deliberately contains no .app.json: that file would contain one person's private app ID and cannot be reused by everyone.
For a French walkthrough, see docs/FR.md. For security and disclosure instructions, see SECURITY.md.
Privacy boundary
Your mail is stored in your Neon database and processed by your Resend account. Connecting ChatGPT means that messages returned by MCP tools are sent to ChatGPT to answer your requests. Review provider privacy policies and use a private connection. The MCP server limits queries and changes to MAILBOX_EMAIL; sending and permanent deletion are labeled as consequential actions and should be confirmed for each specific message.
This server cannot be deployed
Maintenance
Related MCP Connectors
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Email inboxes for AI agents: send, receive, reply, search, and manage threaded email over MCP.
Your mailboxes in ChatGPT and Claude: Gmail, iCloud, Fastmail, any IMAP. Passwords stay yours.
Hosted email for AI agents: create inboxes, send, receive, and reply over MCP with scoped API keys
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to search, read, send, and organize Gmail emails via MCP protocol.2298 npm2MIT
- AlicenseNot gradedqualityBmaintenanceEnables secure mailbox access and email management via IMAP/SMTP, with tools for reading, searching, organizing, sending, and deleting emails, designed for local use and compatible with MCP clients like ChatGPT.1MIT
- AlicenseNot gradedqualityBmaintenanceConnects any IMAP/SMTP mailbox to AI agents via MCP, enabling email read, search, send, reply, and management through natural language.4 npmMIT
- FlicenseBqualityBmaintenanceEnables external AI agents to read, send, and manage email over IMAP/SMTP via MCP, including inbox listing, search, drafts, scheduled/batch sending, and operations like reply, archive, and labels.303-