{
  "markdown": "<!-- mcp-name: io.github.tudorgrigoriu90/sverige-begagnad-mcp -->\n\n<div align=\"center\">\n\n# 🇸🇪 Sverige Begagnad MCP\n\n**Find quality second-hand deals across Sweden — straight from your AI assistant.**\n\nAn MCP server that lets Claude (or any MCP client) search **Blocket**, **Tradera**,\n**Klaravik**, and **Vinted** (plus optional local Facebook Marketplace) for used items\nworth buying, restoring, and reselling.\n\n[![PyPI](https://img.shields.io/pypi/v/sverige-begagnad-mcp.svg?logo=pypi&logoColor=white)](https://pypi.org/project/sverige-begagnad-mcp/)\n[![MCP Registry](https://img.shields.io/badge/MCP%20Registry-listed-1f6feb.svg)](https://registry.modelcontextprotocol.io/v0/servers?search=sverige-begagnad)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)\n[![Tradera API v4](https://img.shields.io/badge/Tradera-REST%20v4-00A46C.svg)](https://api.tradera.com/)\n[![Blocket](https://img.shields.io/badge/Blocket-search-E4002B.svg)](https://www.blocket.se/)\n\n</div>\n\n---\n\n## 💬 What you can ask Claude\n\nOnce connected, just talk to it:\n\n> 🪑 *\"Find String shelves (String hylla) near Växjö under 1000 SEK.\"*\n\n> 🛠️ *\"Search Blocket and Tradera for Festool or Makita tools I could flip for profit.\"*\n\n> 🔊 *\"What Bang & Olufsen speakers are on Tradera between 500 and 3000 SEK?\"*\n\n> 🚲 *\"List Blocket categories, then look for quality bikes (Kronan, Crescent) in Skåne.\"*\n\n> 📈 *\"Do this week's sourcing sweep for Scandinavian design in Kronoberg and neighbouring counties, ranked by estimated profit.\"*\n\nClaude picks the right tools, applies your filters, and hands back titles, prices,\nlocations, links, and images — from both marketplaces in one go.\n\n## ✨ Features\n\n| | |\n|---|---|\n| 🔎 **Four marketplaces** | Blocket + Tradera + Klaravik + Vinted, searched together or separately, normalized into one shape |\n| 🎯 **Rich filters** | Price min/max, category, county (Tradera) · region + category (Blocket) |\n| 📍 **Location-aware** | Every Blocket result carries `coordinates` + `distance` for precise radius filtering |\n| 🌍 **General by default** | Searches all of Sweden; scope it to your area via config or per-search |\n| 🧭 **Discovery tools** | List categories, regions, and counties so the agent filters intelligently |\n| 🧩 **Easy install** | One-command Claude Code plugin, `uvx`, or from source — each user brings their own keys |\n| ✅ **Tested live** | Every source verified end-to-end against the real APIs |\n\n## 📊 Source status\n\n| Source | Method | Stability |\n|---|---|---|\n| **Tradera** | Official REST API (v4) | 🟢 Solid — tested live; requires free registration |\n| **Blocket** | Community package (`blocket-api`) | 🟡 Semi-stable, unofficial — tested live |\n| **Klaravik** | Internal JSON endpoint | 🟡 Unofficial — tested live; auction current-bid prices |\n| **Vinted** | Internal API (bot-protected) | 🟠 Unofficial, most fragile — works best from a residential IP |\n| **Facebook Marketplace** | Disabled by default | 🔴 Risky, local-only — see `facebook_client.py` |\n\n---\n\n## 🔑 Get Tradera credentials (required for all install methods)\n\n1. Register (free) at **https://api.tradera.com/register**.\n2. Accept the Terms of Use + Logo Terms of Use.\n3. Create an application and copy the numeric **App ID** and the **App Key**\n   (GUID secret). You'll supply these as `TRADERA_APP_ID` / `TRADERA_APP_KEY`.\n\n> Blocket needs no credentials. Facebook Marketplace is off by default.\n\n## 📦 Installation\n\nEvery user runs their own copy with their own Tradera keys — pick whichever method\nfits your client. `uvx`-based methods need [uv](https://docs.astral.sh/uv/)\ninstalled (`curl -LsSf https://astral.sh/uv/install.sh | sh`, or\n`winget install astral-sh.uv` on Windows) — no cloning or virtualenv needed.\n\n### Option 1 — Claude Code plugin (easiest)\n\n```bash\nclaude plugin marketplace add tudorgrigoriu90/sverige-begagnad-mcp\nclaude plugin install sverige-begagnad@sverige-begagnad-marketplace\n```\n\nThen export your keys (the plugin passes them through to the server):\n\n```bash\nexport TRADERA_APP_ID=...      # Windows PowerShell: $env:TRADERA_APP_ID=\"...\"\nexport TRADERA_APP_KEY=...\nexport BLOCKET_LOCATIONS=      # optional; empty = all of Sweden\n```\n\nRestart Claude Code — you'll have `search_blocket`, `search_tradera`, `search_all`,\nand more. The plugin runs the server via `uvx` straight from GitHub.\n\n### Option 2 — uvx (Claude Desktop or any MCP client)\n\nAdd to your client's MCP config (Claude Desktop: **Settings → Developer → Edit Config**):\n\n```json\n{\n  \"mcpServers\": {\n    \"sverige-begagnad\": {\n      \"command\": \"uvx\",\n      \"args\": [\"sverige-begagnad-mcp\"],\n      \"env\": {\n        \"TRADERA_APP_ID\": \"...\",\n        \"TRADERA_APP_KEY\": \"...\",\n        \"BLOCKET_LOCATIONS\": \"\"\n      }\n    }\n  }\n}\n```\n\n`uvx` fetches the published package from PyPI on first run and caches it. Restart the client.\n\n### Option 3 — From source (development)\n\n```bash\ngit clone https://github.com/tudorgrigoriu90/sverige-begagnad-mcp\ncd sverige-begagnad-mcp\npython -m venv .venv\nsource .venv/bin/activate   # Windows: .venv\\Scripts\\activate\npip install -e .\ncp .env.example .env        # then fill in your keys\n```\n\nPoint your client at the venv's `sverige-begagnad-mcp` command (or\n`python -m sverige_begagnad_mcp.server`) with `cwd` set to the repo.\n\n<details>\n<summary>✅ <b>Verify it works (optional)</b></summary>\n\nFrom a source checkout with keys set (in `.env` or the environment):\n\n```bash\n# Tradera — official REST API v4 (https://api.tradera.com/v4, header auth)\npython -m sverige_begagnad_mcp.tradera_client\n\n# Blocket — unofficial community API\npython -c \"import asyncio; from sverige_begagnad_mcp.blocket_client import search_blocket; print(asyncio.run(search_blocket('String hylla')))\"\n```\n\nBoth are tested live. If Tradera's shape ever drifts, the OpenAPI spec is at\n`https://api.tradera.com/openapi.json`.\n</details>\n\n---\n\n## 🧰 Tools\n\n| Tool | Purpose |\n|---|---|\n| `search_blocket(query, category?, locations?, max_pages?)` | Search Blocket |\n| `list_blocket_categories()` | Valid category names |\n| `list_blocket_locations()` | Valid region (län) names |\n| `search_tradera(query, category_id?, price_min?, price_max?, county_id?)` | Search Tradera |\n| `list_tradera_categories()` | Category tree → `category_id` |\n| `list_tradera_counties()` | County ids for the optional `county_id` filter |\n| `search_klaravik(query)` | Search Klaravik auctions (current-bid prices) |\n| `search_vinted(query, price_min?, price_max?)` | Search Vinted fashion listings |\n| `search_facebook_marketplace(...)` | Disabled by default (local-only) |\n| `search_all(query, blocket_category?, blocket_locations?, tradera_category_id?, price_min?, price_max?)` | Blocket + Tradera + Klaravik + Vinted in one call |\n| `health_check()` | Ping every source and report which are still fetching data |\n\n## 📍 Geographic scope\n\nSearches default to **all of Sweden**. Three ways to set the area, in order of precedence:\n\n1. **Per-search** — pass `locations` to `search_blocket` (or `blocket_locations` to\n   `search_all`), e.g. `[\"KRONOBERG\", \"KALMAR\"]`. Use `list_blocket_locations()` for valid names.\n2. **A personal default** — set `BLOCKET_LOCATIONS` in `.env` to a comma-separated list of region names.\n3. **Nothing set** — all of Sweden.\n\nBlocket's filter is **regional (län)**, not a precise km radius. For a tight\n\"within X min drive\" filter, let Claude do the final check per listing — each result\nincludes the ad's text location plus `coordinates` (lat/lon) and Blocket's own\n`distance`. Tradera is national with shipping, so it has no radius concept (there's\nan optional `county_id` filter, rarely needed).\n\n<details>\n<summary>🗺️ <b>Example: my own Växjö / Älmhult setup</b></summary>\n\nPersonal scope lives only in `.env` (gitignored — not a shipped default):\n\n```dotenv\nBLOCKET_LOCATIONS=KRONOBERG,KALMAR,JONKOPING,HALLAND,SKANE\n```\n</details>\n\n<details>\n<summary>🤖 <b>Power user: a full weekly \"sourcing agent\" prompt</b></summary>\n\nPaste this as your instructions to turn the tools into a profit-ranked weekly sweep.\nIt runs many targeted Swedish searches, filters by radius/quality, estimates profit,\nand returns a ranked shortlist. Tune the brands, region, and thresholds to taste.\n\n```text\nROLE: You are a sourcing assistant for a personal, quality-focused loppis (flip).\nEach week, search Blocket and Tradera for second-hand items to buy, minimally\nrestore, and resell at a profit.\n\nMETHOD: Search with SWEDISH terms. Run MANY targeted searches — by BRAND and by\nCATEGORY — across both sources; deduplicate. Prices are in SEK.\n\nAREA: within ~35 km straight-line of Växjö (56.88, 14.81) or Älmhult (56.55, 14.14),\ncomputed from each Blocket result's `coordinates`. Tradera ships nationally, so\ninclude shippable Tradera items too.\n\nQUALITY: recognized brand or top craftsmanship (String, Artek, Fritz Hansen, Louis\nPoulsen, Iittala, Orrefors, Bang & Olufsen, Braun, Marantz, Bahco, Hilti, Festool,\nMakita, Kronan, Crescent…); \"bra skick\"/\"nyskick\" or minor cosmetic wear; asking\nprice clearly below market; only minimal restoration (clean, polish, light sand,\nsmall off-the-shelf parts).\n\nPROFIT: estimate resale value (use web search for comparables if available — do NOT\ninvent sold prices). Net = resale − (purchase + restoration + pickup/courier), with\nstated assumptions (~80 SEK pickup fuel, ~70 SEK courier, 0–150 SEK materials).\nInclude only items with estimated net profit ≥ 300 SEK. Note that Tradera auction\nprices may rise before close.\n\nOUTPUT: ranked by net profit descending, max 15. For each: title + link + location\n(distance from Växjö or \"ships nationally\"), asking vs. estimated market price, net\nprofit with assumptions, 2–3 restoration steps, and a risk note. End with a 2–3\nsentence read on the week's trends. Don't pad with weak candidates.\n```\n</details>\n\n---\n\n## 🚫 Facebook Marketplace — why it's disabled\n\nThere is no public API for Facebook Marketplace. The only known methods (session\ncookies or headless-browser scraping) explicitly violate Facebook's Terms of Service.\nThe `src/sverige_begagnad_mcp/facebook_client.py` module is intentionally left as a\nstub, with an explanation of how you could implement it yourself, at your own risk.\n\n## 🛠️ Maintenance & publishing\n\n<details>\n<summary>Maintainer notes</summary>\n\n- **If a source breaks:** Blocket → check https://pypi.org/project/blocket-api/ for a\n  newer version; Tradera → the OpenAPI spec at https://api.tradera.com/openapi.json.\n- **PyPI** (enables the short `uvx sverige-begagnad-mcp`): `python -m build` then\n  `twine upload dist/*`. Bump `version` in `pyproject.toml` and\n  `src/sverige_begagnad_mcp/__init__.py` first.\n- **Plugin marketplace:** the `.claude-plugin/marketplace.json` + `plugins/` dirs make\n  this repo itself the marketplace — no extra hosting.\n- **MCP Registry:** `server.json` is ready; publish with the `mcp-publisher` CLI after\n  the PyPI release (see the Registry publishing guide).\n</details>\n\n## 📄 License\n\n[MIT](LICENSE) — each user runs their own copy with their own credentials. Note that\nBlocket has no official API; this uses an unofficial community package, so treat the\nBlocket half accordingly.\n",
  "bytes": 11264,
  "sha": "230e77d9c8dfb6f91ccb629c54ab7a1c98c47d514b6488abf0d928354a112c26",
  "repo_slug": "tudorgrigoriu90/sverige-begagnad-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_tudorgrigoriu90_sverige_begagn_a06cf2fe/readme"
}