# masterclass-mcp

Serveur MCP (Model Context Protocol) pour le calcul nutritionnel et la génération de plans alimentaires personnalisés. Ce package fournit des outils pour calculer les besoins nutritionnels, le métabolisme basal et la répartition des macronutriments en fonction des profils utilisateurs.

## Features

- **Metabolism Calculation**: Calculate basal metabolic rate based on gender, age, weight, and height
- **Macronutrient Distribution**: Generate optimal macronutrient ratios based on fitness goals (muscle gain, weight loss, maintenance)
- **Nutrition Planning**: Calculate complete nutritional needs based on user profile
- **Daily Meal Generation**: Generate structured daily meal plans with recipes and instructions
- **Grocery List Generation**: Create organized grocery lists for meal planning

## Tools

The server provides the following MCP tools:

- `calculMetabolism`: Calculate basal metabolic rate
- `calculRepartition`: Calculate macronutrient distribution based on goals and activity level
- `calculNutrition`: Calculate complete nutritional needs based on user profile

## Prompts

The server also provides the following prompt generators:

- `generateDailyMeals`: Generate a structured daily meal plan with detailed recipes
- `generateCourseList`: Generate an organized grocery list by categories

## User Profile Schema

The user profile includes:

- `gender`: "male" or "female"
- `age`: User's age in years
- `weight`: User's weight in kilograms
- `height`: User's height in centimeters
- `activityLevel`: Activity multiplier (typically 1.2-2.0)
- `objective`: "muscleGain", "weightLoss", or "maintenance"
- `dietType`: "vegetarian", "vegan", "noPork", or "none"
- `intolerances`: String describing food intolerances

## Installation

```bash
# Installation avec pnpm (recommandé)
pnpm add masterclass-mcp

# Ou avec npm
npm install masterclass-mcp

# Ou avec yarn
yarn add masterclass-mcp
```

## Utilisation

```typescript
// Importer le serveur MCP
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { calculNutrition } from "masterclass-mcp/dist/tools/calculate.js";

// Exemple d'utilisation
const profile = {
  gender: "male",
  age: 30,
  weight: 75,
  height: 180,
  activityLevel: 1.55, // Activité modérée
  objective: "maintenance",
  dietType: "none"
};

const nutritionResult = calculNutrition(profile);
console.log(nutritionResult);
```

## Développement

```bash
# Cloner le repo
git clone https://github.com/votre-username/fit-mcp.git

# Installer les dépendances avec pnpm
pnpm install

# Compiler le projet
pnpm run build

# Démarrer le serveur
npm start
```

## Development

```bash
# Install dependencies
npm install

# Run in development mode
npm run dev
```

## Technologies

- TypeScript
- Model Context Protocol (MCP)
- Zod for schema validation

## License

MIT
