Skip to main content
Glama
Universal Notifier

Universal Notifier

README.md
# 🔔 Universal Notifier MCP Server

[![MCP](https://img.shields.io/badge/MCP-Compatible-green)](https://modelcontextprotocol.io/)
[![Python](https://img.shields.io/badge/Python-3.12+-blue)](https://www.python.org/)
[![License](https://img.shields.io/badge/License-MIT-yellow)](LICENSE)

> 當 AI 完成長時間任務後,透過 **Email** 和 **Windows Toast** 通知你!

---

## ✨ 功能

| 工具                | 功能        | 說明                           |
| ------------------- | ----------- | ------------------------------ |
| `send_notification` | 📧 Email     | 發送郵件到你的 Gmail           |
| `send_toast`        | 🖥️ Toast     | Windows 桌面右下角彈出通知     |
| `notify_all`        | 📧🖥️ 雙重通知 | 同時發送 Email + Toast(推薦) |

---

## 🚀 快速開始

### 1. 克隆專案

```bash
git clone https://github.com/smallwindmill/ding.mcp.git
cd ding.mcp
```

### 2. 安裝依賴

需要 [uv](https://docs.astral.sh/uv/) 套件管理器:

```bash
uv sync
```

### 3. 設定環境變數

複製範例檔並填入你的 Gmail 憑證:

```bash
cp .env.sample .env
```

編輯 `.env`:

```env
GMAIL_USER=你的信箱@gmail.com
GMAIL_APP_PASSWORD=你的16位應用程式密碼
```

> 📌 [如何取得 Gmail 應用程式密碼](https://myaccount.google.com/apppasswords)

---

## 🔧 配置 AI 工具

### Gemini CLI(stdio 模式)

編輯 `~/.gemini/settings.json`:

```json
{
  "mcpServers": {
    "universal-notifier": {
      "command": "uv",
      "args": [
        "run",
        "--project",
        "D:/Documents/GitHub/ding.mcp",
        "mcp",
        "run",
        "D:/Documents/GitHub/ding.mcp/server.py"
      ]
    }
  }
}
```

---

### Antigravity IDE(HTTP 模式)

**步驟 1:** 先啟動 HTTP Server

```bash
cd D:/Documents/GitHub/ding.mcp
uv run python server.py --transport http
```

**步驟 2:** 編輯 `~/.gemini/antigravity/mcp_config.json`:

```json
{
  "mcpServers": {
    "universal-notifier": {
      "serverUrl": "http://localhost:8000/mcp"
    }
  }
}
```

---

### Claude Desktop

編輯 `%APPDATA%\Claude\claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "universal-notifier": {
      "command": "uv",
      "args": [
        "run",
        "--project",
        "D:/Documents/GitHub/ding.mcp",
        "mcp",
        "run",
        "D:/Documents/GitHub/ding.mcp/server.py"
      ]
    }
  }
}
```

---

### Cursor

在 Settings → MCP 中加入:

```json
{
  "universal-notifier": {
    "command": "uv",
    "args": [
      "run",
      "--project",
      "D:/Documents/GitHub/ding.mcp",
      "mcp",
      "run",
      "D:/Documents/GitHub/ding.mcp/server.py"
    ]
  }
}
```

---

## 📁 專案結構

```
ding.mcp/
├── server.py              # MCP Server 主程式
├── .env.sample            # 環境變數範例
├── .gitignore             # Git 忽略規則
├── start_http_server.bat  # Windows HTTP 模式啟動腳本
├── pyproject.toml         # uv 專案配置
└── README.md              # 本文件
```

---

## 🔌 傳輸模式

| 模式      | 適用工具                   | 啟動方式          |
| --------- | -------------------------- | ----------------- |
| **stdio** | Gemini CLI, Claude, Cursor | 由 IDE 自動啟動   |
| **http**  | Antigravity IDE            | 需手動啟動 server |

### 啟動 HTTP 模式

```bash
uv run python server.py --transport http
```

或雙擊 `start_http_server.bat`

---

## 🛡️ 安全提醒

- ⚠️ **永遠不要**將 `.env` 加入版本控制
- ⚠️ 應用程式密碼不是你的 Gmail 登入密碼
- ✅ `.gitignore` 已設定排除 `.env`

---

## 📜 授權

MIT License

---

## 🤝 貢獻

歡迎 Issues 和 Pull Requests!