vrushabh05/mealpilot-mcp
If you are the rightful owner of mealpilot-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
MealPilot (MCP) is a Python-based server that transforms TheMealDB public recipe API into typed tools for LLMs using the Model Context Protocol (MCP).
MealPilot (MCP) β Python LLM Tool Server for Recipe Discovery
Turn a public recipe API (TheMealDB) into typed tools for LLMs via the Model Context Protocol (MCP).
Supports search by name, filter by ingredient, fetch meal details, and a random meal endpoint β all with Pydantic validation, timeouts, result limits, and structured logging.
Demo (optional): add a GIF or video here β
docs/demo.gif
β¨ Features
- MCP server exposing 4 agent tools for reliable LLM function-calling
- Contract-first data models using Pydantic / JSON Schema
- Resilient I/O: timeouts, result caps, structured stderr logging
- Minimal deps:
requests
,pydantic
- Works with
mcp dev
for quick local bring-up
π Quickstart
# 1) Clone or download
git clone https://github.com/vrushabh05/mealpilot-mcp.git
cd mealpilot-mcp
# 2) (Optional) Create a virtualenv
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
# 3) Install dependencies
pip install -r requirements.txt
# 4) Run the server
python meals_server.py
# 5) Dev with MCP (if installed)
mcp dev
If you don't have MCP CLI: https://github.com/modelcontextprotocol
π§° Tools Exposed (MCP)
search_by_name(query: str)
β list of MealCardfilter_by_ingredient(ingredient: str)
β list of MealCardmeal_details(id: str)
β MealDetailsrandom_meal()
β MealDetails
Data Models (Pydantic)
class IngredientMeasure(BaseModel):
ingredient: str
measure: str
class MealCard(BaseModel):
id: str
name: str
category: Optional[str] = None
area: Optional[str] = None
thumbnail: Optional[str] = None
class MealDetails(MealCard):
instructions: Optional[str] = None
tags: List[str] = []
youtube: Optional[str] = None
source: Optional[str] = None
ingredients: List[IngredientMeasure] = []
Server Settings
TIMEOUT = 15
secondsMAX_LIMIT = 25
results per tool by default- Structured logging to
stderr
(JSON or key-value style)
π¦ Project Structure (suggested)
.
βββ meals_server.py
βββ requirements.txt
βββ README.md
βββ LICENSE
βββ .gitignore
βββ docs/
βββ demo.gif # (optional)
π§ͺ Example Usage (pseudo)
{
"tool": "search_by_name",
"params": {"query": "pasta"},
"timeout": 15000
}
Returns a list of MealCard
objects with id, name, category, area, thumbnail.
π§ Development Notes
- Fail fast on network errors; wrap API calls with
requests
+timeout
- Validate and coerce thirdβparty API payloads into Pydantic models
- Cap list sizes (
MAX_LIMIT
) to keep calls predictable for LLM agents
π License
Released under the MIT License. See LICENSE.
π Acknowledgements
- TheMealDB β Public recipe API
- Model Context Protocol β Agent tool standard