Token导航 LogoToken导航TokenDH.com
Health & Fitness Coach MCP logo
AI代理SSE官方级别未说明来源级核验

Health & Fitness Coach MCP

MCP Server

一个基于Model Context Protocol (MCP)的AI健身跟踪应用,提供智能健身数据管理和个性化训练计划生成。

工具数

0

提示词数

0

GitHub Stars

12

资源数

0
TypeScriptClaudeAI代理Claude DesktopClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Dinesh-Satram

提供方

Dinesh-Satram

最后核验

2026/5/17 20:23

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

健康与健身教练 MCP 💪

![Deploy with Vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fyour-username%2Fhealth-fitness-coach-mcp&env=OPENAI_API_KEY)

🎯 这个项目是什么?

健康与健身教练 MCP 是一款全面的AI健身追踪应用,它通过(某种方式,原文未完整)弥合了传统健身应用与智能AI辅助之间的鸿沟 模型上下文协议(MCP)根据上面的信息,执行如下指令:

这个项目由两个主要部分组成:

  1. 🌐 Web应用程序一个现代化的Next.js健身仪表盘,用于记录活动和追踪进度
  2. 🤖 MCP服务器一个符合协议规范的服务器,使AI工具(Cursor、Claude Desktop等)能够智能地与您的健身数据进行交互

🏗️ 系统架构与MCP集成

┌─────────────────────────────────────────────────────────────────────────────┐
│                    HEALTH & FITNESS COACH ECOSYSTEM                        │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────────────┐    ┌─────────────────────┐    ┌─────────────────┐  │
│  │   🌐 WEB APP        │    │   🤖 MCP SERVER     │    │  🧠 AI CLIENTS  │  │
│  │   (Next.js)         │    │   (Protocol Layer)  │    │  (Cursor/Claude) │  │
│  │                     │    │                     │    │                 │  │
│  │ • Fitness Dashboard │◄──►│ • 7 Smart Tools     │◄──►│ • Natural Lang  │  │
│  │ • Activity Logging  │    │ • Data Processing   │    │ • Context Aware │  │
│  │ • Progress Tracking │    │ • Context Analysis  │    │ • Plan Generate │  │
│  │ • Plan Visualization│    │ • API Integration   │    │ • Smart Queries │  │
│  │ • Real-time Updates │    │ • Protocol Compliance│   │ • Tool Calling  │  │
│  └─────────────────────┘    └─────────────────────┘    └─────────────────┘  │
│           │                           │                           │          │
│           └───────────────────────────┼───────────────────────────┘          │
│                                       │                                      │
│  ┌─────────────────────────────────────▼─────────────────────────────────────┐ │
│  │                     📊 UNIFIED DATA LAYER                               │ │
│  │                                                                         │ │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐   │ │
│  │  │ 🏋️ Workouts │  │ 🍎 Nutrition │  │ 📋 Plans    │  │ 💭 Feedback │   │ │
│  │  │ • Sessions  │  │ • Meals      │  │ • AI-Gen    │  │ • Progress  │   │ │
│  │  │ • Duration  │  │ • Calories   │  │ • Weekly    │  │ • Notes     │   │ │
│  │  │ • Types     │  │ • Items      │  │ • Daily     │  │ • Insights  │   │ │
│  │  └─────────────┘  └─────────────┘  └─────────────┘  └─────────────┘   │ │
│  └─────────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘

🤖 什么是MCP服务器,以及它为何重要?

模型上下文协议(MCP)解析

--- 模型上下文协议 这是一种标准化的方式,让人工智能应用程序能够连接到外部数据源和工具。可以将其视为一种通用翻译器,使像Claude Desktop或Cursor这样的人工智能助手能够理解和与您的健身数据进行交互。

MCP服务器在本应用中的角色

我们的MCP服务器作为 智能健身数据网关 好的,我会将原文内容翻译成中文

  1. 连接人工智能与健身数据

- 将自然语言健身查询转换为结构化数据操作 - 启用AI工具读取、编写和分析您的健身信息 - 根据您的实际健身历史提供情境感知的回复

  1. 🧠 启用智能辅导

- AI可以问:“我这周做了哪些锻炼?”→ MCP获取并分析你的数据 - AI可以建议:“制定锻炼计划”→ MCP生成个性化方案 - AI可以追踪:“记录我的30分钟跑步”→ MCP存储并更新你的进度

  1. 📊 提供丰富的上下文

