MyFitnessPal MCP Server

MyFitnessPal MCP Server

Enables retrieval and analysis of MyFitnessPal nutrition data including daily summaries, meal breakdowns, exercise tracking, and macro/micronutrient analysis. Uses browser cookie authentication to access your personal MyFitnessPal account data through natural language queries.

Category
Visit Server

README

MyFitnessPal MCP Server

A FastMCP server that retrieves your MyFitnessPal nutrition data through the Model Context Protocol.

Quick Start

Local Development

  1. Prerequisites: Python 3.12+, uv, MyFitnessPal account
  2. Install dependencies: uv sync
  3. Log into MyFitnessPal in your browser (Chrome, Firefox, Safari, or Edge)
  4. Test the server: uv run python test_client.py

Deployment (Server/Docker)

For environments without a browser:

  1. Export cookies from your local browser:

    uv run python export_cookies.py
    
  2. Deploy with the generated .env file - no browser needed!

See Deployment Guide for Docker, systemd, and cloud deployment options.

Features

  • Daily nutrition summary (calories, macros, water)
  • Detailed meal-by-meal breakdown
  • Exercise tracking (cardio + strength)
  • Macro & micronutrient analysis
  • Water intake monitoring
  • Date range summaries with trends

Configuration

Add to your MCP client config (e.g., .cursor/mcp.json):

{
  "mcpServers": {
    "myfitnesspal": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "--directory", "/path/to/mfp-mcp", "python", "main.py"]
    }
  }
}

Documentation

How It Works

Uses the python-myfitnesspal library (GitHub version) which:

  • Extracts cookies from your browser automatically
  • Scrapes MyFitnessPal website for data
  • No credentials stored in files
  • Works with Chrome, Firefox, Safari, and Edge

Cookie Authentication

Browser-based (default):

  • Automatically extracts cookies from your local browser
  • Works out of the box if you're logged into MyFitnessPal

Environment variable (for Docker/servers):

  • Set MFP_COOKIES environment variable with exported cookies
  • Use export_cookies.py utility to extract cookies beforehand:
    uv run python export_cookies.py
    
  • Perfect for environments without browser access (Docker containers, remote servers, etc.)
  • Cookies expire after ~30 days, re-export when needed

Project Structure

mfp-mcp/
├── docs/              # All documentation
├── myfitnesspal/      # External library (GitHub)
├── main.py            # FastMCP server
├── api_client.py      # Client wrapper
├── utils.py           # Helper functions
├── test_client.py     # Test script
└── pyproject.toml     # Dependencies

Requirements

  • Python 3.12+
  • uv package manager
  • Active MyFitnessPal session in browser
  • fastmcp 2.12+
  • lxml, browser-cookie3, measurement

License

For personal use and educational purposes. Respect MyFitnessPal's Terms of Service.

Credits

  • python-myfitnesspal: https://github.com/coddingtonbear/python-myfitnesspal
  • FastMCP: https://github.com/jlowin/fastmcp

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured