Used for data models to structure requests and responses for the grocery search functionality.
Planned for future enhancement to provide caching for price data, though not currently implemented.
Grocery Search MCP Server
An MCP (Model Context Protocol) server that provides grocery price and nutritional information search capabilities. This server allows AI agents to search for food products, compare prices, and analyze nutritional content across different grocery stores.
Features
- Product Search: Search for grocery items by name across supported stores
- Price Comparison: Get current pricing information for food products
- Nutritional Analysis: Retrieve protein, calorie, and other macro information
- Protein-per-Dollar Ranking: Automatically rank products by protein content per dollar spent
- Store Support: Currently supports Trader Joe's (more stores coming soon)
Installation
- Clone the repository:
- Install dependencies:
Or install in development mode:
Usage
Running the MCP Server
Start the server using:
Or using the script entry point:
Testing the Implementation
Run the test script to verify functionality:
MCP Tool Usage
The server provides one main tool:
GroceryPrices.search
Search for grocery items with price and nutritional information.
Parameters:
query
(required): Food or product name to search forstore
(optional): Store to search, defaults to "trader_joes"
Example:
Response: Returns a formatted list of products with:
- Product name and brand
- Price and package size
- Protein content and calories
- Protein-per-dollar ratio
- Nutritional information status
Architecture
The server consists of several key components:
- MCP Server (
server.py
): Main MCP protocol implementation - Data Models (
models.py
): Pydantic models for requests/responses - Scrapers (
scraper.py
): Web scraping logic for different stores - Nutrition Estimation: Basic nutritional information estimation
Current Implementation
This initial version includes:
- ✅ Basic MCP server setup
- ✅ Trader Joe's product search (mock data for now)
- ✅ Nutritional estimation based on product names
- ✅ Protein-per-dollar calculation
- ✅ Error handling and logging
Future Enhancements
- Real web scraping implementation
- Integration with USDA FoodData Central API
- Redis caching for price data
- Additional store support (Safeway, Kroger, etc.)
- Real-time inventory checking
- Advanced nutritional analysis
Contributing
This is a learning project. Feel free to submit issues and enhancement requests.
License
MIT License
This server cannot be installed
Provides grocery price and nutritional information search capabilities, allowing AI agents to search for food products, compare prices, and analyze nutritional content across different grocery stores.
Related MCP Servers
- -securityFlicense-qualityEnables users to upload retail data, analyze trends, optimize inventory, and forecast sales using AI-powered insights, acting as a senior supply chain expert.Last updated -JavaScript
- -securityAlicense-qualityAn agent-based tool that provides web search and advanced research capabilities including document analysis, image description, and YouTube transcript retrieval.Last updated -7PythonApache 2.0
- -securityFlicense-qualityEnables searching for AI agents by keywords or categories, allowing users to discover tools like coding agents, GUI agents, or industry-specific assistants across marketplaces.Last updated -23Python
- AsecurityFlicenseAqualityEnables AI systems to perform full-text and semantic search operations over structured/unstructured data in Azure Cognitive Search, with capabilities for document indexing and management through natural language.Last updated -3261TypeScript