The Kroger MCP Server enables AI assistants to interact with Kroger's grocery shopping platform through the Model Context Protocol. This server allows for finding stores, searching products, managing shopping carts, and accessing Kroger's grocery data via a streamlined interface.
To use this server, you'll need Kroger API credentials from the Kroger Developer Portal:
CLIENT_ID
, CLIENT_SECRET
, and set your REDIRECT_URI
The first time you run a tool requiring user authentication, you'll be prompted to authorize your app through your web browser.
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
{
"mcpServers": {
"kroger": {
"command": "uvx",
"args": [
"kroger-mcp"
],
"env": {
"KROGER_CLIENT_ID": "your_client_id",
"KROGER_CLIENT_SECRET": "your_client_secret",
"KROGER_REDIRECT_URI": "http://localhost:8000/callback",
"KROGER_USER_ZIP_CODE": "10001"
}
}
}
}
First, clone the repository:
git clone https://github.com/CupOfOwls/kroger-mcp
Then, edit Claude Desktop's configuration file:
{
"mcpServers": {
"kroger": {
"command": "uv",
"args": [
"--directory",
"/path/to/cloned/kroger-mcp",
"run",
"kroger-mcp"
],
"env": {
"KROGER_CLIENT_ID": "your_client_id",
"KROGER_CLIENT_SECRET": "your_client_secret",
"KROGER_REDIRECT_URI": "http://localhost:8000/callback",
"KROGER_USER_ZIP_CODE": "10001"
}
}
}
}
# Install with uv (recommended)
uv pip install kroger-mcp
# Or install with pip
pip install kroger-mcp
# Clone the repository
git clone https://github.com/CupOfOwls/kroger-mcp
cd kroger-mcp
# Install with uv (recommended)
uv sync
# Or install with pip
pip install -e .
Create a .env
file in your project root or pass in env values via the JSON config:
# Required: Your Kroger API credentials
KROGER_CLIENT_ID=your_client_id_here
KROGER_CLIENT_SECRET=your_client_secret_here
KROGER_REDIRECT_URI=http://localhost:8000/callback
# Optional: Default zip code for location searches
KROGER_USER_ZIP_CODE=90274
# With uv (recommended)
uv run kroger-mcp
# With uvx (directly from PyPI without installation)
uvx kroger-mcp
# Or with Python directly
python server.py
search_locations
: Find Kroger stores near a zip codeget_location_details
: Get detailed information about a specific storeset_preferred_location
: Set a preferred store for future operationsget_preferred_location
: Get the currently set preferred storecheck_location_exists
: Verify if a location ID is validsearch_products
: Search for products by name, brand, or other criteriaget_product_details
: Get detailed product information including pricingsearch_products_by_id
: Find products by their specific product IDget_product_images
: Get product images from specific perspective (front, back, etc.)add_items_to_cart
: Add a single item to cart (requires authentication)bulk_add_to_cart
: Add multiple items to cart in one operation (requires authentication)view_current_cart
: View items currently in your local cart trackingremove_from_cart
: Remove items from local cart trackingclear_current_cart
: Clear all items from local cart trackingmark_order_placed
: Move current cart to order historyview_order_history
: View history of placed orderslist_chains
: Get all Kroger-owned chainsget_chain_details
: Get details about a specific chaincheck_chain_exists
: Check if a chain existslist_departments
: Get all store departmentsget_department_details
: Get details about a specific departmentcheck_department_exists
: Check if a department existsget_user_profile
: Get authenticated user's profile information (requires authentication)test_authentication
: Test if authentication token is valid (requires authentication)get_authentication_info
: Get detailed authentication status (requires authentication)force_reauthenticate
: Clear tokens and force re-authenticationget_current_datetime
: Get current system date and timeSince the Kroger API doesn't provide cart viewing functionality, this server maintains local tracking:
kroger_cart.json
kroger_order_history.json
The Kroger Public API has some limitations:
remove_from_cart
and clear_current_cart
tools ONLY affect local tracking, not the actual Kroger cartUser: "Find Kroger stores near 90274"
Assistant: [Uses search_locations tool]
User: "Set the first one as my preferred location"
Assistant: [Uses set_preferred_location tool]
User: "Add milk to my cart"
Assistant: [Uses search_products, then add_items_to_cart]
User: "Add bread, eggs, and cheese to my cart"
Assistant: [Uses search_products for each, then bulk_add_to_cart]
User: "What's in my cart?"
Assistant: [Uses view_current_cart tool to see local memory]
User: "I placed the order on the Kroger website"
Assistant: [Uses mark_order_placed tool, moving current cart to the order history]
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "kroger" '{"command":"uvx","args":["kroger-mcp"],"env":{"KROGER_CLIENT_ID":"your_client_id","KROGER_CLIENT_SECRET":"your_client_secret","KROGER_REDIRECT_URI":"http://localhost:8000/callback","KROGER_USER_ZIP_CODE":"10001"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"kroger": {
"command": "uvx",
"args": [
"kroger-mcp"
],
"env": {
"KROGER_CLIENT_ID": "your_client_id",
"KROGER_CLIENT_SECRET": "your_client_secret",
"KROGER_REDIRECT_URI": "http://localhost:8000/callback",
"KROGER_USER_ZIP_CODE": "10001"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"kroger": {
"command": "uvx",
"args": [
"kroger-mcp"
],
"env": {
"KROGER_CLIENT_ID": "your_client_id",
"KROGER_CLIENT_SECRET": "your_client_secret",
"KROGER_REDIRECT_URI": "http://localhost:8000/callback",
"KROGER_USER_ZIP_CODE": "10001"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect