sleepon-mcp
Enables AI assistants to analyze sleep quality, compare nights, generate reports, and get personalized improvement tips using Sleepon sleep tracker data.
README
Sleepon MCP Server
An MCP (Model Context Protocol) server that connects AI assistants like Claude to your Sleepon sleep tracker data. Ask your AI to analyze your sleep quality, compare nights, generate reports, and get personalized improvement tips — all powered by your real sleep data.
Features
- 🛏️ Daily Sleep Summary — sleep score, efficiency, duration, and stage breakdown
- 📊 Detailed Segments — per-segment heart rate, blood oxygen (SpO2), HRV, movement, and ODI
- 📅 Sleep Calendar — see which days have data over a date range
- 📈 Trend Analysis — track how your sleep metrics change over time
- 🏷️ Sleep Labels — view user-added tags (e.g. "exercised", "drank coffee") and notes
- 🤖 Built-in Prompts — one-click deep analysis, comparison, reports, and improvement tips
Quick Start
1. Install
# Using uvx (recommended, auto-downloads without install)
uvx sleepon-mcp
# Or install via pip
pip install sleepon-mcp
2. Configure Claude Desktop
To use this MCP server with Claude Desktop, you need to add it to your configuration file.
Step 1: Open the configuration file based on your operating system:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
(Tip: You can quickly open this from Claude Desktop: Menu -> Settings -> Developer -> Edit Config)
Step 2: Add the sleepon server to the mcpServers object. Replace the email and password with your actual Sleepon account credentials.
{
"mcpServers": {
"sleepon": {
"command": "uvx",
"args": ["sleepon-mcp"],
"env": {
"SLEEPON_USERNAME": "your-sleepon-email@example.com",
"SLEEPON_PASSWORD": "your-password"
}
}
}
}
Note: uvx is recommended as it automatically manages the Python environment for you. If you prefer to use your system Python, you can use "command": "python", "args": ["-m", "sleepon_mcp.server"] instead.
⚠️ Troubleshooting:
spawn uvx ENOENTError If Claude Desktop shows anENOENTerror, it means it cannot find theuvxcommand in its system path. To fix this, you must provide the absolute path touvx.
- Open your terminal and run
which uvx(Mac/Linux) orwhere uvx(Windows).- Copy the resulting path (e.g.,
/Users/username/.pyenv/shims/uvxorC:\\Users\\username\\.cargo\\bin\\uvx.exe).- Replace
"uvx"in the"command"field of the config with this absolute path.
3. Restart Claude Desktop
- Completely quit Claude Desktop (
Cmd+Qon Mac, or right-click the system tray icon and exit on Windows). - Re-open Claude Desktop.
- Look for the hammer icon (🔨) in the chat input area. Click on it to see the available Sleepon tools and prompts.
Available Tools
| Tool | Description |
|---|---|
login_and_check_status |
Verify that your credentials are correct and the API is reachable |
get_user_profile |
Get your Sleepon user profile information |
get_daily_sleep_summary |
Get complete sleep summary for a specific date |
get_detailed_sleep_segments |
Get detailed segment data (heart rate, SpO2, HRV, sleep stages) |
get_sleep_calendar |
View which days have data in a date range |
get_sleep_trend |
Get sleep metric trends over a date range |
get_sleep_labels |
Get user-added sleep labels and notes for a date |
get_latest_data_time |
Find the most recent data sync timestamp |
Built-in Prompts
These prompts guide the AI through multi-step analysis workflows:
| Prompt | Description |
|---|---|
analyze_sleep |
Comprehensive analysis of a single night (summary + segments + labels) |
compare_sleep |
Side-by-side comparison of two nights with tables |
sleep_report |
Full report for a date range (trends, best/worst days, health alerts) |
sleep_improvement_tips |
Personalized recommendations based on your recent data |
Example Conversations
- "Analyze my sleep from last night"
- "Compare my sleep on Monday vs Friday"
- "Generate a sleep report for the past month"
- "How can I improve my sleep quality?"
Development
# Clone the repo
git clone https://github.com/sleepon-official/sleepon_mcp.git
cd sleepon_mcp
# Install in development mode
pip install -e .
# Test with MCP Inspector
npx -y @modelcontextprotocol/inspector sleepon-mcp
Environment Variables
| Variable | Required | Description |
|---|---|---|
SLEEPON_USERNAME |
Yes | Your Sleepon account email |
SLEEPON_PASSWORD |
Yes | Your Sleepon account password |
Requirements
- Python >= 3.10
- A Sleepon account with a paired sleep tracker
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。