个人健康追踪服务器

一个用于个人健康和幸福追踪的模型上下文协议服务器,提供锻炼、营养和日记记录的AI辅助分析工具。

  • by evangstav
  • Python
  • 本地部署
  • 9 星标
  • 更新于
在 GitHub 查看 evangstav/personal-mcp

使用说明

个人MCP服务器

用于个人健康和幸福跟踪的模型上下文协议服务器。该服务器提供工具和资源,用于跟踪锻炼、营养和每日日记条目,并通过Claude集成进行人工智能辅助分析。

特性

训练跟踪

  • 记录练习、集合和重复次数
  • 跟踪感知到的努力和锻炼后的感觉
  • 考虑康复因素计算安全训练重量
  • 历史锻炼分析
  • 肩部康复支持
  • 基于RPE的负载管理

营养管理

  • 记录膳食和个人食品
  • 追踪蛋白质和卡路里摄入量
  • 监控饥饿感和满意度
  • 每日营养目标和进展
  • 运动前后营养跟踪
  • 用餐时间分析

日志系统

  • 带有情绪和能量跟踪的每日条目
  • 睡眠质量和压力水平监测
  • 基于标签的组织
  • 趋势分析和见解
  • 锻炼、营养和幸福感之间的相关性分析
  • 情绪和能量水平的模式识别

安装

通过Smithery安装

通过以下方式自动安装克劳德桌面个人健康跟踪器 史密瑟里:

npx -y @smithery/cli install personal-mcp --client claude

先决条件

  • Python 3.10或更高版本
  • pip或uv包管理器

使用pip

pip install -e .

开发安装

git clone https://github.com/yourusername/personal-mcp.git
cd personal-mcp
uv pip install -e ".[dev]"

用法

基本服务器

使用默认设置运行服务器:

personal-mcp run

发展模式

使用热重新加载进行开发:

personal-mcp dev

MCP检查员

使用MCP检查器进行调试:

personal-mcp inspect

Claude桌面集成

安装到Claude桌面:

personal-mcp install --claude-desktop

配置选项

personal-mcp --help

可用选项:

  • --name:设置服务器名称(默认:“个人助理”)
  • --db-path:指定数据库位置
  • --dev:启用开发模式
  • --inspect:使用MCP检查器运行
  • -v, --verbose:启用详细日志记录

MCP工具

锻炼工具

# Log a workout
workout = {
    "date": "2024-01-07",
    "exercises": [
        {
            "name": "Bench Press",
            "sets": [
                {"weight": 135, "reps": 10, "rpe": 7}
            ]
        }
    ],
    "perceived_effort": 8
}

# Calculate training weights
params = {
    "exercise": "Bench Press",
    "base_weight": 200,
    "days_since_surgery": 90,
    "recent_pain_level": 2,
    "recent_rpe": 7
}

营养工具

# Log a meal
meal = {
    "meal_type": "lunch",
    "foods": [
        {
            "name": "Chicken Breast",
            "amount": 200,
            "unit": "g",
            "protein": 46,
            "calories": 330
        }
    ],
    "hunger_level": 7,
    "satisfaction_level": 8
}

# Check nutrition targets
targets = await mcp.call_tool("check_nutrition_targets", {"date": "2024-01-07"})

日志工具

# Create a journal entry
entry = {
    "entry_type": "daily",
    "content": "Great workout today...",
    "mood": 8,
    "energy": 7,
    "sleep_quality": 8,
    "stress_level": 3,
    "tags": ["workout", "recovery"]
}

# Analyze entries
analysis = await mcp.call_tool("analyze_journal_entries", {
    "start_date": "2024-01-01",
    "end_date": "2024-01-07"
})

发展

运行测试

# Run all tests
pytest

# Run with coverage
pytest --cov=personal_mcp

# Run specific test file
pytest tests/test_database.py

代码质量

# Format code
black src/personal_mcp

# Lint code
ruff check src/personal_mcp

# Type checking
mypy src/personal_mcp

项目结构

personal-mcp/
├── src/
│   └── personal_mcp/
│       ├── tools/
│       │   ├── workout.py
│       │   ├── nutrition.py
│       │   └── journal.py
│       ├── database.py
│       ├── models.py
│       ├── resources.py
│       ├── prompts.py
│       └── server.py
├── tests/
│   ├── test_database.py
│   ├── test_server.py
│   └── test_cli.py
├── pyproject.toml
└── mcp.json

贡献

  1. 分叉存储库
  2. 创建要素分支
  3. 提交您的更改
  4. 推到分支
  5. 创建拉取请求

许可证

此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。