- 当你向AI寻求健身建议时,它能访问到你的完整历史记录 - 人工智能可以识别模式,提出改进建议,并跟踪长期进展 - 根据您的实际表现数据,提供个性化辅导

🛠️ MCP 服务器工具与功能

MCP服务器公开了 7个智能工具 那将改变人工智能与健身数据的交互方式:

核心日志工具

log-workout 运动课程追踪

// What it does: Records workout sessions with intelligent categorization
{
  tool: "log-workout",
  parameters: {
    userId: "user123",
    date: "2025-01-07", 
    type: "strength training", // Auto-categorized: cardio, strength, flexibility
    duration: 45,              // Minutes of activity
    distance: 0                // Optional for cardio workouts
  }
}
// AI Context: "I did 45 minutes of strength training today"

log-nutrition 饮食与卡路里追踪

// What it does: Logs meals with smart nutritional analysis
{
  tool: "log-nutrition", 
  parameters: {
    userId: "user123",
    date: "2025-01-07",
    meal: "breakfast",                    // Auto-detected: breakfast/lunch/dinner/snack
    items: ["oatmeal", "banana", "almonds"], // Natural language food items
    calories: 350                         // Calculated or estimated
  }
}
// AI Context: "I had oatmeal with banana and almonds for breakfast"

log-feedback 进度与动力追踪

// What it does: Captures subjective fitness experiences and progress notes
{
  tool: "log-feedback",
  parameters: {
    userId: "user123", 
    date: "2025-01-07",
    notes: "Feeling stronger after consistent workouts. Ready for heavier weights!"
  }
}
// AI Context: Tracks motivation, energy levels, and subjective progress

智能与规划工具

generate-plan AI赋能的健身规划

// What it does: Creates personalized workout and nutrition plans
{
  tool: "generate-plan",
  parameters: {
    userId: "user123"
  }
}
// AI Magic: Analyzes your history, preferences, and goals to create:
// - Tomorrow's workout routine
// - Weekly exercise schedule  
// - Meal recommendations
// - Progressive difficulty adjustments

view-context 全面的健身分析

// What it does: Provides complete fitness profile for AI decision-making
{
  tool: "view-context", 
  parameters: {
    userId: "user123"
  }
}
// Returns: Complete fitness history, patterns, goals, and insights
// Enables AI to make informed coaching decisions

set-weekly-target 目标设定与追踪

// What it does: Establishes and tracks fitness goals
{
  tool: "set-weekly-target",
  parameters: {
    userId: "user123",
    weekStart: "2025-01-06", 
    targetRuns: 3,           // Weekly cardio goal
    calorieBudget: 2000      // Daily calorie target
  }
}
// AI Context: Enables goal-oriented coaching and progress tracking

实用工具

echo 系统健康与测试

// What it does: Tests MCP connectivity and system health
{
  tool: "echo",
  parameters: {
    message: "Testing MCP connection"
  }
}
// Usage: Debugging and ensuring MCP server is responsive

MCP数据流与AI集成

人工智能查询如何转化为健身行动

┌─────────────────────────────────────────────────────────────────────────────┐
│                           MCP DATA FLOW                                    │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  User in AI Tool: "I did 20 push-ups for 15 minutes today"                 │
│         │                                                                   │
│         ▼                                                                   │
│  ┌─────────────────────┐    ┌─────────────────────┐    ┌─────────────────┐  │
│  │   🧠 AI PROCESSING  │    │   🤖 MCP PROTOCOL   │    │  📊 DATA STORE  │  │
│  │                     │    │                     │    │                 │  │
│  │ • Parse intent      │───►│ • Tool selection    │───►│ • Store workout │  │
│  │ • Extract data      │    │ • Parameter mapping │    │ • Update stats  │  │
│  │ • Choose action     │    │ • Execute tool call │    │ • Calculate     │  │
│  │ • Format response   │◄───│ • Return results    │◄───│   progress      │  │
│  └─────────────────────┘    └─────────────────────┘    └─────────────────┘  │
│         │                                                                   │
│         ▼                                                                   │
│  AI Response: "Great! I've logged your 15-minute push-up session.           │
│               You're at 15/60 minutes for your daily workout goal."         │
└─────────────────────────────────────────────────────────────────────────────┘

网络应用 ↔ MCP服务器集成

