Skip to main content
Glama
Systembolaget MCP Server

Systembolaget MCP Server

by fldc

Systembolaget MCP Server

A Model Context Protocol (MCP) server for interacting with Systembolaget's APIs. This server provides tools for searching products, retrieving product details, finding stores, and getting store information.

Features

Available Tools

  1. systembolaget_search_products - Search for products in Systembolaget's catalog

    • Filter by category, price range, alcohol content, country

    • Support for pagination

    • Returns detailed product information including taste profiles

  2. systembolaget_get_product - Get detailed information about a specific product

    • Comprehensive product details

    • Taste profiles and food pairings

    • Serving suggestions

  3. systembolaget_search_stores - Search for Systembolaget stores

    • Find stores by name or city

    • Shows store location, opening hours, and coordinates

    • Pagination support

Related MCP server: Cocktail

Installation

Prerequisites

  • Python 3.10 or higher

  • uv - Fast Python package installer

Note: No API key required! The server automatically extracts the API key from Systembolaget's website.

  1. Install uv if you haven't already:

curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Clone this repository:

git clone https://github.com/fldc/systembolaget-mcp.git
cd systembolaget-mcp
  1. Install dependencies:

uv sync

Or install with development dependencies:

uv sync --all-extras
  1. (Optional) Configure a custom API key:

export SYSTEMBOLAGET_API_KEY="your-api-key-here"

Or create a .env file:

SYSTEMBOLAGET_API_KEY=your-api-key-here

The API key is optional. If not provided, the server will automatically extract it from Systembolaget's website.

Alternative: Setup with pip

If you prefer using pip:

pip install -e .
# Or with dev dependencies:
pip install -e ".[dev]"

Usage

Running the Server

With Claude Desktop

Add this configuration to your Claude Desktop config file:

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

Using uv (Recommended):

{
  "mcpServers": {
    "systembolaget": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/systembolaget-mcp",
        "run",
        "systembolaget_mcp.py"
      ]
    }
  }
}

Using Python directly:

{
  "mcpServers": {
    "systembolaget": {
      "command": "python",
      "args": ["/absolute/path/to/systembolaget-mcp/systembolaget_mcp.py"]
    }
  }
}

Note: The env section with SYSTEMBOLAGET_API_KEY is optional. The server will automatically extract the API key if not provided.

Standalone Testing

Important: MCP servers communicate via JSON-RPC protocol. You cannot send plain text directly to the server.

Quick Test (Recommended):

# Test the server functions directly
uv run test_server.py

Run as MCP Server:

# This starts the JSON-RPC server (waits for JSON-RPC messages via stdin)
uv run systembolaget_mcp.py

For detailed testing instructions, see TESTING.md.

Example Queries

Once connected through Claude Desktop, you can ask questions like:

  • "Search for Swedish beers under 50 SEK"

  • "Find wines from Italy with alcohol content between 12-14%"

  • "Show me stores in Stockholm"

  • "Get details for product number 12345"

  • "What are the opening hours for the store in Uppsala?"

Tool Reference

systembolaget_search_products

Search for products with various filters.

Parameters:

  • query (optional): Search query for product name

  • category (optional): Filter by category (e.g., 'Öl', 'Vin', 'Sprit')

  • min_price (optional): Minimum price in SEK

  • max_price (optional): Maximum price in SEK

  • min_alcohol (optional): Minimum alcohol percentage (0-100)

  • max_alcohol (optional): Maximum alcohol percentage (0-100)

  • country (optional): Filter by country of origin

  • limit (optional): Number of results (default: 20, max: 100)

  • offset (optional): Pagination offset (default: 0)

  • format (optional): Response format - 'markdown' or 'json' (default: 'markdown')

Example:

{
  "category": "Öl",
  "country": "Sverige",
  "max_price": 50,
  "limit": 10
}

systembolaget_get_product

Get detailed information about a specific product.

Parameters:

  • product_number (required): The product number (artikelnummer)

  • format (optional): Response format - 'markdown' or 'json' (default: 'markdown')

Example:

{
  "product_number": "12345"
}

systembolaget_search_stores

Search for stores by name or location.

Parameters:

  • query (optional): Search query for store name or location

  • city (optional): Filter by city

  • limit (optional): Number of results (default: 20, max: 100)

  • offset (optional): Pagination offset (default: 0)

  • format (optional): Response format - 'markdown' or 'json' (default: 'markdown')

Example:

{
  "city": "Stockholm",
  "limit": 5
}

Development

Running Tests

With uv:

uv run pytest

With pip/venv:

pytest

Code Formatting

With uv:

uv run black systembolaget_mcp.py

With pip/venv:

black systembolaget_mcp.py

Type Checking

With uv:

uv run mypy systembolaget_mcp.py

