Grocery Search MCP Server
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.
README
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:
git clone <repository-url>
cd MCP_Food_Search
- Install dependencies:
pip install -r requirements.txt
Or install in development mode:
pip install -e .
Usage
Running the MCP Server
Start the server using:
python -m grocery_search_mcp.server
Or using the script entry point:
grocery-search-mcp
Testing the Implementation
Run the test script to verify functionality:
python test_server.py
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:
{
"query": "protein bar",
"store": "trader_joes"
}
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.