The Kroger MCP Server is a FastMCP implementation that allows AI assistants like Claude to interact with Kroger's grocery shopping services. It enables searching for stores, browsing products, managing shopping carts, and accessing Kroger's grocery data through a standardized Model Context Protocol interface.
Before using the Kroger MCP Server, you'll need to obtain Kroger API credentials:
CLIENT_ID
, CLIENT_SECRET
, and set your REDIRECT_URI
When you first run a tool requiring user authentication, you'll be prompted to authorize your app through your web browser. You're only granting permission to your own registered app.
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 with:
{
"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 environment variables 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
Since the Kroger API doesn't provide cart viewing functionality, this server maintains local tracking:
kroger_cart.json
kroger_order_history.json
(use mark_order_placed
to move items from cart to history)remove_from_cart
and clear_current_cart
tools ONLY affect local tracking, not the actual Kroger cartSet up a preferred location:
User: "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]
Search and add products:
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]
Manage cart and orders:
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]
When Claude attempts to modify your Kroger account, you will be asked to insert a link into your browser that will handle authentication. Ensure you have already created a Kroger account (different from your Kroger developer account) before attempting to authenticate.
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