With pip/venv:

mypy systembolaget_mcp.py

Linting

With uv:

uv run ruff check systembolaget_mcp.py

With pip/venv:

ruff check systembolaget_mcp.py

Adding Dependencies

With uv:

uv add <package-name>
# For dev dependencies:
uv add --dev <package-name>

With pip:

# Edit pyproject.toml manually, then:
pip install -e ".[dev]"

API Key Extraction

This MCP server automatically extracts the API key from Systembolaget's website - no manual configuration needed!

How it works

The server uses the same technique as AlexGustafsson/systembolaget-api:

  1. Fetches Systembolaget's main website

  2. Extracts the Next.js app bundle path from the HTML

  3. Downloads the app bundle JavaScript file

  4. Extracts the NEXT_PUBLIC_API_KEY_APIM value

  5. Caches the key for subsequent requests

This approach works because Systembolaget's public website uses the same API key in their frontend code.

Manual Configuration (Optional)

If you prefer to use a custom API key or if automatic extraction fails:

  1. Visit api-portal.systembolaget.se

  2. Create an account and subscribe to the APIs

  3. Copy your API key

  4. Set it as an environment variable: SYSTEMBOLAGET_API_KEY=your-key

The server will use your custom key instead of extracting one automatically.

Architecture

The server is built using:

  • FastMCP: Anthropic's Python SDK for building MCP servers

  • Pydantic v2: For input validation and schema generation

  • httpx: For async HTTP requests

  • Type hints: Full type safety throughout

Design Principles

  • Agent-centric design: Tools are designed for complete workflows, not just API wrappers

  • Automatic API key extraction: No manual configuration required - keys are extracted automatically

  • Error handling: Comprehensive error handling with actionable messages

  • Pagination: All list operations support pagination to manage large result sets

  • Format flexibility: Both human-readable (Markdown) and machine-readable (JSON) outputs

  • Character limits: Responses are truncated to prevent overwhelming context windows

  • Caching: API keys are cached to minimize overhead

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Acknowledgments

Support

For issues and questions:

Available Tools

3 tools
systembolaget_get_productB
Read-only

Get detailed information about a specific product.

Retrieves comprehensive details about a product including price, volume,
alcohol content, taste profile, food pairings, and availability.

Args:
    params: Product parameters including product number and format

Returns:
    str: Detailed product information

Inputs: params (required). Returns: result

systembolaget_search_productsA
Read-only

Search for products in Systembolaget's catalog.

This tool searches Systembolaget's product database with various filters like
category, price range, alcohol content, and country of origin. Returns detailed
product information including prices, volumes, and taste profiles.

Args:
    params: Search parameters including query, filters, and pagination options

Returns:
    str: Formatted list of matching products with details

Inputs: params (required). Returns: result

systembolaget_search_storesA
Read-only

Search for Systembolaget stores.

Find stores by name, location, or city. Returns store information including
addresses, phone numbers, and opening hours.

Note: The API returns all matching stores, so pagination is applied client-side.
This means all results are fetched from the API even when using pagination.

Args:
    params: Search parameters including query, city filter, and pagination

Returns:
    str: List of matching stores with details

Inputs: params (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 3 tools

    Disambiguation4/5

    The three tools split cleanly along resource lines: products vs. stores, and within products, a filtered search vs. a single-item lookup by product number. The only mild overlap is between search_products and get_product, but the descriptions make the browse-vs-fetch-by-id distinction clear enough.

    Naming Consistency5/5

    All three follow the same predictable pattern: a shared 'systembolaget_' prefix plus verb_noun (search_products, get_product, search_stores). No mixed conventions or vague verbs.

    Tool Count4/5

    Three tools is on the thin side but each maps to a distinct, defensible operation (catalog search, product detail, store locator) for a read-only catalog API. It sits at the low end of the well-scoped range rather than being padded or redundant.

    Completeness3/5

    Core read workflows are covered, but there are notable gaps: no way to discover available filter/category values, no store detail-or-availability lookup, and no stock check at a specific store. Agents can partially work around these via search filters, but lifecycle coverage is thin even for a read-only domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides AI assistants with access to Finland's Alko alcohol product catalog, enabling product search across 11,900+ items, store availability checks, Vivino ratings lookup, and personalized recommendations based on food pairings and preferences.
      9
      17
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Enables natural language search for cocktail recipes and ingredient information through TheCocktailDB API. Supports searching by cocktail name, ingredient, category, or alcohol content to discover recipes and recommendations.
      5
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables searching and retrieving listings from Sweden's Blocket marketplace, including cars, boats, motorcycles, and general items, without requiring an API key.
      6
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to search and compare Norwegian grocery prices across multiple chains, retrieve price history, and access product details through the kassal.app API.
      MIT