MCP Connector

Integrate AI with Rohlik Grocery Services

MCP server for managing Rohlik-family online grocery shopping - search, cart, deals, and meal suggestions via LLM.

Works with rohlik

90
Spark score
out of 100
Updated 4 months ago
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Enable AI assistants to seamlessly interact with Rohlik Group's product delivery services across multiple countries. Automate tasks like product search, cart management, and account information access.

Outcomes

What it gets done

01

Search for products and filter results.

02

Manage shopping cart contents (add, remove, view).

03

Access account and order history.

04

Get personalized meal suggestions and delivery information.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-rohlik | bash

Capabilities

Tools your agent gets

search_products

Search for products by name with filtering capabilities

add_to_cart

Add multiple items to the shopping cart

get_cart_content

View cart contents and total amounts

remove_from_cart

Remove items from the shopping cart

get_shopping_list

Retrieve shopping lists by ID

get_meal_suggestions

Get personalized suggestions for meals and beverages based on preferences

get_frequent_items

Analyze order history to find most frequently purchased items by category

get_shopping_scenarios

Interactive guide showcasing MCP capabilities

+7 tools

Overview

Rohlik MCP Server

An MCP server for Rohlik-family grocery shopping (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro) - product search, cart management, deals browsing, personalized meal suggestions, and account/order info. Use it for personal, single-account grocery shopping via a reverse-engineered API, not as an official production e-commerce integration.

What it does

Rohlik MCP Server lets an AI assistant interact with Rohlik Group's online grocery-delivery services across multiple countries - Rohlik.cz (Czech Republic), Knuspr.de (Germany), Gurkerl.at (Austria), Kifli.hu (Hungary), and Sezamo.ro (Romania), with Sezamo.it (Italy) and Sezamo.es (Spain) planned - letting a user search products, manage a shopping cart, and access account information conversationally. The project is explicitly built for study purposes using a reverse-engineered Rohlik API and is intended for personal use only.

When to use - and when NOT to

Use it when you want to manage Rohlik-family grocery shopping through an LLM conversation - adding recipe ingredients to a cart with dietary or budget filters, checking what's typically ordered for a meal, browsing this week's discounted items, or checking delivery slots and order history. It is not an official, production-grade e-commerce integration - it depends on a reverse-engineered API and is meant for personal, single-account use.

Capabilities

Core shopping tools: search_products (search groceries by name with filters), add_to_cart (add multiple products at once), get_cart_content (view cart contents and totals), remove_from_cart, and get_shopping_list (retrieve a shopping list by ID). Smart-shopping tools: get_meal_suggestions (personalized suggestions for breakfast, lunch, dinner, snacks, baking, drinks, or healthy eating based on order history), get_frequent_items (most frequently purchased items overall and per category), and get_shopping_scenarios (an interactive guide to what the MCP can do). Deals tooling: get_discounted_items (browse currently discounted items, filterable by food category, with sorting and pagination). Account and info tools: get_account_data, get_order_history, get_order_detail, get_upcoming_orders, get_delivery_info, get_delivery_slots, get_premium_info, get_announcements, and get_reusable_bags_info.

The target country or region is set via the ROHLIK_BASE_URL environment variable (defaulting to the Czech rohlik.cz site if unset), alongside ROHLIK_USERNAME/ROHLIK_PASSWORD credentials. A ROHLIK_DEBUG flag enables detailed logging to ~/Library/Logs/Claude/mcp-server-rohlik-local.log on macOS or the Windows equivalent, and an npm run validate-api script tests all 11 Rohlik API endpoints the server uses, producing both a JSON and an HTML validation report to help diagnose authentication or connectivity issues. The project is released under the MIT License.

How to install

npm install
npm run build

Who it's for

Individuals who want to manage their own Rohlik-family grocery shopping - search, cart, deals, meal suggestions, order history - through a personal AI assistant. Example prompts that work well include asking it to add gluten-free, budget-friendly ingredients for a recipe to the cart, swap those ingredients for a different recipe, add items from a photographed shopping list, show the cheapest delivery slots for tomorrow, or list the top 20 most-purchased items. Troubleshooting guidance covers login failures (verify credentials, enable ROHLIK_DEBUG, check the log files, or run the API validator), slow smart-shopping responses (analyze fewer past orders), and products not found (search by partial name or verify the product still exists on the Rohlik site).

Source README

Rohlik Rohlik MCP Server

Enhance your favourite LLM with capabilities to buy groceries.

This is a Model Context Protocol (MCP) server that enables AI assistants to interact with the Rohlik Group's online grocery delivery services across multiple countries. This server provides tools for searching products, managing shopping carts, and accessing account info.

Supported Services:

Example LLM prompts that work very well with the Rohlik MCP:

🛒 Regular Shopping:

  • Add ingredients for apple pie to the cart. Only gluten-free and budget-friendly.
  • Or actually, instead of apple pie I want to make pumpkin pie. Change the ingredients.
  • What are the items in my cart?
  • Add the items in the attached shopping list photo to the cart.
  • Add the bread I marked as favorite in Rohlik to my cart.

🤖 Smart Shopping:

  • "Add breakfast items I typically order"
  • "Show me lunch suggestions for this week"
  • "What do I usually buy for dinner?"
  • "I need snacks - suggest what I normally order"
  • "Show my top 20 most purchased items"
  • "What can I do with Rohlik MCP?"

💰 Deals & Discounts:

  • What's on sale this week?

📅 Planning:

  • What are the cheapest delivery slots for tomorrow?
  • When is my next delivery?
  • Show my last 5 orders

📚 Documentation

New to Rohlik MCP? Check out our Complete Guide for Newcomers!

Usage

Claude Desktop Configuration

Add the MCP to Claude Desktop configuration:

  • On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • On Windows: %APPDATA%/Claude/claude_desktop_config.json

Add the following configuration:

{
  "mcpServers": {
    "rohlik": {
      "command": "npx",
      "args": ["-y", "@tomaspavlin/rohlik-mcp"],
      "env": {
        "ROHLIK_USERNAME": "your-email@example.com",
        "ROHLIK_PASSWORD": "your-password",
        "ROHLIK_BASE_URL": "https://www.rohlik.cz"
      }
    }
  }
}

Supported Regions

The server supports multiple Rohlik regions by setting the ROHLIK_BASE_URL environment variable:

  • Czech Republic: https://www.rohlik.cz (default)
  • Germany: https://www.knuspr.de
  • Austria: https://www.gurkerl.at
  • Hungary: https://www.kifli.hu
  • Romania: https://www.sezamo.ro
  • Italy (planned): https://www.sezamo.it
  • Spain (planned): https://www.sezamo.es

If ROHLIK_BASE_URL is not specified, it defaults to the Czech version.

Tools

Core Shopping

  • search_products - Search for grocery products by name with filtering options
  • add_to_cart - Add multiple products to your shopping cart
  • get_cart_content - View current cart contents and totals
  • remove_from_cart - Remove items from your shopping cart
  • get_shopping_list - Retrieve shopping lists by ID

🤖 Smart Shopping

  • get_meal_suggestions - Get personalized suggestions for breakfast, lunch, dinner, snacks, baking, drinks, or healthy eating based on your order history
  • get_frequent_items - Analyze order history to find most frequently purchased items (overall + per category)
  • get_shopping_scenarios - Interactive guide showing what you can do with the MCP

Deals & Discounts

  • get_discounted_items - Browse currently discounted items (cenové trháky), optionally filtered by food category, with sorting and pagination

Getting info

  • get_account_data - Get comprehensive account information including delivery details, orders, announcements, cart, and premium status
  • get_order_history - View your past delivered orders with details
  • get_order_detail - Get detailed information about a specific order including all products
  • get_upcoming_orders - See your scheduled upcoming orders
  • get_delivery_info - Get current delivery information and fees
  • get_delivery_slots - View available delivery time slots for your address
  • get_premium_info - Check your Rohlik Premium subscription status and benefits
  • get_announcements - View current announcements and notifications
  • get_reusable_bags_info - Track your reusable bags and environmental impact

Development

Installation

npm install
npm run build

Scripts

  • npm run build - Compile TypeScript to JavaScript
  • npm start - Launch the production server
  • npm run dev - Start development mode with watch
  • npm run inspect - Test with MCP Inspector
  • npm test - Run unit tests
  • npm run test:watch - Run tests in watch mode
  • npm run test:coverage - Generate test coverage report

Testing

Unit Tests

The project includes unit tests for smart shopping data transformation logic:

# Run all tests
npm test

# Run tests in watch mode (development)
npm run test:watch

# Generate coverage report
npm run test:coverage

What's tested:

  • Frequency analysis algorithms (get_frequent_items)
  • Meal suggestion filtering and ranking (get_meal_suggestions)
  • Price averaging and calculations
  • Category filtering and grouping
  • Edge cases (empty data, missing fields, etc.)

See tests/README.md for detailed testing documentation.

Testing with Claude Desktop

Add this to configuration:

{
  "mcpServers": {
    "rohlik-local": {
      "command": "node",
      "args": ["/path/to/rohlik-mcp/dist/index.js"],
      "env": {
        "ROHLIK_USERNAME": "your-email@example.com",
        "ROHLIK_PASSWORD": "your-password",
        "ROHLIK_BASE_URL": "https://www.rohlik.cz"
      }
    }
  }
}

Debug Mode

If you're experiencing authentication issues, enable debug mode to see detailed logs:

{
  "mcpServers": {
    "rohlik-local": {
      "command": "node",
      "args": ["/path/to/rohlik-mcp/dist/index.js"],
      "env": {
        "ROHLIK_USERNAME": "your-email@example.com",
        "ROHLIK_PASSWORD": "your-password",
        "ROHLIK_BASE_URL": "https://www.rohlik.cz",
        "ROHLIK_DEBUG": "true"
      }
    }
  }
}

Debug logs will appear in ~/Library/Logs/Claude/mcp-server-rohlik-local.log (macOS) or %APPDATA%/Claude/logs/mcp-server-rohlik-local.log (Windows).

Testing with MCP Inspector

You can test the MCP server using the official MCP Inspector (https://modelcontextprotocol.io/legacy/tools/inspector):

npm run inspect

In the Inspector, set the ROHLIK_USERNAME and ROHLIK_PASSWORD envs.

API Validation Tool

To validate that all Rohlik API endpoints are working correctly and diagnose authentication issues:

npm run validate-api

This will:

  • Test all 11 API endpoints used by the MCP server
  • Show detailed HTTP request/response logs in the console
  • Generate a JSON report: tests/validation-results.json
  • Generate a beautiful HTML report: tests/validation-report.html

The validator automatically loads credentials from your Claude Desktop config or environment variables. Open the HTML report in your browser for an easy-to-read summary of all tests.

Troubleshooting

Common Issues

Claude Desktop does not see the MCP server (on Windows)

For your config file, instead of %APPDATA%/Claude/claude_desktop_config.json use C:\Users\[YOUR WINDOWS USER]\AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json

"Login failed" Error

Possible causes:

  1. Wrong username/password in configuration
  2. Rohlik API changed or is temporarily unavailable
  3. Network connectivity issues

Solutions:

  1. Verify credentials in your claude_desktop_config.json
  2. Enable debug mode: "ROHLIK_DEBUG": "true" in env section
  3. Check logs: ~/Library/Logs/Claude/mcp-server-rohlik*.log (macOS) or %APPDATA%\Claude\logs\mcp-server-rohlik*.log (Windows)
  4. Run API validator: npm run validate-api to test all endpoints
"No order history found"

Cause: Your account has no past orders, or orders are not accessible

Solution: Ensure you have at least one completed order on Rohlik before using smart shopping features (get_meal_suggestions, get_frequent_items)

Slow response times

Causes:

  • Analyzing too many orders (smart shopping features)
  • Network latency to Rohlik servers
  • API rate limiting

Solutions:

  • For smart shopping: reduce number of orders analyzed (try 10 instead of default 20)
  • Use fewer requests or add delays between bulk operations
  • Check your network connection
Products not found or search returns no results

Causes:

  • Product out of stock or discontinued
  • Product ID changed in Rohlik system
  • Spelling mistake in search query

Solutions:

  • Search by partial name instead of full product name
  • Try alternative spellings or broader search terms
  • Verify product exists on Rohlik website directly
Server fails with spawn npx ENOENT

Under Claude Desktop, fails with:

spawn npx ENOENT
Server disconnected. Transport closed unexpectedly.

Solutions:

Enabling Debug Mode

Add ROHLIK_DEBUG to your configuration to see detailed logs:

{
  "mcpServers": {
    "rohlik-local": {
      "command": "node",
      "args": ["/path/to/rohlik-mcp/dist/index.js"],
      "env": {
        "ROHLIK_USERNAME": "your-email@example.com",
        "ROHLIK_PASSWORD": "your-password",
        "ROHLIK_BASE_URL": "https://www.rohlik.cz",
        "ROHLIK_DEBUG": "true"
      }
    }
  }
}

View logs:

# macOS
tail -f ~/Library/Logs/Claude/mcp-server-rohlik-local.log

# Windows
type %APPDATA%\Claude\logs\mcp-server-rohlik-local.log

Using the API Validation Tool

If you encounter authentication or API issues, run the validator:

npm run validate-api

This will:

  • Test all 11 API endpoints used by the MCP
  • Show detailed HTTP request/response information
  • Generate validation-results.json with test results
  • Create validation-report.html for easy viewing in browser
  • Help identify which specific endpoints are failing

Publishing as NPM package

  1. Update version in package.json
# Patch: 3.1.1 → 3.1.2                                               
npm version patch                                                    
                                                                     
# Minor: 3.1.1 → 3.2.0                                               
npm version minor                              
                                               
# Major: 3.1.1 → 4.0.0
npm version major
  1. npm publish --access public

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.