in

inbox-zero

An MCP server for Inbox Zero. Adds functionality on top of Gmail like finding out which emails you need to reply to or need to follow up on.

Publisherinbox-zero
Submitted date4/13/2025

๐Ÿš€ Inbox Zero: The Open Source AI Email Assistant to Reclaim Your Time ๐Ÿ“ง

Inbox Zero is more than just an email client; it's a comprehensive, open-source solution designed to help you conquer your inbox using the power of AI. Featuring an AI-powered personal assistant and a suite of intelligent tools, Inbox Zero empowers you to manage your email efficiently and effectively.

Core Components

Inbox Zero comprises two key components:

  1. AI Email Assistant: An intelligent assistant that leverages AI to automate email management tasks, freeing you from repetitive chores.
  2. Open Source Email Client: A customizable and extensible email client that puts you in control of your email experience.

Key Features

  • AI Personal Assistant: Delegate your email management to an AI assistant that understands your instructions and takes action on your behalf. It can draft replies, apply labels, archive messages, forward emails, mark spam, and even trigger webhooks.
  • Reply Zero: Prioritize emails that require your attention and track responses you're waiting for, ensuring nothing slips through the cracks.
  • Smart Categories: Automatically categorize your contacts based on their email interactions, providing valuable insights into your network.
  • Bulk Unsubscriber: Effortlessly unsubscribe from unwanted email subscriptions with a single click, decluttering your inbox.
  • Cold Email Blocker: Automatically identify and block unsolicited cold emails, preventing spam from reaching your inbox.
  • Email Analytics: Gain insights into your email activity with comprehensive daily, weekly, and monthly statistics.

Tech Stack

Inbox Zero is built on a modern and robust technology stack:

  • Next.js: A React framework for building performant and scalable web applications.
  • Tailwind CSS: A utility-first CSS framework for rapid UI development.
  • shadcn/ui: A collection of accessible and reusable UI components.
  • Prisma: A modern database toolkit for type-safe database access.
  • Upstash: A serverless Redis database for caching and real-time data.
  • Turborepo: A monorepo tool for managing multiple projects in a single repository.

Getting Started for Developers

Prerequisites

  • Node.js: Version 18.0.0 or higher.
  • pnpm: Version 8.6.12 or higher.
  • Docker Desktop: (Optional) For running local instances of Postgres and Redis.

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/elie222/inbox-zero.git cd inbox-zero
  2. Set up external services:

    • Google OAuth: Configure Google OAuth credentials in the Google Cloud Console.
    • Google PubSub: Set up Google PubSub for real-time email notifications.
    • LLM Provider: Choose an LLM provider (Anthropic, OpenAI, AWS Bedrock, Google Gemini, Groq Llama 3.3 70B, or Ollama) and configure the necessary API keys or credentials.
  3. Configure environment variables:

    • Create a .env file in the apps/web directory by copying the .env.example file:

      cp apps/web/.env.example apps/web/.env cd apps/web
    • Set the required environment variables in the .env file. Refer to apps/web/env.ts for a list of required variables.

  4. Install dependencies:

    pnpm install
  5. Run database migrations:

    pnpm prisma migrate dev
  6. Start the development server:

    pnpm run dev

    Alternatively, you can start the development server from the project root:

    turbo dev
  7. Access the application:

    Open your browser and navigate to http://localhost:3000.

LLM Configuration

Inbox Zero supports multiple LLM providers:

  • Anthropic
  • OpenAI
  • AWS Bedrock Anthropic
  • Google Gemini
  • Groq Llama 3.3 70B
  • Ollama (Local)

To use Ollama, set the following environment variables:

OLLAMA_BASE_URL=http://localhost:11434/api NEXT_PUBLIC_OLLAMA_MODEL=phi3

If you are running the application in a Docker container and need to access a locally hosted Ollama instance, use http://host.docker.internal:11434/api as the base URL. You may also need to set OLLAMA_HOST to 0.0.0.0 in the Ollama configuration file.

Google OAuth and Gmail API Setup

  1. Enable the following scopes in the Google Cloud Console:

    https://www.googleapis.com/auth/userinfo.profile
    https://www.googleapis.com/auth/userinfo.email
    https://www.googleapis.com/auth/gmail.modify
    https://www.googleapis.com/auth/gmail.settings.basic
    https://www.googleapis.com/auth/contacts
    

Real-time Email Notifications with Google PubSub

  1. Follow the instructions in the Google documentation to set up push notifications.
  2. Create a topic and subscription in Google PubSub.
  3. Grant publish rights on your topic.
  4. Set the GOOGLE_PUBSUB_TOPIC_NAME environment variable.
  5. Configure the subscription to use a push endpoint with the following URL structure: https://your-domain.com/api/google/webhook?token=YOUR_TOKEN.
  6. Set the GOOGLE_PUBSUB_VERIFICATION_TOKEN environment variable to the value of YOUR_TOKEN.

Watching for Email Updates

Configure a cron job to periodically trigger the /api/google/watch/all endpoint to ensure real-time email updates. You can use services like Upstash or Vercel Cron Jobs to schedule these tasks.

Contributing

Inbox Zero is an open-source project, and contributions are welcome! Check out the GitHub Issues to find open tasks and discuss potential contributions in the Discord community.

Visit More

View All