Skip to main content
Glama
MayankKapgate

fitness-tracker-mcp

πŸ‹οΈ Fitness Tracker β€” MCP Server

A fully offline Model Context Protocol server that lets any MCP‑compatible client (Claude Code, Claude Desktop, etc.) log workouts, track dietary macros, and retrieve daily summaries β€” all stored in a local SQLite database.

Layer

Technology

MCP framework

FastMCP (stdio)

Database

SQLite 3

Validation

Pydantic v2

Testing

Pytest


πŸ“‚ Project Structure

MCP_Project/
β”œβ”€β”€ server.py           # MCP server β€” tools, schemas, DB logic
β”œβ”€β”€ test_server.py      # Pytest suite (22 tests)
β”œβ”€β”€ requirements.txt    # pip dependencies
β”œβ”€β”€ README.md           # You are here
└── fitness_tracker.db  # Created automatically on first run

Related MCP server: Nutrition MCP

πŸš€ Quick Start

1. Install Dependencies

pip install -r requirements.txt

2. Run the Test Suite

pytest test_server.py -v

You should see 22 tests pass, covering:

  • βœ… Pydantic schema validation (valid inputs, bad dates, negative numbers, missing fields, SQL injection strings)

  • βœ… Database insert and retrieve logic

  • βœ… Daily summary aggregation and date isolation

3. Run the Server Standalone (optional)

python server.py

The server starts on stdio β€” it reads JSON‑RPC from stdin and writes to stdout. You will not see a prompt; this is intended for MCP client consumption.


πŸ”Œ Connect to Claude Code

Run this once in your terminal to register the server:

claude mcp add fitness-tracker --transport stdio -- python server.py

Tip: Use the full absolute path to server.py if Claude Code is not launched from this directory:

claude mcp add fitness-tracker --transport stdio -- python "C:\Users\Mayan\OneDrive\Documents\MCP_Project\server.py"

After registering, Claude Code can call the three tools below whenever you ask fitness-related questions.


πŸ› οΈ Exposed Tools

log_workout

Log a single workout session.

Parameter

Type

Constraint

Example

date

str

YYYY‑MM‑DD

2026-08-04

type

str

1–100 chars

running

duration

float

> 0 (minutes)

30

calories

float

β‰₯ 0

300

log_macros

Log dietary macronutrients for a meal or full day.

Parameter

Type

Constraint

Example

date

str

YYYY‑MM‑DD

2026-08-04

protein

float

β‰₯ 0 (g)

150

carbs

float

β‰₯ 0 (g)

200

fat

float

β‰₯ 0 (g)

60

get_daily_summary

Retrieve a combined workout + nutrition summary for a given date.

Parameter

Type

Constraint

Example

date

str

YYYY‑MM‑DD

2026-08-04

Returns aggregated totals: workout count, total duration, total calories burned, macro totals (protein / carbs / fat in grams), and estimated calories consumed (using 4 / 4 / 9 kcal per gram).


πŸ”’ Safety

  • Parameterised queries β€” all SQL uses ? placeholders; user input is never interpolated into query strings.

  • Pydantic validation β€” every tool input is parsed through a strict schema before touching the database, so malformed LLM outputs fail immediately with a clear error.

  • Offline by design β€” stdio transport means zero network traffic.


πŸ“ License

MIT β€” use freely.

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    A personal fitness tracking server that enables logging and querying workouts, nutrition, and body metrics through a local SQLite database. Integrates with OpenNutrition MCP for food logging and supports exercise history tracking for workout progression.
    Last updated
    17
  • A
    license
    -
    quality
    B
    maintenance
    A filesystem-based MCP server that turns any MCP-capable AI agent into a conversational calorie and protein tracker with natural-language estimates, confidence-aware logging, daily/weekly progress, food-history search, and export, working offline with local fallback data.
    Last updated
    187
    MIT
  • F
    license
    -
    quality
    B
    maintenance
    Local-first nutrition tracker MCP server for Hermes, enabling food, alias, recipe, and meal log management with SQLite persistence.
    Last updated
  • F
    license
    A
    quality
    B
    maintenance
    Personal workout coach MCP server that logs exercises in natural language, tracks progress with SQLite, and provides coaching signals like estimated 1RM and volume trends.
    Last updated
    6

View all related MCP servers

Related MCP Connectors

  • MCP server for Withings health data β€” sleep, activity, heart, and body metrics.

  • GibsonAI MCP server: manage your databases with natural language

  • MCP server for Argo RPG Platform β€” connects AI assistants to campaign data via OAuth2

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MayankKapgate/fitness-tracker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server