Skip to main content
Glama
shantaramvernekar

Sapphire User MCP Server

Sapphire User MCP Server

一个 Python Model Context Protocol (MCP) 服务器,向 AI 助手公开 Sapphire Wellness App 的用户档案数据——包括健康警报、个性化推荐和合作伙伴服务订阅。

公开的工具

工具

描述

get_user_alerts

由指标阈值触发的健康警报(异常生命体征、低活动量等)

get_user_recommendations

按相关度评分排序的个性化合作伙伴服务推荐

get_user_subscriptions

包含完整服务详情的活跃合作伙伴服务订阅

Related MCP server: Sapphire Wellness MCP Server

架构

Agent Container
      │  HTTP SSE
      ▼
sapphire-user-mcp:10003
      │
      ├──httpx──▶  User Profile API:8091
      │
      └──httpx──▶  Partner Service API:8085
  • 传输:HTTP SSE — 多容器部署所必需(仅当代理将 MCP 服务器作为子进程启动时,stdio 才有效)

  • 上游 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-mcp

MCP 服务器将在 http://localhost:10003/sse 可用。

要连接您的代理容器,请设置:

MCP_SERVER_URL=http://sapphire-user-mcp:10003/sse

配置

所有设置均从环境变量(或 .env 文件)读取:

变量

默认值

描述

HOST

0.0.0.0

MCP 服务器绑定地址

PORT

8001

MCP 服务器绑定端口

USER_PROFILE_API_BASE_URL

http://localhost:8091

Sapphire User Profile API 基础 URL

PARTNER_SERVICE_API_BASE_URL

http://localhost:8085

Sapphire Partner Service API 基础 URL

工具参考

所有工具都接受单个 user_email 参数。

参数

类型

描述

user_email

str

用户的电子邮件地址(例如 sarah.chen@sapphirewellness.com

get_user_alerts

从 User Profile API 获取用户的健康警报。每条警报包括:

  • severity — 警报紧急程度(例如 criticalwarning

  • 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/sse

连接到 Claude Desktop

添加到您的 claude_desktop_config.json

{
  "mcpServers": {
    "sapphire-user": {
      "url": "http://localhost:8001/sse"
    }
  }
}

然后询问 Claude:sarah.chen@sapphirewellness.com 有哪些健康警报?” 它将使用提供的电子邮件调用 get_user_alerts

扩展

添加新工具:

  1. 创建 sapphire_user/models/<name>.py — Pydantic 响应模型

  2. 创建 sapphire_user/tools/<name>.py — 调用相应 API 的 @mcp.tool() 定义

  3. server.py 中注册

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all related MCP servers

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…

View all MCP Connectors

Latest Blog Posts

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