digikala-mcp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- digikala_mcp-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +42 -0
- digikala_mcp-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- digikala_mcp-0.1.0/.github/dependabot.yml +10 -0
- digikala_mcp-0.1.0/.github/workflows/ci.yml +21 -0
- digikala_mcp-0.1.0/.github/workflows/publish.yml +51 -0
- digikala_mcp-0.1.0/.gitignore +6 -0
- digikala_mcp-0.1.0/LICENSE +21 -0
- digikala_mcp-0.1.0/PKG-INFO +310 -0
- digikala_mcp-0.1.0/README.md +286 -0
- digikala_mcp-0.1.0/pyproject.toml +52 -0
- digikala_mcp-0.1.0/server.json +32 -0
- digikala_mcp-0.1.0/src/digikala_mcp/__init__.py +5 -0
- digikala_mcp-0.1.0/src/digikala_mcp/catalog.py +508 -0
- digikala_mcp-0.1.0/src/digikala_mcp/http.py +117 -0
- digikala_mcp-0.1.0/src/digikala_mcp/product.py +296 -0
- digikala_mcp-0.1.0/src/digikala_mcp/registry.py +16 -0
- digikala_mcp-0.1.0/src/digikala_mcp/server.py +51 -0
- digikala_mcp-0.1.0/src/digikala_mcp/services.py +118 -0
- digikala_mcp-0.1.0/tests/conftest.py +63 -0
- digikala_mcp-0.1.0/tests/fixtures/autocomplete.json +93 -0
- digikala_mcp-0.1.0/tests/fixtures/best_selling.json +134 -0
- digikala_mcp-0.1.0/tests/fixtures/brand_products.json +151 -0
- digikala_mcp-0.1.0/tests/fixtures/category_products.json +112 -0
- digikala_mcp-0.1.0/tests/fixtures/category_tree.json +119 -0
- digikala_mcp-0.1.0/tests/fixtures/comments.json +160 -0
- digikala_mcp-0.1.0/tests/fixtures/compare.json +288 -0
- digikala_mcp-0.1.0/tests/fixtures/deals.json +199 -0
- digikala_mcp-0.1.0/tests/fixtures/fresh_category.json +194 -0
- digikala_mcp-0.1.0/tests/fixtures/fresh_deals.json +199 -0
- digikala_mcp-0.1.0/tests/fixtures/fresh_product.json +187 -0
- digikala_mcp-0.1.0/tests/fixtures/fresh_redirect.json +23 -0
- digikala_mcp-0.1.0/tests/fixtures/fresh_search.json +126 -0
- digikala_mcp-0.1.0/tests/fixtures/geo.json +28 -0
- digikala_mcp-0.1.0/tests/fixtures/gold18.json +18 -0
- digikala_mcp-0.1.0/tests/fixtures/gold_list.json +46 -0
- digikala_mcp-0.1.0/tests/fixtures/installments.json +29 -0
- digikala_mcp-0.1.0/tests/fixtures/plus_plans.json +154 -0
- digikala_mcp-0.1.0/tests/fixtures/price_chart.json +85 -0
- digikala_mcp-0.1.0/tests/fixtures/product.json +556 -0
- digikala_mcp-0.1.0/tests/fixtures/questions.json +165 -0
- digikala_mcp-0.1.0/tests/fixtures/reverse_geo.json +12 -0
- digikala_mcp-0.1.0/tests/fixtures/search.json +511 -0
- digikala_mcp-0.1.0/tests/fixtures/seller.json +249 -0
- digikala_mcp-0.1.0/tests/fixtures/similar.json +170 -0
- digikala_mcp-0.1.0/tests/test_catalog.py +275 -0
- digikala_mcp-0.1.0/tests/test_http.py +63 -0
- digikala_mcp-0.1.0/tests/test_live_catalog.py +118 -0
- digikala_mcp-0.1.0/tests/test_live_product.py +70 -0
- digikala_mcp-0.1.0/tests/test_live_services.py +28 -0
- digikala_mcp-0.1.0/tests/test_product.py +160 -0
- digikala_mcp-0.1.0/tests/test_services.py +49 -0
- digikala_mcp-0.1.0/uv.lock +1112 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: A tool failed or returned wrong data
|
|
3
|
+
labels: [bug]
|
|
4
|
+
body:
|
|
5
|
+
- type: input
|
|
6
|
+
id: tool
|
|
7
|
+
attributes:
|
|
8
|
+
label: Tool
|
|
9
|
+
description: Which tool, e.g. dk_find_cheapest
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: input
|
|
14
|
+
attributes:
|
|
15
|
+
label: Arguments and result
|
|
16
|
+
description: The arguments the agent sent and the error or wrong output. Remove anything personal.
|
|
17
|
+
render: json
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: expected
|
|
22
|
+
attributes:
|
|
23
|
+
label: What you expected
|
|
24
|
+
description: e.g. the price shown on digikala.com for the same product
|
|
25
|
+
- type: input
|
|
26
|
+
id: client
|
|
27
|
+
attributes:
|
|
28
|
+
label: MCP client and OS
|
|
29
|
+
placeholder: Claude Desktop 1.x on Windows 11
|
|
30
|
+
- type: dropdown
|
|
31
|
+
id: network
|
|
32
|
+
attributes:
|
|
33
|
+
label: Network
|
|
34
|
+
options:
|
|
35
|
+
- Iranian IP, no VPN
|
|
36
|
+
- VPN or proxy
|
|
37
|
+
- DIGIKALA_MCP_PROXY set
|
|
38
|
+
- type: input
|
|
39
|
+
id: version
|
|
40
|
+
attributes:
|
|
41
|
+
label: digikala-mcp version
|
|
42
|
+
placeholder: "0.1.0"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python: ["3.10", "3.11", "3.12", "3.13"]
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v7
|
|
16
|
+
- uses: astral-sh/setup-uv@v10.2.0
|
|
17
|
+
with:
|
|
18
|
+
python-version: ${{ matrix.python }}
|
|
19
|
+
- run: uv sync --locked
|
|
20
|
+
- run: uv run ruff check .
|
|
21
|
+
- run: uv run pytest -q
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
# Tag a release (git tag v0.1.0 && git push --tags) after bumping the version in
|
|
4
|
+
# pyproject.toml and server.json.
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags: ["v*"]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
pypi:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
environment: pypi
|
|
13
|
+
permissions:
|
|
14
|
+
id-token: write # PyPI trusted publishing
|
|
15
|
+
contents: write # GitHub Release
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v7
|
|
18
|
+
- uses: astral-sh/setup-uv@v10.2.0
|
|
19
|
+
- name: Check versions match the tag
|
|
20
|
+
run: |
|
|
21
|
+
TAG=${GITHUB_REF_NAME#v}
|
|
22
|
+
grep -q "^version = \"$TAG\"" pyproject.toml
|
|
23
|
+
test "$(jq -r .version server.json)" = "$TAG"
|
|
24
|
+
test "$(jq -r '.packages[0].version' server.json)" = "$TAG"
|
|
25
|
+
- run: uv sync --locked && uv run pytest -q
|
|
26
|
+
- run: uv build
|
|
27
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
28
|
+
- run: gh release create "$GITHUB_REF_NAME" dist/* --generate-notes --title "$GITHUB_REF_NAME"
|
|
29
|
+
env:
|
|
30
|
+
GH_TOKEN: ${{ github.token }}
|
|
31
|
+
|
|
32
|
+
mcp-registry:
|
|
33
|
+
needs: pypi
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
permissions:
|
|
36
|
+
id-token: write # MCP Registry login via GitHub OIDC
|
|
37
|
+
contents: read
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v7
|
|
40
|
+
- name: Wait for PyPI to serve the new version
|
|
41
|
+
run: |
|
|
42
|
+
for i in $(seq 1 30); do
|
|
43
|
+
curl -sf "https://pypi.org/pypi/digikala-mcp/${GITHUB_REF_NAME#v}/json" >/dev/null && exit 0
|
|
44
|
+
sleep 10
|
|
45
|
+
done
|
|
46
|
+
exit 1
|
|
47
|
+
- name: Install mcp-publisher
|
|
48
|
+
run: |
|
|
49
|
+
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
|
|
50
|
+
- run: ./mcp-publisher login github-oidc
|
|
51
|
+
- run: ./mcp-publisher publish
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sepehr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: digikala-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Unofficial read-only MCP server for Digikala: search products, compare sellers and prices, price history, reviews, deals.
|
|
5
|
+
Project-URL: Homepage, https://github.com/sepehr071/digikala-mcp
|
|
6
|
+
Project-URL: Issues, https://github.com/sepehr071/digikala-mcp/issues
|
|
7
|
+
Author-email: Sepehr <sepehr@nextofx.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: digikala,e-commerce,iran,mcp,model-context-protocol,price-comparison,shopping
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: httpx>=0.27
|
|
22
|
+
Requires-Dist: mcp<3,>=2.2
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
<!-- mcp-name: io.github.sepehr071/digikala-mcp -->
|
|
26
|
+
|
|
27
|
+
<div align="center">
|
|
28
|
+
|
|
29
|
+
# 🛍️ digikala-mcp
|
|
30
|
+
|
|
31
|
+
**Let your AI agent shop around on Digikala.**<br>
|
|
32
|
+
Search Iran's largest online store, compare every seller's offer, check a product's price history,<br>
|
|
33
|
+
read reviews and Q&A, and catch today's Incredible Offers, all from Claude, Cursor or Copilot.
|
|
34
|
+
|
|
35
|
+
[](https://pypi.org/project/digikala-mcp/)
|
|
36
|
+
[](https://pypi.org/project/digikala-mcp/)
|
|
37
|
+
[](https://github.com/sepehr071/digikala-mcp/actions/workflows/ci.yml)
|
|
38
|
+
[](https://registry.modelcontextprotocol.io/v0/servers?search=digikala-mcp)
|
|
39
|
+
[](https://github.com/sepehr071/digikala-mcp/blob/main/LICENSE)
|
|
40
|
+
|
|
41
|
+
[](https://cursor.com/en/install-mcp?name=digikala&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyJkaWdpa2FsYS1tY3AiXX0=)
|
|
42
|
+
[](https://vscode.dev/redirect/mcp/install?name=digikala&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22digikala-mcp%22%5D%7D)
|
|
43
|
+
|
|
44
|
+
[Quick start](#quick-start) · [What it can do](#what-it-can-do) · [Tools](#tools) · [FAQ](#faq) · [فارسی](#فارسی)
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Why
|
|
51
|
+
|
|
52
|
+
Digikala lists the same phone many times: different colors, memory sizes, bundles and a dozen sellers per
|
|
53
|
+
listing, with prices that move every day. Sorting by "cheapest" puts phone cases first. Finding *the real
|
|
54
|
+
cheapest offer, and whether today's price is a good one* means a lot of clicking. An agent with
|
|
55
|
+
`digikala-mcp` does it in three calls:
|
|
56
|
+
|
|
57
|
+
> **You:** Cheapest Samsung Galaxy A07 on Digikala, and is now a good time to buy?
|
|
58
|
+
>
|
|
59
|
+
> **Agent:** *calls* `dk_find_cheapest(query="samsung a07")` → `dk_product(product_id=20109389)` → `dk_price_history(product_id=20109389)`
|
|
60
|
+
>
|
|
61
|
+
> | Price | Model | Seller |
|
|
62
|
+
> |---:|---|---|
|
|
63
|
+
> | **42,503,600** | Galaxy A07 64 GB / 4 GB | Digikala (same-day delivery in Tehran) |
|
|
64
|
+
> | **44,518,000** | Galaxy A07 64 GB / 4 GB + 25 W charger | Sepahan Hamrah Yaghout |
|
|
65
|
+
> | **46,811,800** | Galaxy A07 128 GB / 4 GB | Digikala |
|
|
66
|
+
>
|
|
67
|
+
> The 64 GB model is cheapest at 42,503,600, sold by Digikala itself; the next seller asks 42,918,000.
|
|
68
|
+
> But it's not a great moment: the black one sold for 34,499,000 yesterday and 33,200,000 at its lowest this
|
|
69
|
+
> month, and the 30-day low was 28,373,600. Today's best offer is about 23% above yesterday's, so waiting may pay off.
|
|
70
|
+
|
|
71
|
+
<sub>Real tool output from 2026-10-03; prices change all the time. Prices are in Toman.</sub>
|
|
72
|
+
|
|
73
|
+
## What it can do
|
|
74
|
+
|
|
75
|
+
- 🔎 **Search** the whole catalogue in Persian or English, with price range, brand and in-stock filters
|
|
76
|
+
- 💸 **Find the real cheapest match**, with accessories filtered out, and every seller's offer for a product
|
|
77
|
+
- 📈 **Judge a price** with about 30 days of daily price history and the 30-day low
|
|
78
|
+
- 🗂️ **Browse** categories, brands, sellers and best sellers, sorted by price, sales, views, newest or buyers' pick
|
|
79
|
+
- ⭐ **Check quality** with reviews, pros/cons, buyer Q&A and seller reputation
|
|
80
|
+
- ⚡ **Catch deals**: Incredible Offers and supermarket (Digikala Fresh) discounts
|
|
81
|
+
- 🧾 **Extras**: spec comparison, installment plans, Digikala Plus shipping plans, live gold and coin prices
|
|
82
|
+
- 🔒 **Read-only by design**: no login, no cart, no orders, no payment
|
|
83
|
+
|
|
84
|
+
## Quick start
|
|
85
|
+
|
|
86
|
+
You need [uv](https://docs.astral.sh/uv/getting-started/installation/). No API key or account.
|
|
87
|
+
|
|
88
|
+
<details open>
|
|
89
|
+
<summary><b>Claude Code</b></summary>
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
claude mcp add digikala -- uvx digikala-mcp
|
|
93
|
+
```
|
|
94
|
+
</details>
|
|
95
|
+
|
|
96
|
+
<details>
|
|
97
|
+
<summary><b>Claude Desktop</b></summary>
|
|
98
|
+
|
|
99
|
+
Settings → Developer → Edit Config, then add:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"mcpServers": {
|
|
104
|
+
"digikala": { "command": "uvx", "args": ["digikala-mcp"] }
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
</details>
|
|
109
|
+
|
|
110
|
+
<details>
|
|
111
|
+
<summary><b>Cursor</b></summary>
|
|
112
|
+
|
|
113
|
+
Click **Install in Cursor** above, or add the Claude Desktop block to `~/.cursor/mcp.json`.
|
|
114
|
+
</details>
|
|
115
|
+
|
|
116
|
+
<details>
|
|
117
|
+
<summary><b>VS Code (Copilot agent mode)</b></summary>
|
|
118
|
+
|
|
119
|
+
Click **Install in VS Code** above, or add to `.vscode/mcp.json`:
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"servers": {
|
|
124
|
+
"digikala": { "type": "stdio", "command": "uvx", "args": ["digikala-mcp"] }
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
</details>
|
|
129
|
+
|
|
130
|
+
<details>
|
|
131
|
+
<summary><b>Anything else</b></summary>
|
|
132
|
+
|
|
133
|
+
It's a standard stdio MCP server: run `uvx digikala-mcp`, or `pip install digikala-mcp` and run `digikala-mcp`.
|
|
134
|
+
</details>
|
|
135
|
+
|
|
136
|
+
Then just ask:
|
|
137
|
+
|
|
138
|
+
- "Cheapest AirPods-style earbuds under 3 million Toman with at least 4 stars?"
|
|
139
|
+
- "Compare the Galaxy A07 64 GB and 128 GB. Is the bigger one worth the difference?"
|
|
140
|
+
- "Is this seller reliable? CGDG9"
|
|
141
|
+
- <span dir="rtl">ارزان‌ترین شیر کم‌چرب در سوپرمارکت دیجی‌کالا چند است؟</span>
|
|
142
|
+
|
|
143
|
+
## How it works
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
AI agent (Claude, Cursor, Copilot, ...)
|
|
147
|
+
│
|
|
148
|
+
│ MCP over stdio
|
|
149
|
+
▼
|
|
150
|
+
digikala-mcp (runs on your machine)
|
|
151
|
+
│
|
|
152
|
+
│ HTTPS
|
|
153
|
+
└──────▶ api.digikala.com products, sellers, deals, Fresh supermarket
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
`digikala-mcp` runs locally and calls the same public endpoints the digikala.com web app uses. There's no
|
|
157
|
+
hosted server in between, no API key, and nothing about you is sent anywhere else.
|
|
158
|
+
|
|
159
|
+
## Tools
|
|
160
|
+
|
|
161
|
+
Product ids are the number in a `digikala.com/product/dkp-<id>/` link. Every list returns compact product cards:
|
|
162
|
+
id, title, brand, price, discount, stock, seller, rating and the product link.
|
|
163
|
+
|
|
164
|
+
<details open>
|
|
165
|
+
<summary><b>🔎 Find products</b> (10)</summary>
|
|
166
|
+
|
|
167
|
+
| Tool | What it does |
|
|
168
|
+
|---|---|
|
|
169
|
+
| `dk_search` | Search by words with sort, price range, brand and in-stock filters |
|
|
170
|
+
| `dk_find_cheapest` | Cheapest in-stock real matches for a query, accessories dropped, one list |
|
|
171
|
+
| `dk_suggest` | Autocomplete: better keywords, category codes and brand ids |
|
|
172
|
+
| `dk_categories` | Find category codes and main-category ids |
|
|
173
|
+
| `dk_category_products` | Browse a category with sort and filters, optionally one brand |
|
|
174
|
+
| `dk_brand_products` | Browse a brand's products |
|
|
175
|
+
| `dk_seller` | A seller's rating, on-time shipping, cancellations, returns and products |
|
|
176
|
+
| `dk_deals` | Incredible Offers or supermarket deals, biggest discount first |
|
|
177
|
+
| `dk_best_sellers` | Current best sellers, overall or per main category |
|
|
178
|
+
| `dk_fresh_search` | Search or browse Digikala Fresh, the supermarket |
|
|
179
|
+
</details>
|
|
180
|
+
|
|
181
|
+
<details open>
|
|
182
|
+
<summary><b>📦 One product</b> (7)</summary>
|
|
183
|
+
|
|
184
|
+
| Tool | What it does |
|
|
185
|
+
|---|---|
|
|
186
|
+
| `dk_product` | Price, stock, specs and every seller's offer (color, warranty, shipping), cheapest first |
|
|
187
|
+
| `dk_price_history` | About 30 days of daily prices per color, with low and high |
|
|
188
|
+
| `dk_reviews` | Customer reviews with stars, pros/cons and verified-buyer flag |
|
|
189
|
+
| `dk_questions` | Customer questions with their top answers |
|
|
190
|
+
| `dk_similar` | Similar products, e.g. cheaper alternatives |
|
|
191
|
+
| `dk_compare` | 2-4 products side by side: the specs that differ, plus the shared ones |
|
|
192
|
+
| `dk_installments` | Digipay credit-line offers for a product (credit amount, monthly repayment, months) |
|
|
193
|
+
</details>
|
|
194
|
+
|
|
195
|
+
<details open>
|
|
196
|
+
<summary><b>🧾 Other</b> (3)</summary>
|
|
197
|
+
|
|
198
|
+
| Tool | What it does |
|
|
199
|
+
|---|---|
|
|
200
|
+
| `dk_plus_plans` | Digikala Plus membership plans (free shipments) and benefits |
|
|
201
|
+
| `dk_gold_prices` | Live 18k gold price per gram (daily and ~3-month change) and gold coin prices |
|
|
202
|
+
| `dk_location` | Address → coordinates, or coordinates → address with Digikala city/province ids |
|
|
203
|
+
</details>
|
|
204
|
+
|
|
205
|
+
All tools are annotated `readOnlyHint: true` and return compact structured JSON, so they don't flood the agent's context.
|
|
206
|
+
|
|
207
|
+
## Good to know
|
|
208
|
+
|
|
209
|
+
- **Prices are in Toman.** The Digikala API answers in Rial; every tool divides by 10 so numbers match the website. Gold and coin prices are already Toman.
|
|
210
|
+
- **Ratings are 0–5**, like the site (the API's 0–100 divided by 20); `null` means not rated yet. Review stars are 1–5.
|
|
211
|
+
- **Persian and English queries both work** (`گوشی سامسونگ`, `airpods pro`). Category and brand codes are English slugs (`mobile-phone`, `samsung`).
|
|
212
|
+
- **`sort=cheapest` on a text search shows accessories first**; that's how Digikala ranks it. Use `dk_find_cheapest` for "cheapest X".
|
|
213
|
+
- **Search always returns something**, even for nonsense words (Digikala's search is semantic). `dk_find_cheapest` keeps only titles that contain every query word.
|
|
214
|
+
- **Groceries** come from the supermarket store: `dk_product` shows its price, which can differ from the main-store price in search results.
|
|
215
|
+
- **Shipping cost** is only calculated at checkout (login). `dk_product` shows how each offer ships, and `dk_plus_plans` the free-shipping plans.
|
|
216
|
+
|
|
217
|
+
## FAQ
|
|
218
|
+
|
|
219
|
+
<details>
|
|
220
|
+
<summary><b>Do I need an Iranian IP?</b></summary>
|
|
221
|
+
|
|
222
|
+
Usually not: in testing the API answered from a foreign (Turkish) exit. If every tool fails with
|
|
223
|
+
"refused the request (HTTP 403)", set `DIGIKALA_MCP_PROXY` to an HTTP proxy with an Iranian exit. (A 403 from just
|
|
224
|
+
one call usually means an unknown category or brand code.) Normal system
|
|
225
|
+
proxy variables are ignored on purpose.
|
|
226
|
+
</details>
|
|
227
|
+
|
|
228
|
+
<details>
|
|
229
|
+
<summary><b>Can it buy something for me?</b></summary>
|
|
230
|
+
|
|
231
|
+
No, and that's deliberate. It has no login and never calls the cart, checkout, payment, or review/question
|
|
232
|
+
posting endpoints; it only reads public data. The agent finds the best option; you tap buy on the site.
|
|
233
|
+
</details>
|
|
234
|
+
|
|
235
|
+
<details>
|
|
236
|
+
<summary><b>A product shows <code>in_stock: false</code> and no price</b></summary>
|
|
237
|
+
|
|
238
|
+
Digikala lists products that are out of stock, coming soon or discontinued. They have no current offer, so there's
|
|
239
|
+
no price. Searches use `in_stock_only: true` by default.
|
|
240
|
+
</details>
|
|
241
|
+
|
|
242
|
+
<details>
|
|
243
|
+
<summary><b>Claude Desktop says <code>uvx</code> is not found</b></summary>
|
|
244
|
+
|
|
245
|
+
Use the full path to `uvx` (`where uvx` on Windows, `which uvx` on macOS/Linux) as `command`.
|
|
246
|
+
</details>
|
|
247
|
+
|
|
248
|
+
<details>
|
|
249
|
+
<summary><b>How do I debug what the agent sees?</b></summary>
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
npx @modelcontextprotocol/inspector uvx digikala-mcp
|
|
253
|
+
```
|
|
254
|
+
</details>
|
|
255
|
+
|
|
256
|
+
## Configuration
|
|
257
|
+
|
|
258
|
+
| Variable | Default | Meaning |
|
|
259
|
+
|---|---|---|
|
|
260
|
+
| `DIGIKALA_MCP_PROXY` | unset | HTTP proxy for every request, e.g. `http://user:pass@host:port` |
|
|
261
|
+
|
|
262
|
+
## فارسی
|
|
263
|
+
|
|
264
|
+
<div dir="rtl">
|
|
265
|
+
|
|
266
|
+
**digikala-mcp** به دستیار هوش مصنوعی شما (Claude، Cursor، Copilot و ...) اجازه می‌دهد در دیجی‌کالا جستجو کند،
|
|
267
|
+
قیمت همه فروشندگان یک کالا را مقایسه کند، تاریخچه قیمت، نظرات و پرسش‌وپاسخ‌ها را بخواند و پیشنهادهای شگفت‌انگیز را پیدا کند.
|
|
268
|
+
|
|
269
|
+
- فقط خواندنی است: وارد حساب نمی‌شود، سبد خرید نمی‌سازد و سفارش ثبت نمی‌کند.
|
|
270
|
+
- همه قیمت‌ها به تومان است و امتیازها مثل سایت از ۵.
|
|
271
|
+
- روی سیستم خود شما اجرا می‌شود و به هیچ سرور واسطی داده نمی‌فرستد.
|
|
272
|
+
|
|
273
|
+
**نصب در Claude Code:**
|
|
274
|
+
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
claude mcp add digikala -- uvx digikala-mcp
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
<div dir="rtl">
|
|
282
|
+
|
|
283
|
+
بعد بپرسید: «ارزان‌ترین گوشی سامسونگ A07 کدام است و الان قیمتش خوب است؟»
|
|
284
|
+
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
## Development
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
git clone https://github.com/sepehr071/digikala-mcp && cd digikala-mcp
|
|
291
|
+
uv sync
|
|
292
|
+
uv run pytest # offline, against recorded responses
|
|
293
|
+
uv run pytest -m live # real API
|
|
294
|
+
uv run ruff check .
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Tools live in `src/digikala_mcp/catalog.py`, `product.py` and `services.py`; each is a typed async function with a
|
|
298
|
+
docstring that tells the agent when to use it. Issues and PRs are welcome, especially new tools and fixes for API changes.
|
|
299
|
+
|
|
300
|
+
Releases: bump the version in `pyproject.toml` and `server.json`, then push a `v*` tag. GitHub Actions tests,
|
|
301
|
+
publishes to PyPI and the [MCP Registry](https://registry.modelcontextprotocol.io), and creates the GitHub Release.
|
|
302
|
+
|
|
303
|
+
## Disclaimer
|
|
304
|
+
|
|
305
|
+
Unofficial and not affiliated with or endorsed by Digikala. It uses the public endpoints of the digikala.com web
|
|
306
|
+
app, which can change without notice. Please keep request rates reasonable.
|
|
307
|
+
|
|
308
|
+
## License
|
|
309
|
+
|
|
310
|
+
[MIT](https://github.com/sepehr071/digikala-mcp/blob/main/LICENSE)
|