Labsco
salgado logo

Apple Health Data with Elasticsearch

โ˜… 8

from salgado

A Python-based MCP server that connects to an Elasticsearch index with Apple HealthKit data.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

MCP Server for Apple Health Data with Elasticsearch - Starter Project

Welcome! This repository contains the complete and final source code for the blog post, "Unlock Your LLM's Potential: Building an MCP Server with Elasticsearch for Real Health Data".

This project provides a runnable implementation of a custom Model Context Protocol (MCP) server. Built with Python and the FastMCP framework, this server connects to an Elasticsearch index containing sample Apple HealthKit step data. This setup allows an LLM client like Claude to query personal health data using natural language.

File Descriptions

  • apple_watch_mcp.py: The complete and final script for the MCP server, containing all implemented Resources, Tools, and Prompts.
  • ingest_data.py: A helper script that populates your Elasticsearch instance with the sample data.
  • sample_data.json: A JSON file containing fictitious Apple Health step count data for testing.
  • README.md: This file, providing instructions to run the complete solution.