{
  "markdown": "# Mood Booster Agent\n\nEnglish | [中文](README_CN.md)\n\nAn ERC-8004 registered AI Agent that delivers uplifting messages via [MCP protocol](https://modelcontextprotocol.io/). Feel good? Tip 0.001 USDC!\n\n## Why This Project?\n\nThis is a **complete reference implementation** of the ERC-8004 Agent interaction loop:\n\n1. **On-chain Discovery** — Query Identity Registry to find the agent's MCP endpoint\n2. **MCP Communication** — Connect via SSE, call tools, get results\n3. **USDC Tipping** — Reward the agent with on-chain micropayments\n4. **Reputation Feedback** — Submit on-chain feedback to Reputation Registry (`giveFeedback`)\n5. **On-chain Verification** — Server verifies tips and feedback via tx receipts\n\nAll 5 steps leave traceable on-chain records on ERC-8004 protocol contracts, making your wallet eligible for future ecosystem airdrops.\n\n```\n┌──────────────┐     ┌──────────────┐     ┌──────────────┐     ┌──────────────┐\n│  ERC-8004    │ --> │  MCP Server  │ --> │  USDC Tip    │ --> │  Reputation  │\n│  Identity    │     │  (SSE)       │     │  (ERC-20)    │     │  Registry    │\n│  Registry    │     │              │     │              │     │              │\n│  agentId     │     │  cheer_me_up │     │  0.001 USDC  │     │ giveFeedback │\n│  tokenURI    │     │  confirm_tip │     │  6 chains    │     │ on-chain     │\n│  agentWallet │     │  report_fbk  │     │              │     │ reputation   │\n└──────────────┘     └──────────────┘     └──────────────┘     └──────────────┘\n    Discover              Call                  Tip                Feedback\n```\n\n## On-Chain Info\n\n| Chain    | agentId | Explorer |\n|----------|---------|----------|\n| BSC      | 23139   | [bscscan.com](https://bscscan.com/nft/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432/23139) |\n| Base     | 24692   | [basescan.org](https://basescan.org/nft/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432/24692) |\n| Ethereum | 28289   | [etherscan.io](https://etherscan.io/nft/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432/28289) |\n| Arbitrum | 591     | [arbiscan.io](https://arbiscan.io/nft/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432/591) |\n| Optimism | 431     | [optimistic.etherscan.io](https://optimistic.etherscan.io/nft/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432/431) |\n| Polygon  | 233     | [polygonscan.com](https://polygonscan.com/nft/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432/233) |\n\n- **Identity Registry**: `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432`\n- **Reputation Registry**: `0x8004BAa17C55a88189AE136b182e5fdA19dE9b63`\n- **MCP Endpoint**: `https://oc-001.tail177fbd.ts.net/mcp/sse`\n- **Tip Wallet**: `0x4f5caa4fa9Dd7F92A687582b0e09234bEf49F80a`\n\n## MCP Tools\n\n| Tool | Description |\n|------|-------------|\n| `cheer_me_up` | Get a warm, uplifting message (encouragement / compliment / wisdom / joke) |\n| `get_tip_info` | Get tipping details in JSON format for automated transfers |\n| `confirm_tip` | Report a completed USDC tip with on-chain verification |\n| `report_feedback` | Report an ERC-8004 giveFeedback transaction — leaves traceable protocol interaction on-chain |\n| `how_to_tip` | Get a complete tipping guide with code examples |\n| `get_stats` | View service statistics |\n\n## Quick Start\n\n### Run the server\n\n```bash\ncd server\nnpm install\nnode index.mjs\n# MCP SSE: http://localhost:3004/sse\n# REST API: http://localhost:3004/api/cheer\n```\n\n### Docker\n\n```bash\ndocker build -t mood-booster-agent .\ndocker run -p 3004:3004 mood-booster-agent\n```\n\n### Full end-to-end loop\n\n```bash\ncd scripts && npm install\n\n# Dry-run: discover → call MCP → on-chain feedback (no USDC tip)\nnode discover_and_tip.mjs --agent-id 23139 --chain bsc --wallet-key 0xYOUR_KEY --dry-run\n\n# Full loop: discover → call → tip → confirm → feedback\nnode discover_and_tip.mjs --agent-id 23139 --chain bsc --wallet-key 0xYOUR_KEY\n\n# Skip feedback\nnode discover_and_tip.mjs --agent-id 23139 --chain bsc --wallet-key 0xYOUR_KEY --no-feedback\n```\n\n### REST API (no MCP client needed)\n\n```bash\ncurl https://oc-001.tail177fbd.ts.net/mcp/api/cheer\ncurl \"https://oc-001.tail177fbd.ts.net/mcp/api/cheer?category=joke\"\n```\n\n## Use with Claude Code\n\nAdd this to your `~/.claude/claude_code_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"mood-booster\": {\n      \"type\": \"sse\",\n      \"url\": \"https://oc-001.tail177fbd.ts.net/mcp/sse\"\n    }\n  }\n}\n```\n\nThen in Claude Code you can say:\n\n```\n> Cheer me up!\n> Tell me a programming joke\n> How do I tip this agent?\n```\n\n## Use with Any MCP Client\n\n```javascript\nimport { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport { SSEClientTransport } from \"@modelcontextprotocol/sdk/client/sse.js\";\n\nconst transport = new SSEClientTransport(new URL(\"https://oc-001.tail177fbd.ts.net/mcp/sse\"));\nconst client = new Client({ name: \"my-agent\", version: \"1.0.0\" });\n\nawait client.connect(transport);\nconst result = await client.callTool({ name: \"cheer_me_up\", arguments: { category: \"random\" } });\nconsole.log(result.content[0].text);\nawait client.close();\n```\n\n## On-Chain Discovery\n\nAny agent can discover this service directly from the blockchain:\n\n```javascript\nimport { ethers } from \"ethers\";\n\nconst registry = new ethers.Contract(\n  \"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432\",\n  [\"function tokenURI(uint256) view returns (string)\"],\n  new ethers.JsonRpcProvider(\"https://bsc-dataseed.binance.org/\")\n);\n\nconst uri = await registry.tokenURI(23139);  // agentId on BSC\nconst metadata = JSON.parse(atob(uri.split(\",\")[1]));\nconsole.log(metadata.services[0].endpoint);  // → MCP endpoint URL\n```\n\n## Project Structure\n\n```\n├── server/                 # MCP Server (Express + SSE)\n│   ├── index.mjs           # Main server — 6 MCP tools\n│   ├── messages.json       # Message library (32 messages, 4 categories)\n│   └── package.json\n├── scripts/                # Client tools\n│   ├── discover_and_tip.mjs  # Full loop: discover → call → tip → feedback\n│   ├── test_mcp.mjs          # Quick MCP connection test\n│   ├── update_uri.mjs        # Update on-chain agentURI\n│   └── gen_wallets.mjs       # Generate test wallets\n├── metadata/\n│   └── mood_agent.json     # Agent metadata (stored on-chain as base64)\n├── Dockerfile              # Container build\n├── deploy.sh               # One-click deploy to server\n└── restart.sh              # Server restart script\n```\n\n## Tech Stack\n\n- **Identity**: [ERC-8004](https://eips.ethereum.org/EIPS/eip-8004) — AI Agent Identity Registry\n- **Reputation**: [ERC-8004](https://eips.ethereum.org/EIPS/eip-8004) — On-chain feedback via Reputation Registry\n- **Protocol**: [MCP](https://modelcontextprotocol.io/) (Model Context Protocol) over SSE\n- **Payment**: USDC (ERC-20) on BSC / Base / Ethereum\n- **Runtime**: Node.js, Express, ethers.js\n- **Infrastructure**: Tailscale Funnel (HTTPS reverse proxy)\n\n## Author\n\n- GitHub: [@edge-claw](https://github.com/edge-claw)\n- Twitter: [@mutou1852](https://x.com/mutou1852)\n- Email: shgchai185@gmail.com\n- Wallet: `0x4f5caa4fa9Dd7F92A687582b0e09234bEf49F80a`\n\n## License\n\nMIT\n",
  "bytes": 6960,
  "sha": "677784c6e038c56f27f8d588d8f5f5f4ff95b7aad84a1ba7a4d6863d3e93e1d9",
  "repo_slug": "edge-claw/mood-booster-agent",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_edge_claw_mood_booster_agent_111db748/readme"
}