402 Coffee

402 Coffee

Non-custodial x402 tip jars for the agentic web, enabling USDC tips via a hosted MCP tool for agents.

Category
访问服务器

README

☕ 402 Coffee

Non-custodial x402 tip jars for the agentic web. Claim a handle with your wallet, get a live payment endpoint (/t/@you) and an embeddable button. Humans tip from a browser wallet with a signature (no gas); agents tip over HTTP or MCP; every tip settles as USDC straight to the creator's wallet. No custodian, no fee.

Live: https://402coffee.com · MIT · built on x402 v2, Base USDC.

Why non-custodial

payTo is the creator's own wallet. The service composes the payment challenge and asks a facilitator to verify + settle; it never holds keys or funds. Structurally cannot rug anyone, and stays out of money-transmitter territory.

Two front doors, one rail

  • Humans — an embeddable widget runs the full x402 flow in-browser: the payer signs an EIP-3009 transferWithAuthorization with MetaMask/Coinbase/Rabby and pays zero gas.
  • Agents — every jar is a real x402 endpoint and an MCP tool: tip("@handle", 1.00, "great post").

Embed (any site)

<script src="https://402coffee.com/widget.js" data-handle="tim" async></script>

README badge: [![Tip in USDC](https://402coffee.com/tim/badge.svg)](https://402coffee.com/tim)

Routes

Path What
GET/POST /t/:handle The x402 tip endpoint (dynamic payTo, ?amount= / ?tier=)
GET /:handle Warm creator page (SSR, wall, tiers, embed, OG image)
GET /:handle/dashboard SIWE-gated dashboard: ledger, per-post analytics, CSV, moderation
GET /:handle/badge.svg README tip badge
POST /api/creators SIWE signup / update
GET /api/creators/:handle Public profile JSON
GET /api/creators/:handle/tips SIWE-gated ledger (?format=csv) + POST to hide a tip
GET /api/wall/:handle Public supporter wall
GET /api/search?q= · GET /api/leaderboard Discovery
GET /api/nonce SIWE nonce
POST /mcp Hosted MCP server (get_creator, search_creators, tip)
GET /.well-known/x402 · GET /llms.txt Machine-readable discovery
GET /api/cron/reconcile Nightly ledger↔onchain reconciliation (cron)

Protocol (verified onchain, x402 v2)

Built on @x402/core@2.18.0 (protocol v2). All facts re-verified against the live SDK / facilitator / chain — never from memory:

Item Value
Headers PAYMENT-REQUIRED / PAYMENT-SIGNATURE / PAYMENT-RESPONSE
Networks CAIP-2 eip155:8453 (Base) · eip155:84532 (Base Sepolia)
USDC (Base) 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, 6 decimals
Scheme exact (EIP-3009 TransferWithAuthorization, payer pays no gas)
Amount / tx PaymentRequirements.amount (atomic) · SettleResponse.transaction

Architecture

  • lib/x402.mjs — thin x402 v2 core: build a challenge; verify + settle (the churn-exposed part)
  • lib/tipflow.mjs — the shared settle-and-record core used by both /t/:handle and MCP
  • lib/creators.mjs · lib/tips.mjs — Postgres store (creators, idempotent tip ledger)
  • lib/siwe.mjs — stateless-nonce Sign-In-With-Ethereum
  • lib/notify.mjs — HMAC-signed webhook + optional email
  • lib/reconcile.mjs — data-quality gate: ledger vs onchain USDC transfers
  • app/ — Next.js App Router (routes above); public/widget.js — the zero-dep widget

Develop

npm install
# local Postgres (Docker):
docker run -d --name pg402 -e POSTGRES_PASSWORD=dev -e POSTGRES_USER=dev -e POSTGRES_DB=coffee402 -p 5433:5432 postgres:16-alpine
cp .env.example .env.local     # set SIWE_SECRET + DATABASE_URL (see below)
npm run migrate                # create schema
npm run dev                    # http://localhost:3000

npm test                       # x402 v2 protocol/codec tests (vs real SDK + live facilitator)
npm run test:db                # DB + SIWE + notify + moderation integration tests
node scripts/e2e-local.mjs     # live HTTP: signup, challenge, ledger
node scripts/e2e-widget.mjs    # simulate the browser widget tip flow
node scripts/e2e-mcp.mjs       # drive the MCP server end to end

Environment

See .env.example. Production (Vercel) needs: DATABASE_URL (Neon), SIWE_SECRET, CDP_API_KEY_ID / CDP_API_KEY_SECRET (mainnet facilitator), X402_NETWORK=mainnet. Optional: CRON_SECRET, RESEND_API_KEY, BASE_RPC_URL.

License

MIT.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选