🛒 Kroger MCP Server 🛍️ -- FastMCP for Kroger Shopping
A FastMCP server that provides AI assistants like Claude with seamless access to Kroger's grocery shopping functionality through the Model Context Protocol (MCP). This server enables AI assistants to find stores, search products, manage shopping carts, and access Kroger's comprehensive grocery data via the kroger-api python library.
📺 Demo
Using Claude with this MCP server to search for stores, find products, and add items to your cart:
🚀 Quick Start
Prerequisites
You will need Kroger API credentials (free from Kroger Developer Portal). Visit the Kroger Developer Portal to:
- Create a developer account
- Register your application
- Get your
CLIENT_ID
,CLIENT_SECRET
, and set yourREDIRECT_URI
The first time you run a tool requiring user authentication, you'll be prompted to authorize your app through your web browser. You're granting permission to your own registered app, not to any third party.
Installation
Option 1: Using uvx with Claude Desktop (Recommended)
Once published to PyPI, you can use uvx to run the package directly without cloning the repository:
Edit Claude Desktop's configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Benefits of this method:
- Automatically installs the package from PyPI if needed
- Creates an isolated environment for running the server
- Makes it easy to stay updated with the latest version
- Doesn't require maintaining a local repository clone
Option 2: Using uv with a Local Clone
First, clone locally:
Then, edit Claude Desktop's configuration file:
Option 3: Installing From PyPI
Option 4: Installing From Source
Configuration
Create a .env
file in your project root or pass in env values via the JSON config:
Running the Server
🛠️ Features
💬 Built-In MCP Prompts
- Shopping Path: Find optimal path through store for a grocery list
- Pharmacy Check: Check if pharmacy at preferred location is open
- Store Selection: Help user set their preferred Kroger store
- Recipe Shopping: Find recipes and add ingredients to cart
📚 Available Tools
Location Tools
Tool | Description | Auth Required |
---|---|---|
search_locations | Find Kroger stores near a zip code | No |
get_location_details | Get detailed information about a specific store | No |
set_preferred_location | Set a preferred store for future operations | No |
get_preferred_location | Get the currently set preferred store | No |
check_location_exists | Verify if a location ID is valid | No |
Product Tools
Tool | Description | Auth Required |
---|---|---|
search_products | Search for products by name, brand, or other criteria | No |
get_product_details | Get detailed product information including pricing | No |
search_products_by_id | Find products by their specific product ID | No |
get_product_images | Get product images from specific perspective (front, back, etc.) | No |
Cart Tools
Tool | Description | Auth Required |
---|---|---|
add_items_to_cart | Add a single item to cart | Yes |
bulk_add_to_cart | Add multiple items to cart in one operation | Yes |
view_current_cart | View items currently in your local cart tracking | No |
remove_from_cart | Remove items from local cart tracking | No |
clear_current_cart | Clear all items from local cart tracking | No |
mark_order_placed | Move current cart to order history | No |
view_order_history | View history of placed orders | No |
Information Tools
Tool | Description | Auth Required |
---|---|---|
list_chains | Get all Kroger-owned chains | No |
get_chain_details | Get details about a specific chain | No |
check_chain_exists | Check if a chain exists | No |
list_departments | Get all store departments | No |
get_department_details | Get details about a specific department | No |
check_department_exists | Check if a department exists | No |
Profile Tools
Tool | Description | Auth Required |
---|---|---|
get_user_profile | Get authenticated user's profile information | Yes |
test_authentication | Test if authentication token is valid | Yes |
get_authentication_info | Get detailed authentication status | Yes |
force_reauthenticate | Clear tokens and force re-authentication | No |
Utility Tools
Tool | Description | Auth Required |
---|---|---|
get_current_datetime | Get current system date and time | No |
🧰 Local-Only Cart Tracking
Since the Kroger API doesn't provide cart viewing functionality, this server maintains local tracking:
Local Cart Storage
- File:
kroger_cart.json
- Contents: Current cart items with timestamps
- Automatic: Created and updated automatically
Order History
- File:
kroger_order_history.json
- Contents: Historical orders with placement timestamps
- Usage: Move completed carts to history with
mark_order_placed
🚧 Kroger Public API Limitations
- View Only: The
remove_from_cart
andclear_current_cart
tools ONLY affect local tracking, not the actual Kroger cart - Local Sync: Use these tools only when the user has already removed items from their cart in the Kroger app/website
- One-Way: Items can be added to the Kroger cart but not removed through the Public API. The Partner API would allow these things, but that requires entering a contract with Kroger.
API | Version | Rate Limit | Notes |
---|---|---|---|
Authorization | 1.0.13 | No specific limit | Token management |
Products | 1.2.4 | 10,000 calls/day | Search and product details |
Locations | 1.2.2 | 1,600 calls/day per endpoint | Store locations and details |
Cart | 1.2.3 | 5,000 calls/day | Add/manage cart items |
Identity | 1.2.3 | 5,000 calls/day | User profile information |
Note: Rate limits are enforced per endpoint, not per operation. You can distribute calls across operations using the same endpoint as needed.
🏫 Basic Workflow
- Set up a preferred location:
- Search and add products:
- Manage cart and orders:
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
⚠️ Disclaimer
This is an unofficial MCP server for the Kroger Public API. It is not affiliated with, endorsed by, or sponsored by Kroger.
For questions about the Kroger API, visit the Kroger Developer Portal or read the kroger-api package documentation.
This server cannot be installed
A FastMCP server that provides AI assistants like Claude with seamless access to Kroger's grocery shopping functionality through the Model Context Protocol, enabling store finding, product searching, and cart management.