lazycoffee-mcp
by elantion
README.md
# lazycoffee-mcp
[](LICENSE)
[](https://nodejs.org)
[](https://modelcontextprotocol.io)
Official **Model Context Protocol (MCP)** server for **LazyCoffee TOTP** — a Human-in-the-Loop AI Credential Broker with OS push notifications, biometric approval, and zero-knowledge ephemeral end-to-end encryption (`ECDH P-256 + AES-256-CBC + HMAC-SHA256`).
Stop pasting plaintext passwords or permanent 2FA seeds into AI chat windows. Let Claude Desktop, Cursor, Windsurf, or Antigravity request scoped credentials, 6-digit TOTP codes, remote action sign-offs, or one-time OTP relays only when needed—each protected by blind 3-option number matching and biometric approval on your phone or desktop.
> **Docs**: [English Integration Guide](https://www.lazycoffee.com/en/docs/guides/ai-auth) · [中文接入文档](https://www.lazycoffee.com/docs/guides/ai-auth) · [E2EE Protocol Spec](E2EE_SPEC.md) · [Security Policy](SECURITY.md)
---
## Why `lazycoffee-mcp`?
| Capability | Plain `.env` / Pasting Secrets | `lazycoffee-mcp` |
| :--- | :--- | :--- |
| **Raw 2FA / TOTP Seed Exposure** | Full secret exposed in prompt/context | **Never leaves your vault** (`lazycoffee_get_totp_code` returns only the current 6-digit OTP) |
| **Server Visibility** | Cloud logs / chat history see plaintext | **Zero-knowledge relay** using per-request ephemeral ECDH P-256 envelopes ([spec](E2EE_SPEC.md)) |
| **Anti-Prompt-Injection** | Silent auto-read without human review | **OS push + Face ID / Touch ID + blind 3-option 2-digit number matching** |
| **Replay & Kill Switch** | Static secret remains valid forever | **60s burn-after-reading**, row-locked atomic consume, domain blocklist & **Global Freeze** |
---
## Quickstart (Claude Desktop / Cursor / Windsurf / Antigravity)
Requires **Node.js >= 18** and the [LazyCoffee App](https://www.lazycoffee.com/en/download) (`>= v3.4.0` for remote approvals and OTP relay).
1. Open LazyCoffee (`Settings -> AI Credential Broker -> Bind AI Assistant`) and create a scoped token (`lca_...`).
2. Add the MCP server to your AI client configuration (`claude_desktop_config.json`, `.cursor/mcp.json`, or Windsurf/Antigravity MCP config):
```json
{
"mcpServers": {
"lazycoffee": {
"command": "npx",
"args": ["-y", "lazycoffee-mcp@latest"],
"env": {
"LAZYCOFFEE_AGENT_TOKEN": "lca_your_agent_token_here",
"LAZYCOFFEE_API_URL": "https://www.lazycoffee.com"
}
}
}
}
```
> Using `@latest` automatically fetches new releases whenever your AI client restarts or reconnects its MCP server.
---
## Available MCP Tools
| Tool Name | Requirement | Purpose |
| :--- | :--- | :--- |
| `lazycoffee_get_totp_code` | Any AI-Auth client | Request only the current 6-digit 2FA verification code (raw TOTP seeds never leave your vault). |
| `lazycoffee_request_credential` | Any AI-Auth client | Request scoped credentials (`account`, `password`, `totp_code`, `notes`) with optional 15-minute `task_15m` local lease reuse. |
| `lazycoffee_wait_for_credential` | Any AI-Auth client | Resume waiting for a pending credential request after `matchCode` escalation or wait timeout. |
| `lazycoffee_request_approval` | LazyCoffee `>= v3.4.0` | Request remote human sign-off (deployments, payments, agreements, or 2–4 option choices) via OS push + biometrics. |
| `lazycoffee_request_otp` | LazyCoffee `>= v3.4.0` (`otp_relay` scope) | Request a one-time external SMS/email/app verification code not stored in the vault (never cached across turns). |
| `lazycoffee_wait_for_request` | LazyCoffee `>= v3.4.0` (for approval/otp) | Resume waiting for any pending `credential`, `approval`, or `otp_input` request after timeout or `matchCode` escalation. |
---
## Environment Variables
| Variable | Required | Default | Description |
| :--- | :--- | :--- | :--- |
| `LAZYCOFFEE_AGENT_TOKEN` | Yes | — | Scoped agent token (`lca_...`) generated in LazyCoffee (`Settings -> AI Credential Broker`). |
| `LAZYCOFFEE_API_URL` | No | `https://www.lazycoffee.com` | LazyCoffee API base URL. |
---
## Cryptographic Guarantees & Independent Verification
All grant payloads (`credential`, `approval`, `otp_input`) are sealed end-to-end inside the LazyCoffee client for your local MCP process's single-use P-256 public key:
- **ECDH P-256 + `SHA-256(sharedSecret || "lc_ai_grant_v1")`** key agreement ([`src/crypto.ts`](src/crypto.ts)).
- **Encrypt-then-MAC (`AES-256-CBC` + `HMAC-SHA256`)** verified in constant time before decryption.
- **60s Burn-After-Reading**: Relay ciphertext is atomically wiped on `/consume`; replay returns `409 Conflict`.
- **Reproducible Crypto Test Vectors**: See [`E2EE_SPEC.md`](E2EE_SPEC.md) and run:
```bash
npm test
```
---
## Development & Verification
```bash
# Build dist/cli.js and dist/index.js (requires Bun for bundling)
bun run build
# Verify standalone Node.js >= 18 stdio JSON-RPC + deterministic E2EE vectors
node tests/node_smoke.mjs
node --test tests/e2ee_vectors.mjs
```
---
## 中文说明 / Chinese Overview
`lazycoffee-mcp` 是 **LazyCoffee(礼知咔啡)** 官方开源的 Model Context Protocol (MCP) 服务端:让 Claude Desktop、Cursor、Windsurf、Antigravity 等 AI 客户端按需申请账号、密码、6 位 TOTP 动态码、远程操作审批及一次性验证码中继,全程经手机/桌面端 **Face ID / Touch ID 生物识别放行**、**3 选 1 盲选安全数字匹配** 与 **ECDH P-256 临时端到端信封加密**,服务端与云端中继 60 秒阅后即焚、全程零明文。
- 中文接入与教程:https://www.lazycoffee.com/docs/guides/ai-auth
- 全端下载与浏览器扩展:https://www.lazycoffee.com/download