Mealdb MCP
"What do you want to eat?"
Ask AI about Mealdb MCP
Powered by Claude Β· Grounded in docs
I know everything about Mealdb MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
MealDB MCP Server
A Model Context Protocol (MCP) server that provides AI assistants with access to the TheMealDB API for recipe and meal information. This server enables AI assistants to search for recipes, get detailed meal information, browse categories, and explore ingredients.
π Hey Vibe Coders! Ever have the problem where your partner asks you, "What do you want to eat?" and you just stare blankly? No more endless scrolling through delivery apps or decision paralysis! Let AI help you discover your next meal! π€β¨
π Powered by TheMealDB - An open, crowd-sourced database of recipes from around the world!
π‘ Enjoying this product? Consider reaching out to TheMealDB team to set up a production API for enhanced features and production usecases!
π½οΈ Features
- π Meal Search - Search for meals by name
- π Meal Details - Get complete recipe details including ingredients and instructions
- π² Random Meals - Get random meal suggestions for when you're feeling adventurous
- π Category Browsing - Explore meal categories and discover new cuisines
- π₯ Ingredient Search - Find meals by specific ingredients you have on hand
- π Comprehensive Data - Access to thousands of recipes from around the world
π Quick Start
Prerequisites
- Node.js 18+
- npm or yarn
- A compatible MCP client (like Cursor with MCP support)
- Docker & Docker Compose (optional, for containerized deployment)
π» Local Installation (Recommended)
-
Clone this repository
git clone <your-repo-url> cd mealdb-mcp -
Install dependencies
npm install -
Build the server
npm run build -
Start the server
npm start
The server will start and listen for MCP requests via stdio.
π³ Docker Installation (Optional)
For a containerized setup (requires Docker Desktop):
Production deployment:
npm run docker:prod
Development with hot reload:
npm run docker:dev
β οΈ Note: If you get a "'docker-compose' is not recognized" error, Docker isn't installed. Use the local installation method above instead.
βοΈ Configuration
For Cursor IDE
The server includes a .cursor/mcp.json configuration file that allows Cursor to automatically discover and use the MealDB server:
{
"mcpServers": {
"mealdb-server": {
"command": "node",
"args": ["build/index.js"],
"env": {
"NODE_ENV": "development"
}
}
}
}
For Other MCP Clients
Configure your MCP client to connect to this server using:
- Command:
node - Arguments:
["path/to/mealdb-mcp/build/index.js"] - Working Directory:
path/to/mealdb-mcp
π οΈ Available Tools
π search_meals
Search for meals by name.
Parameters:
query(string): Name of the meal to search for
Example:
{
"name": "search_meals",
"arguments": {
"query": "chicken"
}
}
π get_meal_details
Get detailed information about a specific meal by ID.
Parameters:
mealId(string): The ID of the meal to get details for
Example:
{
"name": "get_meal_details",
"arguments": {
"mealId": "52772"
}
}
π² get_random_meal
Get a random meal suggestion.
Parameters: None
Example:
{
"name": "get_random_meal",
"arguments": {}
}
π list_categories
Get all available meal categories.
Parameters: None
Example:
{
"name": "list_categories",
"arguments": {}
}
π₯ search_by_ingredient
Find meals that contain a specific ingredient.
Parameters:
ingredient(string): Name of the ingredient to search for
Example:
{
"name": "search_by_ingredient",
"arguments": {
"ingredient": "chicken"
}
}
π¬ Usage Examples
Here are some example queries you can ask an AI assistant using this MCP server:
- "Find me some chicken recipes"
- "Get details for meal ID 52772"
- "Give me a random meal suggestion"
- "What meal categories are available?"
- "Find meals that contain tomatoes"
- "Show me Italian recipes"
- "What are some vegetarian options?"
ποΈ Development
Project Structure
mealdb-mcp/
βββ src/
β βββ index.ts # Main MCP server implementation
βββ build/ # Compiled JavaScript output
βββ .cursor/
β βββ mcp.json # Cursor IDE configuration
βββ package.json # Project dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ README.md # This file
Available Scripts
Local Development:
npm run build- Compile TypeScript to JavaScriptnpm run watch- Watch for changes and recompilenpm start- Start the MCP servernpm run prepare- Build the project (runs automatically on install)
Docker Commands:
npm run docker:build- Build Docker imagenpm run docker:run- Run container from built imagenpm run docker:dev- Start development environment with hot reloadnpm run docker:prod- Start production environmentnpm run docker:stop- Stop all containersnpm run docker:logs- View container logsnpm run docker:clean- Clean up containers and images
API Information
This server uses the free tier of TheMealDB API which provides:
- β Meal search by name
- β Meal details by ID
- β Random meal suggestions
- β Category listings
- β Ingredient-based filtering
- β Area/cuisine filtering
Note: This server only uses free API endpoints. Premium features are not implemented.
π³ Docker Deployment
Container Features
- ποΈ Multi-stage build for optimized production images
- π Non-root user for enhanced security
- π Health checks for container monitoring
- ποΈ Alpine Linux base for minimal image size
- π Development mode with hot reload support
Production Deployment
# Build and start in production mode
docker-compose up -d
# View logs
docker-compose logs -f mealdb-mcp-server
# Stop services
docker-compose down
Development Deployment
# Start development environment with hot reload
docker-compose -f docker-compose.dev.yml up
# Or use the npm script
npm run docker:dev
Environment Variables
Configure the container using environment variables:
NODE_ENV=production # Environment mode
PORT=3000 # Server port
π Security
- π The server runs locally and doesn't expose any network ports
- π All API calls are made to the public TheMealDB API
- π No sensitive data is stored or transmitted
- π Uses secure HTTPS connections to external APIs
π€ Contributing
- π΄ Fork the repository
- πΏ Create a feature branch
- βοΈ Make your changes
- π§ͺ Test thoroughly
- π€ Submit a pull request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- TheMealDB for providing the free recipe API
- Model Context Protocol for the standardized AI-assistant communication protocol
- Anthropic for developing MCP
π Support & Help
π Need Help?
We're here to help you get the most out of your MealDB MCP Server! If you encounter any issues or have questions, here are your options:
π§ Get Support:
- π Found a bug? Open an issue in our GitHub repository
- π‘ Have a feature request? We'd love to hear your ideas!
- β Need help with setup? Check our troubleshooting guide below or ask for help
π Useful Links:
Common Issues & Solutions
π¨ "'docker-compose' is not recognized" Error:
If you see this error when running npm run docker:prod, it means Docker isn't installed on your system. You have two options:
-
Install Docker Desktop (recommended for containerized deployment):
- Download from https://www.docker.com/products/docker-desktop/
- Install and restart your computer
- Verify with
docker --versionanddocker compose version
-
Run locally without Docker (simpler setup):
npm install npm run build npm start
π§ Build or Runtime Issues:
- β
Check that Node.js 18+ is installed (
node --version) - β
Ensure all dependencies are installed (
npm install) - β
Verify the build completed successfully (
npm run build) - β Check that your MCP client is configured correctly
- β Make sure you're in the correct directory
- β
Try clearing node_modules and reinstalling:
rm -rf node_modules package-lock.json && npm install
Still having trouble? Don't hesitate to reach out - we're happy to help! π€
Happy Cooking! π³
Made with β€οΈ by Traves Theberge
