Sapphire User MCP Server
Sapphire User MCP Server
Sapphire Wellness App のユーザープロファイルデータを AI アシスタントに公開する Python Model Context Protocol (MCP) サーバーです。健康アラート、パーソナライズされたレコメンデーション、パートナーサービスサブスクリプションなどが含まれます。
公開ツール
ツール | 説明 |
| メトリクスのしきい値によってトリガーされる健康アラート(異常なバイタル、低活動など) |
| 関連性スコアでランク付けされたパーソナライズされたパートナーサービスレコメンデーション |
| 完全なサービス詳細を含むアクティブなパートナーサービスサブスクリプション |
Related MCP server: Sapphire Wellness MCP Server
アーキテクチャ
Agent Container
│ HTTP SSE
▼
sapphire-user-mcp:10003
│
├──httpx──▶ User Profile API:8091
│
└──httpx──▶ Partner Service API:8085Transport: HTTP SSE — マルチコンテナデプロイメントに必要(stdio は、エージェントが MCP サーバーを子プロセスとして起動する場合にのみ機能します)
上流 API: すべてのツールは HTTP 経由で REST API を呼び出します — データベースへの直接アクセスはありません
フレームワーク: FastMCP と Pydantic v2 レスポンスモデル
プロジェクト構造
SAPPHIRE-USER-MCP/
├── sapphire_user/
│ ├── server.py # FastMCP app + SSE entry point
│ ├── config.py # Settings (API URLs, HOST, PORT via env)
│ ├── models/ # Pydantic response models
│ │ ├── alerts.py
│ │ ├── recommendations.py
│ │ ├── partner_service.py
│ │ └── subscriptions.py
│ └── tools/ # MCP tool definitions
│ ├── alerts.py
│ ├── recommendations.py
│ └── subscriptions.py
├── pyproject.toml
├── Dockerfile
└── .env.example前提条件
Python 3.11+
実行中の Sapphire User Profile API(デフォルト:
http://localhost:8091)実行中の Sapphire Partner Service API(デフォルト:
http://localhost:8085)
クイックスタート
ローカル開発
# 1. Create and activate a virtual environment
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
# 2. Install dependencies
pip install -e .
# 3. Configure environment
cp .env.example .env
# Edit .env — set USER_PROFILE_API_BASE_URL and PARTNER_SERVICE_API_BASE_URL
# 4. Run the server
python -m sapphire_user.server
# Server starts at http://0.0.0.0:8001コンテナ化(Docker)
# Build the image
docker build -t sapphire-user-mcp .
# Run the container
docker run -p 10003:10003 --env-file .env sapphire-user-mcpMCP サーバーは http://localhost:10003/sse で利用可能になります。
エージェントコンテナを接続するには、以下を設定します:
MCP_SERVER_URL=http://sapphire-user-mcp:10003/sse設定
すべての設定は環境変数(または .env ファイル)から読み取られます:
変数 | デフォルト | 説明 |
|
| MCP サーバーのバインドアドレス |
|
| MCP サーバーのバインドポート |
|
| Sapphire User Profile API のベース URL |
|
| Sapphire Partner Service API のベース URL |
ツールリファレンス
すべてのツールは単一の user_email パラメータを受け取ります。
パラメータ | 型 | 説明 |
|
| ユーザーのメールアドレス(例: |
get_user_alerts
User Profile API からユーザーの健康アラートを取得します。各アラートには以下が含まれます:
severity — アラートの緊急度レベル(例:
critical,warning)category — アラートをトリガーしたメトリクスカテゴリ
alertMessage — アラートの人間が読める説明
metricName / metricType — しきい値を超えた特定のメトリクス
get_user_recommendations
関連性スコアでランク付けされたパーソナライズされたパートナーサービスレコメンデーションを返します。各レコメンデーションには以下が含まれます:
relevanceScore — サービスがユーザーの健康プロファイルにどの程度一致するかを示す整数ランキング
partnerService — サービス名、カテゴリ、タイプ、説明
generatedAt — レコメンデーションが計算されたタイムスタンプ
get_user_subscriptions
ユーザーのアクティブなパートナーサービスサブスクリプションを取得し、Partner Service API から完全なサービス詳細を各サブスクリプションに追加します。各サブスクリプションには以下が含まれます:
partnerServiceId — 登録されたサービス識別子
isActive — サブスクリプションが現在アクティブかどうか
associationContext — 契約終了日およびその他のコンテキストメタデータ
service_details — 完全なサービス仕様、価格、可用性、契約情報
ツールの検査
MCP Inspector を使用してツールスキーマを調べ、テスト呼び出しを行います:
npx @modelcontextprotocol/inspector http://localhost:8001/sseClaude Desktop への接続
claude_desktop_config.json に追加します:
{
"mcpServers": {
"sapphire-user": {
"url": "http://localhost:8001/sse"
}
}
}次に Claude に: "sarah.chen@sapphirewellness.com にはどのような健康アラートがありますか?" と尋ねると、提供されたメールアドレスで get_user_alerts が呼び出されます。
拡張
新しいツールの追加:
sapphire_user/models/<name>.pyを作成 — Pydantic レスポンスモデルsapphire_user/tools/<name>.pyを作成 — 適切な API を呼び出す@mcp.tool()定義server.pyに登録
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
- FlicenseNot gradedqualityCmaintenanceExposes user profile data from the Sapphire Wellness App via MCP tools for health alerts, personalised recommendations, and partner service subscriptions.
- FlicenseNot gradedqualityCmaintenanceExposes health metrics from the Sapphire Wellness App to AI assistants via MCP, enabling queries on activity, blood pressure, glucose, heart rate, sleep, and SpO2 data.
- FlicenseNot gradedqualityCmaintenanceExposes health metrics from the Sapphire Wellness App to AI assistants, enabling natural language queries for activity, blood pressure, glucose, heart rate, sleep, and SpO2 data.
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to access Sapphire Wellness user data, including health alerts, personalized recommendations, and partner service subscriptions.
Related MCP Connectors
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
Connect e-commerce and marketing data to AI assistants via MCP.
Connect your Oura Ring account securely in minutes. Enable authorized access to your sleep, activi…
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/shantaramvernekar/sapphire-user-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server