┌─────────────────────────────────────────────────────────────────────────────┐
│                        DUAL-INTERFACE SYSTEM                               │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────────────┐                    ┌─────────────────────┐         │
│  │   🌐 WEB INTERFACE  │                    │  🤖 AI INTERFACE    │         │
│  │                     │                    │                     │         │
│  │ • Visual dashboard  │                    │ • Natural language  │         │
│  │ • Click logging     │                    │ • Context queries   │         │
│  │ • Progress charts   │                    │ • Smart planning    │         │
│  │ • Plan display     │                    │ • Pattern analysis  │         │
│  └─────────────────────┘                    └─────────────────────┘         │
│           │                                           │                     │
│           ▼                                           ▼                     │
│  ┌─────────────────────────────────────────────────────────────────────────┐ │
│  │                     🔄 MCP SERVER CORE                                 │ │
│  │                                                                         │ │
│  │  • Unified data access for both interfaces                             │ │
│  │  • Consistent business logic and validation                            │ │
│  │  • Real-time synchronization between web and AI                        │ │
│  │  • Intelligent caching and performance optimization                    │ │
│  └─────────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘

🎯 现实应用场景

场景1:日常锻炼记录

👤 User in Cursor: "I just finished a 30-minute HIIT workout"

🤖 AI + MCP Process:
1. AI recognizes workout logging intent
2. MCP calls `log-workout` tool
3. Stores: type="HIIT", duration=30, date=today
4. Updates daily progress counters
5. AI responds with encouragement and progress update

📱 Web App: Automatically shows updated workout minutes and exercise completion

场景2:智能计划生成

👤 User in Claude: "Create a workout plan for tomorrow based on what I did this week"

🤖 AI + MCP Process:
1. MCP calls `view-context` to analyze week's activities
2. AI identifies patterns: mostly upper body, low cardio
3. MCP calls `generate-plan` with context
4. Creates balanced plan emphasizing legs and cardio
5. Stores plan for tomorrow

📱 Web App: Tomorrow's workout section populates with AI-generated exercises

场景3:营养指导

👤 User in AI: "I'm trying to eat healthier, what should I have for lunch?"

�� AI + MCP Process:
1. MCP calls `view-context` to check today's meals and calorie goals
2. AI analyzes nutritional gaps and calorie budget
3. Suggests specific meal with calorie count
4. User confirms: "I'll have the grilled chicken salad"
5. MCP calls `log-nutrition` to record the meal

📱 Web App: Updates nutrition progress and meal history

🌟 MCP集成的主要优势

对于用户

  • 🎯 个性化AI教练AI拥有您健身旅程的完整背景信息
  • 自然交互用简单的英语与AI谈谈健身目标
  • 📊 智能洞察人工智能可以识别模式并提出改进建议
  • 流畅体验网页应用和AI工具之间的数据自动同步

对于开发者

  • 🔌 协议合规性标准MCP实现可与任何MCP客户端配合使用
  • 🛠️ 可扩展架构易于添加新工具和功能
  • 📈 丰富上下文人工智能工具获取全面的健身数据以做出更好决策
  • 灵活部署与Cursor、Claude Desktop或自定义AI工具配合使用

用于人工智能应用

  • 领域专业知识专业知识和数据处理方面的健身知识
  • 📋 结构化数据提供清晰、有条理的健身信息以供分析
  • ⚡ 实时更新实时数据同步以获取当前信息
  • 🎨 丰富的回复根据上下文,提供个性化健身指导反馈

🚀 快速入门指南

设置MCP服务器

git clone https://github.com/your-username/health-fitness-coach-mcp.git
cd health-fitness-coach-mcp
npm install
cp env.example .env.local
# Add OPENAI_API_KEY for AI-generated plans
npm run dev

2. 连接到AI工具

光标配置

{
  "mcpServers": {
    "health-fitness-coach": {
      "url": "http://localhost:3000/sse"
    }
  }
}

克劳德桌面配置

{
  "mcpServers": {
    "health-fitness-coach": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "http://localhost:3000/mcp"]
    }
  }
}

3. 测试集成

# Test MCP tools directly
npm run test:fitness

# Test specific endpoints
curl http://localhost:3000/api/context?userId=default-user

4. 开始使用

  • Web App访问 http://localhost:3000 用于视觉健身追踪
  • 人工智能集成向你的AI助手提出与健身相关的问题
  • 原文内容:Natural Language“记录我的锻炼”,“制定一个计划”,“我做得怎么样?”

🔧 技术实现细节

MCP协议合规性

