Lifesign
Lifesign — ユーザーステータス & ヘルステレメトリー サーバー
軽量 HTTP サービス:スマートフォンから報告されたデバイス状態 + 健康データを受信し、 MCP(Model Context Protocol) を介して AI Agent に公開します。シングルプロセス、シングルポート。
✨ 特徴
📱 スマートフォン報告:iOS ショートカット
POST /ingestでバッテリー/位置/ネットワーク/健康スナップショットをプッシュ🤖 MCP ゲートウェイ:同一プロセスに
/mcpをマウントし、Hermes などの AI Agent が直接読み取り🏗️ シングルポート・シングルプロセス:アップロード + クエリ + MCP すべて 8764 を再利用、二次 HTTP hop なし
🐳 Docker 対応:GitHub Actions で自動ビルド、1Panel でワンクリック Compose デプロイ
Related MCP server: Rouse Context
🏗️ アーキテクチャ
手机 (iOS 快捷指令)
│ POST https://<your-domain>/user-status/ingest ← 仅上传经反代
▼
1Panel OpenResty (反向代理)
│ proxy_pass → <host-ip>:8764/ingest
▼
┌──────────────────────────────┐
│ FastAPI + FastMCP 同一进程 │
│ (单端口 8764) │
│ │
│ POST /ingest 手机上传 │
│ GET /query_all agent读取 │
│ /mcp MCP 网关 (同进程) │
└──────┬───────────────────────┘
│ 本机回环 http://127.0.0.1:8764/mcp
▼
Hermes Agent (AI)スマートフォンアップロード:パブリック HTTPS(リバースプロキシ経由)→
8764/ingestAI 読み取り:ローカルループバックで直接
8764/mcpに接続(パブリックネットワーク非経由)共有メモリ:MCP ツールは直接
app.storeを読み取り、シリアル化/二次リクエスト不要
🔌 エンドポイント
メソッド | パス | 認証 | 説明 |
|
| Bearer スマホ key | スマートフォンが最新ステータスを報告 |
|
| Bearer agent key | 完全なスナップショットを返す |
|
| なし | ヘルスチェック(Docker HEALTHCHECK 用) |
|
| なし(ローカルループバック) | MCP streamable-http エンドポイント |
🔑 認証と設定
識別用の共有鍵は2つだけ(識別子、フィールドレベルの認可ではない)。いずれも環境変数で上書き可能:
用途 | 環境変数 | デフォルト値(開発用のみ) | エンドポイント |
スマホ key |
|
|
|
agent key |
|
|
|
リスニングポート |
|
| —(run.sh で使用) |
⚠️ 本番環境では環境変数でデフォルト鍵を必ず上書きしてください。リポジトリ内のデフォルト値は使用しないでください。
🚀 クイックスタート
ローカル実行
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
./run.sh start # 后台启动 :8764
./run.sh status
./run.sh stopDocker 実行
# 本地构建
docker build -t lifesign:local .
docker run -d --name lifesign -p 8764:8764 \
-e USER_STATUS_PHONE_KEY='<phone-key>' \
-e USER_STATUS_AGENT_KEY='<agent-key>' \
lifesign:local1Panel Compose デプロイ(推奨)
1Panel → コンテナ → オーケストレーション で新しいオーケストレーションを作成し、
docker-compose.ymlを貼り付け;イメージは GitHub Actions で自動ビルドされ GHCR にプッシュ、デプロイ時に直接プル;
ポート
87641つだけ開放し、残りはリバースプロキシで処理。
スマートフォンからのデータ送信
# 经公网反代(手机端快捷指令用这个)
curl -s -X POST https://<your-domain>/user-status/ingest \
-H "Authorization: Bearer <phone-key>" \
-H "Content-Type: application/json" \
-d '{"deviceStage":{"battery":{"percentage":87,"is_charging":true}}}'
# 或内网直连
curl -s -X POST http://<host-ip>:8764/ingest \
-H "Authorization: Bearer <phone-key>" \
-H "Content-Type: application/json" \
-d '{"deviceStage":{"battery":{"percentage":87,"is_charging":true}}}'Hermes MCP 設定(config.yaml)
mcp_servers:
user-status:
type: streamable-http
url: http://127.0.0.1:8764/mcp # 本机回环,不走公网
connect_timeout: 10
timeout: 30確認:hermes mcp test user-status;Hermes 再起動後、ツールは mcp_user_status_* として登録されます。
🐳 Docker イメージビルド(GitHub Actions)
リポジトリに .github/workflows/docker-build.yml を内蔵:
トリガー:
mainへの push / 手動workflow_dispatch/ tag プッシュ成果物:
ghcr.io/<owner>/lifesign:latestと:<git-sha>のダブルタグプラットフォーム:
linux/amd64、linux/arm64説明:イメージはプライベート(リポジトリ private → GHCR パッケージ private)、1Panel デプロイ時は Docker 設定に GHCR ログイン認証情報(
ghcr.ioユーザー名 + PAT)を追加する必要があります。
✅ テスト
. .venv/bin/activate
python -m pytest tests/ -v🗂️ プロジェクト構成
lifesign/
├── app/
│ ├── main.py # FastAPI 入口(挂载 MCP 网关)
│ ├── mcp_server.py # FastMCP 工具定义(get_status/get_battery/...)
│ ├── store.py # 线程安全内存存储
│ ├── models/status.py # Pydantic 数据模型
│ └── routers/ # /ingest 与 /query_all 路由
├── config/clients.example.yaml # 身份配置模板(真实文件勿提交)
├── panel_api.py # 1Panel API 签名请求辅助脚本
├── docker-compose.yml # 1Panel Compose 部署编排
├── Dockerfile
├── run.sh # 本机后台启停
└── tests/📜 ライセンス
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Real-time planetary signal engine and Model Context Protocol (MCP) server for autonomous AI agents.
Hosted MCP server for live public-data APIs and Skills for AI agents.
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA real-time system diagnostics MCP server that gives AI agents live access to CPU, RAM, disk, network, processes, and hardware health metrics, with zero cloud dependency.7Apache 2.0
- AlicenseNot gradedqualityBmaintenanceTurn your Android phone into an MCP server. AI assistants connect on demand, query your health data, notifications, app usage, and take actions on your device — all end-to-end encrypted, no cloud sync.14Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to control Android phones via MCP and HTTP. Supports screen capture, taps, swipes, text input, and app management.7AGPL 3.0
- AlicenseNot gradedqualityBmaintenanceLocal-first MCP server that enables AI agents to safely control and observe Android mobile devices, supporting device diagnostics, app lifecycle management, async task execution, and performance monitoring through a policy-constrained interface with explicit confirmations.1Apache 2.0