Inbox Zero Ai MCP

Inbox Zero Ai MCP

Inbox Zero AI MCP 是一款开源的 AI 邮件助手和客户端,旨在帮助用户高效管理邮件,实现零收件箱。它结合了智能自动化与强大的邮件组织工具,支持自动分类、批量退订、冷邮件拦截、邮件追踪与分析等功能。

154 浏览
2025-12-17 发布

详细介绍

Inbox Zero AI MCP 是一款开源的 AI 邮件助手和客户端,旨在帮助用户高效管理邮件,实现零收件箱。它结合了智能自动化与强大的邮件组织工具,支持自动分类、批量退订、冷邮件拦截、邮件追踪与分析等功能。用户可以选择使用托管版本,也可以自行部署实例。

核心功能

Inbox Zero AI MCP 提供了多种核心功能,帮助用户更高效地管理邮件:

  • AI 个人助手:根据用户指令自动管理邮件,包括草拟回复、标记、归档、转发、标记垃圾邮件等。
  • 邮件回复追踪(Reply Zero):追踪需要用户回复的邮件,以及等待他人回复的邮件。
  • 智能分类:自动将邮件分类,便于用户更好地组织收件箱。
  • 批量退订:一键退订多个邮件订阅,减少垃圾邮件。
  • 冷邮件拦截:自动检测并拦截冷营销邮件。
  • 邮件分析:提供每日、每周、每月的邮件活动统计。

安装方法

要安装和运行 Inbox Zero AI MCP,需要以下步骤:

  1. 安装 Node.js(v18+)、pnpm,以及可选的 Docker Desktop。
  2. 配置 Google OAuth:在 Google Cloud Console 中创建凭据,并设置所需的权限。
  3. 设置环境变量:复制并配置 `.env` 文件,填入您的凭据。
  4. 运行数据库迁移:初始化数据库结构。
  5. 启动应用程序:可以选择在开发模式或生产模式下运行。
cp apps/web/.env.example apps/web/.env
pnpm prisma migrate dev
pnpm run dev
# 或
pnpm run build
pnpm start

使用方法

以下是 Inbox Zero AI MCP 的使用示例,包括如何设置 Gmail 推送通知和 Webhook 处理。

1. 创建 PubSub 主题和订阅

在 Google Cloud Console 中创建一个新的 PubSub 主题,例如 `inbox-zero-updates`,并创建一个订阅以接收通知。使用 ngrok 设置回拨 URL:

ngrok http --domain=your-domain.ngrok-free.app 3000

2. 实现 Webhook 处理

在 Next.js 应用中创建一个 API 路由来处理 Google 的推送通知:

import type { NextApiRequest, NextApiResponse } from 'next';

export default function handler(req, res) {
  if (req.method !== 'POST') {
    res.status(405).json({ message: 'Method not allowed' });
    return;
  }

  const verificati
  if (!verificationToken || verificationToken !== process.env.GOOGLE_PUBSUB_VERIFICATION_TOKEN) {
    res.status(401).json({ message: 'Unauthorized' });
    return;
  }

  const data = JSON.parse(req.body);
  console.log('Received email notification:', data);

  res.json({ message: 'Notification processed successfully' });
}

3. 设置邮件监控

为了确保应用能够实时接收邮件通知,可以设置一个 cron 作业,定期调用 `/api/google/watch/all` 端点。

{
  "crons": [
    {
      "path": "/api/google/watch/all",
      "schedule": "0 */5 * * *"
    }
  ]
}

4. 完整代码示例

以下是基础用法的完整代码示例:

// pages/_app.tsx
import { NextApp } from 'next/app';
import type { AppProps } from 'next/app';

export default function MyApp({ Component, pageProps }: AppProps) {
  return (
    
      
    
  );
}
// pages/index.tsx
import { useState, useEffect } from 'react';

export default function Home() {
  const [emailNotifications, setEmailNotifications] = useState([]);

  useEffect(() => {
    const interval = setInterval(() => {
      fetch('/api/google/watch/all')
        .then((response) => response.json())
        .then((data) => setEmailNotifications(data))
        .catch((error) => console.error('Error:', error));
    }, 5000);

    return () => clearInterval(interval);
  }, []);

  return (
    
      实时电子邮件通知
      
        {emailNotifications.map((notification, index) => (
          {notification.subject}
        ))}
      
    
  );
}
// api/google/watch/all.ts
import type { NextApiRequest, NextApiResponse } from 'next';
import { google } from 'googleapis';

export default function handler(req, res) {
  const oauth2Client = new google.auth.OAuth2({
    client_id: process.env.GOOGLE_CLIENT_ID,
    client_secret: process.env.GOOGLE_CLIENT_SECRET
  });
}

使用场景

Inbox Zero AI MCP 适用于以下场景:

  • 需要高效管理大量邮件的专业人士。
  • 希望改善邮件习惯和组织方式的用户。
  • 需要自动化处理邮件的团队或企业。

注意事项

在使用 Inbox Zero AI MCP 时,需要注意以下几点:

  • 目前仅支持 Gmail/Google Workspace 账户。
  • AI 功能依赖于第三方 LLM 提供商。
  • 推送通知需要配置 PubSub。
  • 自托管需要一定的技术设置。

Inbox Zero AI MCP 通过 AI 技术和自动化工具,帮助用户更高效地管理邮件,减少邮件焦虑,提升工作效率。

email-management ai-assistant automation inbox-zero

相关服务推荐

查看更多