// MCP-compliant tool definition
export const logWorkoutTool = {
  name: "log-workout",
  description: "Log a workout session with type, duration, and optional distance",
  inputSchema: {
    type: "object",
    properties: {
      userId: { type: "string", description: "Unique user identifier" },
      date: { type: "string", description: "Date in YYYY-MM-DD format" },
      type: { type: "string", description: "Workout type (e.g., 'running', 'strength')" },
      duration: { type: "number", description: "Duration in minutes" },
      distance: { type: "number", description: "Distance in kilometers (optional)" }
    },
    required: ["userId", "date", "type", "duration"]
  }
}

数据存储与检索

// In-memory stores with persistence hooks
export const workoutStore = createInMemoryStore()
export const nutritionStore = createInMemoryStore()
export const planStore = createInMemoryStore
()

// MCP tool implementation
export async function logWorkout(params: LogWorkoutParams) {
  const entry: WorkoutEntry = {
    id: generateId(),
    userId: params.userId,
    date: params.date,
    type: params.type,
    duration: params.duration,
    distance: params.distance,
    timestamp: new Date().toISOString()
  }
  
  workoutStore.set(entry.id, entry)
  return { success: true, entry }
}

人工智能集成层

// Chat interface with MCP integration
export async function processFitnessQuery(message: string, userId: string) {
  const intent = detectIntent(message)
  
  switch (intent.type) {
    case 'log_workout':
      return await callMCPTool('log-workout', {
        userId,
        date: intent.date,
        type: intent.workoutType,
        duration: intent.duration
      })
      
    case 'generate_plan':
      return await callMCPTool('generate-plan', { userId })
      
    case 'view_progress':
      return await callMCPTool('view-context', { userId })
  }
}

🧪 测试与开发

可用的测试脚本

# Test all MCP tools
npm run test:fitness

# Test HTTP transport
npm run test:http

# Test MCP integration
npm run test:mcp

# Debug tool functionality  
npm run debug:tools

MCP工具测试

// Test workout logging
const result = await mcpClient.callTool('log-workout', {
  userId: 'test-user',
  date: '2025-01-07',
  type: 'running',
  duration: 30,
  distance: 5.0
})

console.log('Workout logged:', result)

🚀 部署选项

本地开发

  • npm run dev 用于开发服务器
  • MCP服务器可用地址为 http://localhost:3000/mcp
  • 网页界面位于 http://localhost:3000

生产部署

  • 一键部署到Vercel
  • 配置环境变量(OPENAI_API_KEY)
  • MCP服务器可在您的域名下自动访问

自定义部署

  • Docker对容器化部署的支持
  • 不同设置下的环境变量配置
  • 支持多用户的可扩展架构

🔧 环境配置

必需变量

# OpenAI API key for AI-generated fitness plans
OPENAI_API_KEY=your_openai_api_key_here

# Optional Redis for enhanced performance
UPSTASH_REDIS_REST_URL=your_redis_url
UPSTASH_REDIS_REST_TOKEN=your_redis_token

可选配置

# Custom user ID for single-user setups
DEFAULT_USER_ID=my-fitness-journey

# Logging level for debugging
LOG_LEVEL=debug

# Custom port for development
PORT=3000

🤝 贡献与扩展

添加新的MCP工具

// Create new tool in tools/ directory
export const myCustomTool = {
  name: "my-custom-tool",
  description: "Description of what this tool does",
  inputSchema: {
    // Define parameters
  },
  handler: async (params) => {
    // Implementation
  }
}

// Register in tools/index.ts
export const tools = [
  // ... existing tools
  myCustomTool
]

扩展Web界面

  • 在其中添加新组件 components/ 目录
  • 创建API路由于 app/api/ 用于新功能
  • 更新主仪表板中的内容 app/page.tsx

自定义AI集成

  • 实现额外的MCP客户端
  • 添加对其他AI平台的支持
  • 创建自定义查询处理逻辑

许可证与使用

麻省理工学院许可证 - 请随意使用此项目作为您自己的MCP服务器和健身应用程序的基础。

本项目展示了如何构建可投入生产的MCP服务器,以实现人工智能工具与特定领域应用的连接,为其他领域的类似集成提供了一个模板。

______________________________________________________________________

由模型上下文协议提供支持\ *将人工智能智能与真实世界健身数据相连接*

目录标签

目录标签

TypeScriptClaudeAI代理AI健身教练本地部署健身数据管理个性化训练计划健康追踪MCP协议

支持客户端

Claude DesktopClaudeCursor

接入字段

传输方式(transport,传输协议)

SSE

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

SSEapi-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP