Wellness Planner

Wellness Planner

Integrates simulated health data and task management to provide energy-aware scheduling based on calculated readiness scores. It allows users to query health summaries, manage tasks, and generate optimized daily schedules through a local SQLite database.

Category
访问服务器

README

Wellness Planner

A local MCP agent that queries personal health data and provides energy-aware task scheduling.

Data Note

This project uses simulated data. Health data is seeded from data/seed_db.py into a SQLite database. There is no Apple Health integration — real health data is not imported or synced.

Running the Code

Prerequisites

  • Python 3.14+
  • uv for dependency management

Standalone Agent (no MCP server required)

Run the Plan-and-Execute agent loop locally:

uv run python mcp_server/agent.py [YYYY-MM-DD]
  • Uses yesterday's date if no date is given.
  • Reads from data/health.db and data/todo.json.
  • Prints a daily brief: sleep, activity, heart rate, readiness score, and proposed schedule.

MCP Server (for Cursor)

The MCP server is spawned by Cursor when needed — you do not start it manually in a separate terminal.

  1. Configure Cursor to use the local MCP server (e.g. .cursor/mcp.json):
{
  "mcpServers": {
    "wellness-planner": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/wellness_planner", "python", "mcp_server/server.py"]
    }
  }
}
  1. Replace /path/to/wellness_planner with your actual project path.
  2. Cursor will spawn the server and communicate over stdio.

Other Commands

Command Purpose
uv run python main.py Placeholder entry point
uv run python data/seed_db.py Seed data/health.db with simulated data

MCP Tools

When the server is connected, these tools are available:

  • get_health_summary — Aggregated sleep, activity, and heart rate for a date
  • calculate_readiness_score — 1–10 readiness score for task timing
  • query_raw_logs — Run read-only SQL against the health DB
  • get_tasks — Load tasks from todo.json
  • propose_schedule — Energy-aware schedule based on readiness and tasks
  • get_data_dictionary — Schema introspection: column names, types, and sample values
  • run_analysis — Execute a pandas/sqlite analysis script locally; returns stdout
  • generate_chart — Produce a self-contained Observable Plot HTML chart
  • get_insights — Retrieve previously saved findings from the Fact Store
  • save_insight — Persist a discovered insight so it isn't re-computed next session

Testing

There are two layers to test: the skills directly, and the MCP tools through Cursor chat.

1. Test skills directly (fast, no Cursor needed)

Phase 1 — Sandbox execution:

uv run python -c "
from skills.sandbox import run_python_analysis
r = run_python_analysis('''
df = pd.read_sql('SELECT date, total_hours FROM sleep_logs ORDER BY date DESC LIMIT 7', __import__('sqlite3').connect(DB_PATH))
print(df.to_string(index=False))
''')
print(r['output'])
"

Phase 2 — Schema discovery:

uv run python -c "
from skills.schema import get_data_dictionary
import json
print(json.dumps(get_data_dictionary(), indent=2))
"

Phase 3 — Chart generation:

uv run python -c "
import sqlite3
from skills.visualization import generate_chart
rows = sqlite3.connect('data/health.db').execute('SELECT date, total_hours FROM sleep_logs ORDER BY date').fetchall()
r = generate_chart([{'date': r[0], 'total_hours': r[1]} for r in rows], 'Sleep Trend', 'date', 'total_hours')
print(r)
"

Then open the url value in a browser to see the chart.

Phase 4 — Fact Store:

uv run python -c "
from skills.memory import save_insight, get_insights, clear_insights
save_insight('test_key', 'test value', 'manual test')
print(get_insights())
clear_insights()
"

2. Test end-to-end through Cursor (the real agentic loop)

Ask the agent questions in chat and watch the MCP tool calls fire in sequence:

  • Schema discovery: "What tables and columns are in the health database?"
  • Analysis: "What's the correlation between my step count and sleep quality over the last 30 days?"
    • Should trigger: get_insightsget_data_dictionaryrun_analysissave_insight
  • Chart: "Show me my resting heart rate trend as a chart."
    • Should trigger: run_analysisgenerate_chart → returns a file path
  • Memory: "What do you already know about my health patterns?"
    • Should trigger: get_insights and return stored findings without re-running anything

3. Standalone agent CLI

uv run python mcp_server/agent.py 2026-02-18

Tests the non-MCP path (summarizer + readiness + scheduling) and confirms nothing broke during the Phase 1–4 additions.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选