- Home
- MCP servers
- Diet
Diet
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You will run a Diet / Meal Log MCP Server that manages meal logs, provides daily and weekly summaries, and exposes a simple way to log meals through an MCP client. This server runs locally in stdio mode or can be accessed remotely via SSE, making it easy to integrate with compatible clients to track your daily intake and calories.
How to use
To use this MCP server with a client, start the server in one of two modes and connect your client to the appropriate endpoint.
Mode 1: Local stdio mode lets you run the server on the same machine as your client. Start the server in the foreground and connect your client via standard input/output.
Mode 2: Network SSE mode exposes the server over the network so you can connect from another device using the SSE transport.
How to install
Prerequisites: Python 3.11 or newer.
Install Method A (recommended): use the uv workflow to create a virtual environment and install dependencies.
Install Method B: use a standard Python virtual environment and install dependencies with pip.
Once installed, you can run the server in stdio or SSE mode.
Additional notes
Data is stored locally in the file path described in the setup, enabling easy backup and portability.
If you plan to connect from another device, ensure both devices are on the same network and open port 8000 in any firewalls. Use the SSE endpoint when connecting remotely.
Configuration and examples
{
"mcpServers": {
"diet_mcp": {
"type": "stdio",
"command": "python",
"args": ["server.py"]
},
"diet_mcp_remote": {
"type": "http",
"name": "diet_mcp_remote",
"url": "http://192.168.0.184:8000/sse",
"args": []
}
}
}
Security considerations
If you expose the server over the internet, implement authentication and HTTPS to protect sensitive meal data.
Tools and capabilities
The server supports the following actions via the MCP interface: add_meal to log a meal, get_daily_summary to retrieve a specific day's meals and total calories, and get_week_summary to retrieve meals for a week with its total calories.
Available tools
add_meal
Adds a new meal entry to the log, including meal details and timestamp.
get_daily_summary
Retrieves all meals for a specified date along with the total calories for that day.
get_week_summary
Retrieves all meals for a specified week along with the total calories for that week.