webhallen-mcp
v1.0.1
Published
MCP server for interacting with Webhallen - search products, manage shared wishlists (önskelistor)
Maintainers
Readme
webhallen-mcp
MCP server for interacting with Webhallen. Search products and manage shared wishlists (önskelistor) — designed for a shared office shopping list.
Uses pure HTTP calls (no browser dependency), so it works from background agents.
Tools
| Tool | Auth required | Description |
|------|:---:|-------------|
| login | - | Log in with username/password |
| search_products | - | Search products by keyword (returns IDs, names, prices, stock) |
| get_product | - | Get details for a specific product by ID |
| list_wishlists | ✓ | List all your wishlists and their contents |
| get_wishlist | ✓ | Get contents of a specific wishlist |
| create_wishlist | ✓ | Create a new wishlist (e.g. "Kontoret Inköpslista") |
| add_to_wishlist | ✓ | Add a product to a wishlist |
| delete_wishlist | ✓ | Delete a wishlist |
Authentication
Two options:
Option A: Environment variables (recommended for background agents)
Set WEBHALLEN_USERNAME and WEBHALLEN_PASSWORD. The server logs in automatically on first authenticated request.
Option B: Login tool
Call the login tool with username and password. The session is kept in memory for the server's lifetime.
Option C: Existing session cookie
Set WEBHALLEN_COOKIES with a webhallen_session=... cookie value extracted from a browser session. Use this if you already have a valid session and want to avoid sending credentials.
Search works without authentication. Wishlist operations require it.
Installation
Build
cd webhallen-mcp
npm install
npm run buildConfigure in opencode
Add to your opencode.json:
{
"mcp": {
"webhallen": {
"command": "node",
"args": ["/path/to/webhallen-mcp/dist/index.js"],
"env": {
"WEBHALLEN_USERNAME": "your_username",
"WEBHALLEN_PASSWORD": "your_password"
}
}
}
}API endpoints used
| Endpoint | Method | Auth | Purpose |
|----------|--------|:---:|---------|
| /api/login | POST | - | Authenticate with username/password |
| /api/me | GET | ✓ | Current user info |
| /api/productdiscovery/autocomplete/{query} | GET | - | Product search |
| /api/productdiscovery/category/{id} | GET | - | Browse by category |
| /api/wishlist | GET | ✓ | List all wishlists |
| /api/wishlist | POST | ✓ | Create wishlist |
| /api/wishlist/{id} | PUT | ✓ | Add product to wishlist |
| /api/wishlist/{id} | DELETE | ✓ | Delete wishlist |
Usage examples
Ask the agent:
- "Sök efter Nintendo Switch 2 på Webhallen"
- "Skapa en önskelista som heter Kontoret Inköpslista"
- "Lägg till produkt 378404 i önskelistan"
- "Visa alla önskelistor"
