Happy MedBox MCP Server
家庭用お薬管理システム(Happy MedBox)
三端ソフトウェアスキャフォールド:微信小程序端 + Node/SQLite バックエンド + MCP サーバー + A2A リマインダーエージェント。 コア全フロー:撮影認識 → データベース書き込み → 定時スキャン期限切れ → MCP データインターフェース提供 → A2A リマインダー発動 → 小程序でリマインダーとアドバイス表示。
技術選定:バックエンドと小程序はどちらもネイティブ/ゼロ外部依存で実装(Node 22 組み込み
http/node:sqlite/node:test)、オフラインでnode実行とテストが可能、npm install不要。
ディレクトリ構成
happy-medbox/
├─ prd.md / architecture.md # 产品需求 + 系统架构(团队 SOP 产出)
├─ package.json / README.md
├─ src/ # 后端:API + 数据库 + MCP + A2A
│ ├─ db.js # SQLite 连接与建表(node:sqlite)
│ ├─ expiry.js # 过期计算(纯函数,可单测)
│ ├─ ocr.js # OCR 接口 + Mock(预留腾讯云/微信 OCR)
│ ├─ repository.js # 数据访问层 CRUD
│ ├─ mcp-server.js # MCP 工具 + JSON-RPC(stdio)
│ ├─ server.js # REST API(小程序对接)
│ ├─ a2a-server.js # 提醒代理 + 用户代理(双端口,A2A 推送)
│ ├─ seed.js # 样例数据
│ └─ index.js # 编排入口(启动 + 定时扫描)
├─ miniprogram/ # 微信小程序端(原生)
│ ├─ pages/{index,capture,detail,knowledge,reminder}/
│ └─ utils/{api,ocr,format}.js
└─ test/ # 单元测试(expiry/db/mcp/a2a)Related MCP server: Medical MCP Server
クイックスタート
1. バックエンド + A2A 起動(デフォルトポート 3000 / 4100 / 4200)
cd happy-medbox
node src/index.js起動後:
小程序が REST に接続:
http://localhost:3000リマインダーエージェント(AgentCard / スキャン発動):
http://localhost:4100ユーザーエージェント受信箱:
http://localhost:4200
環境変数:API_PORT / REMINDER_PORT / USER_PORT / WARNING_DAYS(デフォルト30) / REMINDER_INTERVAL_MS(デフォルト60000) / MEDBOX_DB(デフォルト data/medbox.db、メモリデータベースは :memory:)。
2. テスト実行(19項目、すべて合格)
node --test3. MCP サーバーを単独起動(AI アシスタントの stdio 呼び出し用)
node src/mcp-server.js
# 支持 initialize / tools/list / tools/call
# 工具:query_medicines / recognize_medicine_image / compute_expiry /
# get_medication_advice / add_medicine / list_expiring4. 小程序を開く
微信开发者工具で miniprogram/ ディレクトリをインポート(appid は既に touristappid に設定されており、ゲストモードで直接プレビュー可能)。
実機デバッグ時は miniprogram/app.js 内の baseUrl をパソコンのローカルネットワーク IP(例:http://192.168.x.x:3000)に変更し、開発者ツールで「正当なドメイン名をチェックしない」にチェックを入れる。
主要フロー説明
撮影認識:
captureページでwx.chooseMedia→POST /api/ocr→ 現在は Mock 構造化フィールド(名称/規格/製造日/有効期限)を返却、ユーザーが確認後POST /api/medicinesでデータベースに登録。カウントダウン期限切れ:バックエンド
expiry.jsが当日のリアルタイム計算で残り日数と状態(safe/warning/expired)を算出;小程序のトップページと詳細ページで表示。定期スキャン + A2A プッシュ:
a2a-server.jsのリマインダーエージェントが一定間隔で期限間近の薬をスキャン →remindersテーブルに書き込み、A2A Task にカプセル化 → HTTP でユーザーエージェントの/tasksにプッシュ(エージェント間メッセージ転送)→ 小程序のreminderページでポーリング表示、既読マーク可能。MCP データインターフェース:AI アシスタントが stdio JSON-RPC 経由で6つのツールを呼び出し、必要に応じて薬品/認識/有効期限計算/服薬アドバイスを検索。
本番環境置き換え推奨(インターフェース契約は変更なし)
データベース:
node:sqlite→better-sqlite3(より高速、同期)。MCP:
src/mcp-server.jsの自作 JSON-RPC → 公式@modelcontextprotocol/sdk。REST:組み込み
http→Express/Fastify。OCR:
ocr.jsの Mock 分岐 → 腾讯云汎用印刷体 OCR または微信 OCR プラグインに接続(キー/資格が必要)。
既知の制限(MVP 範囲)
リマインダーチャネルはまず小程序内ポーリング、微信購読メッセージはインターフェースを残す。
ナレッジベースは組み込みの少数サンプルのみ、管理画面は後日対応(P2)。
アカウントシステムなし、単一家族のローカル識別(P2 でマルチ端末クラウド同期)。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for managing Homebox inventory via AI assistants, enabling item management, location organization, and label categorization.4MIT
- AlicenseNot gradedqualityDmaintenanceA comprehensive Model Context Protocol (MCP) server for medical document processing with advanced AI capabilities, including OCR, medical NER, local embeddings, and vector search.3581MIT
- AlicenseAqualityDmaintenanceMCP server for managing personal items with expiration dates, enabling AI agents to add, query, and scan barcode items via API Key authentication.59MIT
- FlicenseCqualityCmaintenanceAn MCP server that exposes Homebox inventory management as tools for AI agents, enabling search, add, update, delete products, locations, tags, and maintenance entries.171
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
Hosted MCP server exposing US hospital procedure cost data to AI assistants
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tomwugdgz/happy-medbox'
If you have feedback or need assistance with the MCP directory API, please join our Discord server