Senechal MCP Server
A Model Context Protocol (MCP) server that acts as a companion to the Senechal project, providing health data from the Senechal API to LLM applications.
Overview
This server provides a standardized interface for LLMs to access health data from the Senechal API. It exposes:
Resources: Health data that can be loaded into an LLM's context
Tools: Functions that can be called by LLMs to fetch health data
Prompts: Reusable templates for analyzing health data
Related MCP server: OpenAPI MCP Server
Installation
Clone this repository
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies:
pip install -r requirements.txt
Configuration
Copy the .env.example file to .env and add your Senechal API key and URL:
Both the API key and API URL are required for the server to function.
Windows Configuration
When running on Windows, be sure to:
Use backslashes or properly escaped paths in the configuration
Use the full path to your Python virtual environment in the claude-desktop-config.json:
Note that environment variables in the MCP configuration do not use the .env file, so you'll need to set them explicitly in the config.
Usage
Testing the Client/Server Setup
The simplest way to test the setup is to run the example client:
Start the Server
Development Mode with MCP Inspector
Install in Claude Desktop
The server includes a configuration file for Claude Desktop:
You can then select "Senechal Health" from the tools menu in Claude Desktop.
Available Resources
senechal://health/summary/{period}- Get health summary for day, week, month, or yearExample:
senechal://health/summary/day?span=7&metrics=allParameters:
period: day, week, month, yearspan: Number of periods (default: 1)metrics: Comma-separated list or "all" (default)offset: Number of periods to offset from now (default: 0)
senechal://health/profile- Get the user's health profileContains demographics, medications, supplements
senechal://health/current- Get current health measurementsExample:
senechal://health/current?types=1,2,3Parameters:
types: Optional comma-separated list of measurement type IDs
senechal://health/trends- Get health trends over timeExample:
senechal://health/trends?days=30&types=1,2,3&interval=dayParameters:
days: Number of days to analyze (default: 30)types: Optional comma-separated list of measurement type IDsinterval: Grouping interval - day, week, month (default: day)
senechal://health/stats- Get statistical analysis of health metricsExample:
senechal://health/stats?days=30&types=1,2,3Parameters:
days: Analysis period in days (default: 30)types: Optional comma-separated list of measurement type IDs
Available Tools
fetch_health_summary- Fetch a health summary for a specific periodParameters:
period(required): day, week, month, yearmetrics(optional): Comma-separated metrics or "all" (default)span(optional): Number of periods to return (default: 1)offset(optional): Number of periods to offset (default: 0)
fetch_health_profile- Fetch the user's health profileNo parameters required
fetch_current_health- Fetch the latest health measurementsParameters:
types(optional): List of measurement type IDs to filter by
fetch_health_trends- Fetch health trend dataParameters:
days(optional): Number of days to analyze (default: 30)types(optional): List of measurement type IDs to filter byinterval(optional): Grouping interval - day, week, month (default: day)
fetch_health_stats- Fetch statistical analysis of health metricsParameters:
days(optional): Analysis period in days (default: 30)types(optional): List of measurement type IDs to filter by
Available Prompts
analyze_health_summary- Prompt to analyze health summariesProvides a template for identifying abnormal metrics, trends, and suggesting actions
Intended to be used with data from
senechal://health/summary/day?span=7
compare_health_trends- Prompt to compare health trends over different time periodsProvides a template for comparing trends across different timeframes (7, 30, 90 days)
Intended to be used with data from the health trends endpoint
Example Interactions
Loading Health Summary Data
Calling Health Data Tools
Using Health Analysis Prompts
See the example_client.py file for a complete working example.
API Endpoints
The Senechal MCP server communicates with the following Senechal API endpoints:
/health/summary/{period}- Get health summaries/health/profile- Get health profile/health/current- Get current measurements/health/trends- Get health trends/health/stats- Get health stats