Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CodeWithCJ/SparkyFitness/llms.txt

Use this file to discover all available pages before exploring further.

SparkyFitness includes a built-in Model Context Protocol (MCP) server that lets any MCP-compatible AI assistant — Claude Desktop, Cursor, or your own agent — read and write your health data through a structured, authenticated protocol. Once connected, your AI assistant gains the ability to log food and workouts, analyze trends, manage habits and goals, and run a guided daily check-in, all from a natural language prompt in your preferred AI client.

What is MCP?

The Model Context Protocol is an open standard that lets AI clients call structured tools exposed by a server over HTTP. Rather than copy-pasting data into a chat window, your AI client calls a SparkyFitness tool directly — the server handles the database read or write, and the result comes back as structured data the model can reason about. SparkyFitness’s MCP server is served in-process by the main application server at POST /mcp. There is no separate container to run.

Enabling the MCP Server

The MCP server is always active when SparkyFitness is running. To connect a client, you only need to:
  1. Generate a Personal API Key — go to Settings → Profile → Personal API Key and click Generate API Key. Copy the key.
  2. Find your MCP endpoint URL:
    • Production: https://<your-host>/mcp
    • Local dev (via frontend proxy): http://localhost:8080/mcp
    • Local dev (server direct): http://localhost:3010/mcp

Connecting Claude Desktop or Cursor

Clients that support streamable HTTP (including Cursor) point directly at /mcp with an Authorization header:
{
  "mcpServers": {
    "sparky-fitness": {
      "url": "https://<your-host>/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_API_KEY>"
      }
    }
  }
}

Available Tools

All MCP tools automatically respect your unit preferences (lbs/kg, kcal/kJ, cm/in). You never need to specify unit conversions in your prompts.

Nutrition & Food

Logs a food item to your daily diary. Handles both existing and new food items. If the food is not found in the database, the AI will infer nutritional details and create it automatically before logging.Example: “I just had a 250g steak and a side salad.”
Logs a predefined meal template to your diary. Supports a quantity multiplier to scale the template.Example: “Log my ‘Standard Breakfast’ for today.”
Records a water intake entry for the day.Example: “I drank 500ml of water.”
Retrieves all logged food and meal entries for a specific date (defaults to today).Example: “What have I eaten today?”
Copies all food entries from a source date to a target date, optionally filtered to a specific meal type (breakfast, lunch, dinner, snacks).Example: “Copy my breakfast from yesterday to today.”
Returns an aggregated nutrition summary for a date range, including calories, protein, carbs, fat, and micronutrients.Example: “Give me a breakdown of my macros for the last 7 days.”

Exercise & Fitness

Logs an exercise with full set/rep/weight detail for strength training, or duration and calories for cardio. Supports multi-set logging in a single call.Example: “Log 3 sets of bench press at 80kg for 10 reps.”
Logs a predefined workout preset (routine) to your exercise diary.Example: “Start my ‘Leg Day’ workout.”
Returns the description, muscle groups, and category for a specific exercise.Example: “How do I perform a Bulgarian Split Squat?”
Shows historical performance for a specific exercise over a configurable time window.Example: “Show me my bench press progress over the last month.”
Searches the exercise library by name, muscle group, and/or equipment.Example: “Find some advanced chest exercises using dumbbells.”

Biometrics & Check-ins

Runs a multi-turn guided check-in that prompts you for weight, sleep, mood, water, and any custom metrics you track — all in one conversation flow.Example: “I’m ready for my daily check-in.”
Logs weight, steps, height, neck, waist, hips, and body fat percentage. Accepts mixed units (kg/lbs, cm/in) and converts automatically.Example: “My weight is 185 lbs today.”
Logs sleep duration, quality score, bedtime, and wake time for a given date.Example: “I slept 7 hours last night and went to bed at 11 PM.”
Records a mood value (1–10 scale) with optional notes for a specific date.Example: “I feel like an 8/10 today.”
Returns the current status of any active fasting window, including elapsed time and whether you are still fasting.Example: “Am I still in my fasting window?”
Records a value for any user-defined custom health category (blood pressure, glucose, HRV, etc.).Example: “My blood pressure was 120/80 today.”

Goals, Habits & Reports

Creates, updates, and logs completion for habit entries (supplements, mobility work, medication, etc.).Example: “Did I take my vitamins today? Mark them as done.”
Creates and manages weight, nutrition, or fitness goals with a target value and deadline.Example: “Set a new weight goal of 175 lbs by July.”
Generates a consolidated health report covering nutrition adherence, exercise volume, sleep, mood, and biometric trends for a time period.Example: “Give me a weekly performance summary.”
Reads and writes profile settings including display units, timezone, and calorie/macro goals.Example: “Change my energy display unit to kJ.”

Example Prompts

Here are natural language prompts you can use immediately after connecting an MCP client:
  • “Log a bowl of oatmeal with 50g oats, 200ml whole milk, and a banana for breakfast.”
  • “What were my total calories and protein yesterday?”
  • “Copy my lunch from yesterday to today.”
  • “I drank 2 litres of water today — log it.”
  • “Show me my average macros over the last 14 days.”

Unit Preferences

All MCP tools are unit-aware. When you call a tool, SparkyFitness reads your saved unit preferences and converts values automatically:
  • Weight displayed and accepted in kg or lbs based on your preference
  • Energy displayed in kcal or kJ
  • Height and body measurements in cm or inches
  • Liquid volumes in ml or fl oz
You can change your unit preferences at any time using the sparky_manage_profile tool:
“Switch my weight display to pounds.”
The change takes effect immediately for all subsequent MCP tool calls.

Security

MCP tools operate under PostgreSQL Row Level Security (RLS), scoped to the user authenticated by the API key. An MCP session can only read and write data belonging to that specific user — it is impossible to access another user’s health data through the MCP interface.
A small set of developer/debugging tools (sparky_inspect_schema, sparky_get_user_info, sparky_get_db_stats) exist but are disabled by default. They are only exposed when the DEV_TOOLS_ENABLED=true environment variable is set and the request authenticates with an admin API key. Keep this disabled in production.

Build docs developers (and LLMs) love