okala-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.
Files changed (53) hide show
  1. okala_mcp-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +42 -0
  2. okala_mcp-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. okala_mcp-0.1.0/.github/dependabot.yml +10 -0
  4. okala_mcp-0.1.0/.github/workflows/ci.yml +22 -0
  5. okala_mcp-0.1.0/.github/workflows/publish.yml +51 -0
  6. okala_mcp-0.1.0/.gitignore +6 -0
  7. okala_mcp-0.1.0/LICENSE +21 -0
  8. okala_mcp-0.1.0/PKG-INFO +337 -0
  9. okala_mcp-0.1.0/README.md +311 -0
  10. okala_mcp-0.1.0/pyproject.toml +54 -0
  11. okala_mcp-0.1.0/server.json +38 -0
  12. okala_mcp-0.1.0/src/okala_mcp/__init__.py +5 -0
  13. okala_mcp-0.1.0/src/okala_mcp/account.py +143 -0
  14. okala_mcp-0.1.0/src/okala_mcp/auth.py +191 -0
  15. okala_mcp-0.1.0/src/okala_mcp/catalog.py +450 -0
  16. okala_mcp-0.1.0/src/okala_mcp/http.py +196 -0
  17. okala_mcp-0.1.0/src/okala_mcp/offers.py +127 -0
  18. okala_mcp-0.1.0/src/okala_mcp/registry.py +17 -0
  19. okala_mcp-0.1.0/src/okala_mcp/server.py +71 -0
  20. okala_mcp-0.1.0/src/okala_mcp/stores.py +295 -0
  21. okala_mcp-0.1.0/tests/conftest.py +83 -0
  22. okala_mcp-0.1.0/tests/fixtures/brand_kalleh.json +19 -0
  23. okala_mcp-0.1.0/tests/fixtures/carousels_home.json +397 -0
  24. okala_mcp-0.1.0/tests/fixtures/carousels_store.json +226 -0
  25. okala_mcp-0.1.0/tests/fixtures/cats_nearby.json +238 -0
  26. okala_mcp-0.1.0/tests/fixtures/cats_store.json +238 -0
  27. okala_mcp-0.1.0/tests/fixtures/cities.json +38 -0
  28. okala_mcp-0.1.0/tests/fixtures/details.json +73 -0
  29. okala_mcp-0.1.0/tests/fixtures/forward.json +64 -0
  30. okala_mcp-0.1.0/tests/fixtures/highest.json +69 -0
  31. okala_mcp-0.1.0/tests/fixtures/multi.json +270 -0
  32. okala_mcp-0.1.0/tests/fixtures/nearby.json +421 -0
  33. okala_mcp-0.1.0/tests/fixtures/nearby_out.json +19 -0
  34. okala_mcp-0.1.0/tests/fixtures/pdp.json +26 -0
  35. okala_mcp-0.1.0/tests/fixtures/popular_brands.json +116 -0
  36. okala_mcp-0.1.0/tests/fixtures/products_milk.json +344 -0
  37. okala_mcp-0.1.0/tests/fixtures/reverse.json +9 -0
  38. okala_mcp-0.1.0/tests/fixtures/reviews.json +68 -0
  39. okala_mcp-0.1.0/tests/fixtures/schedule.json +71 -0
  40. okala_mcp-0.1.0/tests/fixtures/single.json +94 -0
  41. okala_mcp-0.1.0/tests/fixtures/store_dairy.json +182 -0
  42. okala_mcp-0.1.0/tests/fixtures/store_search.json +103 -0
  43. okala_mcp-0.1.0/tests/fixtures/text_search.json +281 -0
  44. okala_mcp-0.1.0/tests/test_account.py +104 -0
  45. okala_mcp-0.1.0/tests/test_auth.py +98 -0
  46. okala_mcp-0.1.0/tests/test_catalog.py +248 -0
  47. okala_mcp-0.1.0/tests/test_http.py +143 -0
  48. okala_mcp-0.1.0/tests/test_live_catalog.py +65 -0
  49. okala_mcp-0.1.0/tests/test_live_offers.py +25 -0
  50. okala_mcp-0.1.0/tests/test_live_stores.py +36 -0
  51. okala_mcp-0.1.0/tests/test_offers.py +105 -0
  52. okala_mcp-0.1.0/tests/test_stores.py +142 -0
  53. okala_mcp-0.1.0/uv.lock +1124 -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. ok_compare
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 (round your coordinates).
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 okala.com for the same product and store
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
+ - OKALA_MCP_PROXY set
38
+ - type: input
39
+ id: version
40
+ attributes:
41
+ label: okala-mcp version
42
+ placeholder: "0.1.0"
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: Question or idea
4
+ url: https://github.com/sepehr071/okala-mcp/discussions
5
+ about: Ask how to use it or suggest a new tool
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: monthly
7
+ - package-ecosystem: uv
8
+ directory: /
9
+ schedule:
10
+ interval: monthly
@@ -0,0 +1,22 @@
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 ruff format --check .
22
+ - 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/okala-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/download/v1.8.1/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,6 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ dist/
5
+ .pytest_cache/
6
+ .ruff_cache/
@@ -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,337 @@
1
+ Metadata-Version: 2.5
2
+ Name: okala-mcp
3
+ Version: 0.1.0
4
+ Summary: Unofficial read-only MCP server for Okala: find grocery stores that deliver to you, compare prices across stores, browse deals.
5
+ Project-URL: Homepage, https://github.com/sepehr071/okala-mcp
6
+ Project-URL: Source, https://github.com/sepehr071/okala-mcp
7
+ Project-URL: Changelog, https://github.com/sepehr071/okala-mcp/releases
8
+ Project-URL: Issues, https://github.com/sepehr071/okala-mcp/issues
9
+ Author-email: Sepehr <sepehr@nextofx.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: e-commerce,grocery,iran,mcp,model-context-protocol,okala,shopping,supermarket
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.10
23
+ Requires-Dist: httpx>=0.27
24
+ Requires-Dist: mcp<3,>=2.2
25
+ Description-Content-Type: text/markdown
26
+
27
+ <!-- mcp-name: io.github.sepehr071/okala-mcp -->
28
+
29
+ <div align="center">
30
+
31
+ # 🛒 okala-mcp
32
+
33
+ **Let your AI agent do the grocery price check on Okala.**<br>
34
+ Find the supermarkets, bakeries and fruit shops that deliver to your address, compare the same product<br>
35
+ across nearby stores, check fees, minimum order and delivery slots, and catch today's deals, from Claude, Cursor or Copilot.
36
+
37
+ [![PyPI](https://img.shields.io/pypi/v/okala-mcp?color=2563eb)](https://pypi.org/project/okala-mcp/)
38
+ [![Python](https://img.shields.io/pypi/pyversions/okala-mcp)](https://pypi.org/project/okala-mcp/)
39
+ [![CI](https://github.com/sepehr071/okala-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/sepehr071/okala-mcp/actions/workflows/ci.yml)
40
+ [![MCP Registry](https://img.shields.io/badge/MCP_Registry-io.github.sepehr071%2Fokala--mcp-7c3aed)](https://registry.modelcontextprotocol.io/?q=okala-mcp)
41
+ [![License: MIT](https://img.shields.io/badge/license-MIT-16a34a)](https://github.com/sepehr071/okala-mcp/blob/main/LICENSE)
42
+
43
+ [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=okala&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyJva2FsYS1tY3AiXX0=)
44
+ [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_okala--mcp-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect/mcp/install?name=okala&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22okala-mcp%22%5D%7D)
45
+
46
+ [Quick start](#quick-start) · [What it can do](#what-it-can-do) · [Tools](#tools) · [FAQ](#faq) · [فارسی](#فارسی)
47
+
48
+ </div>
49
+
50
+ ---
51
+
52
+ ## Why
53
+
54
+ On Okala every store sets its own price for the same carton of milk, and each one adds its own service and
55
+ packaging fee and has its own minimum order. The site shows one store at a time, and there is no search
56
+ box without logging in. An agent with `okala-mcp` checks every store that delivers to you in one go:
57
+
58
+ > **You:** Where is Kalleh lactose-free milk cheapest near Yousef Abad, Tehran?
59
+ >
60
+ > **Agent:** *calls* `ok_locate(address="یوسف آباد")` → `ok_search(query="شیر بدون لاکتوز کاله", ...)` → `ok_compare(category_slug="low-fat-milk", ...)`
61
+ >
62
+ > Kalleh fat-free, lactose-free milk (1 L) is sold by 17 open stores nearby. Cheapest: **یاران دریان گلریز** at
63
+ > 147,875 Toman (12% off 169,000), 1.6 km away, first slot today 08-09, plus 10,500 service and 3,000 packaging.
64
+ > The dearest store asks 180,000, so you save 32,125.
65
+
66
+ <sub>Real tool output from 2026-10-07; prices change all the time. Prices are in Toman.</sub>
67
+
68
+ ## What it can do
69
+
70
+ - 📍 **Locate** an address (Persian) and list the stores that deliver there, with rating, distance, first slot and fees
71
+ - 🔎 **Find products** near you by name: Okala's own text search after an optional one-time login, otherwise matched to Okala's categories
72
+ - 💸 **Compare** the same product across every nearby store, cheapest store first, with each store's fees
73
+ - 🏪 **Browse one store**: a whole department sorted by price or discount, filtered by name
74
+ - 🧾 **Product details**: price, discount, stock, max per order, brand, images
75
+ - ⏰ **Store details**: minimum order, whether it serves your address now, every delivery slot of the day
76
+ - ⚡ **Deals**: today's deal rows near you or in one store, and the biggest discounts of a store
77
+ - 🔒 **Read-only by design**: no cart, no orders, no reviews posted (the optional login is only used for search)
78
+
79
+ ## Quick start
80
+
81
+ You need [uv](https://docs.astral.sh/uv/getting-started/installation/). No API key or account.
82
+
83
+ <details open>
84
+ <summary><b>Claude Code</b></summary>
85
+
86
+ ```bash
87
+ claude mcp add okala -- uvx okala-mcp
88
+ ```
89
+ </details>
90
+
91
+ <details>
92
+ <summary><b>Claude Desktop</b></summary>
93
+
94
+ Settings → Developer → Edit Config, then add:
95
+
96
+ ```json
97
+ {
98
+ "mcpServers": {
99
+ "okala": { "command": "uvx", "args": ["okala-mcp"] }
100
+ }
101
+ }
102
+ ```
103
+ </details>
104
+
105
+ <details>
106
+ <summary><b>Cursor</b></summary>
107
+
108
+ Click **Install in Cursor** above, or add the Claude Desktop block to `~/.cursor/mcp.json`.
109
+ </details>
110
+
111
+ <details>
112
+ <summary><b>VS Code (Copilot agent mode)</b></summary>
113
+
114
+ Click **Install in VS Code** above, or add to `.vscode/mcp.json`:
115
+
116
+ ```json
117
+ {
118
+ "servers": {
119
+ "okala": { "type": "stdio", "command": "uvx", "args": ["okala-mcp"] }
120
+ }
121
+ }
122
+ ```
123
+ </details>
124
+
125
+ <details>
126
+ <summary><b>Anything else</b></summary>
127
+
128
+ It's a standard stdio MCP server: run `uvx okala-mcp`, or `pip install okala-mcp` and run `okala-mcp`.
129
+ </details>
130
+
131
+ Then just ask:
132
+
133
+ - "Which supermarkets near Vanak Square deliver within the hour, and what are their fees?"
134
+ - "Cheapest Kalleh full-fat milk near me, and is that store's minimum order a problem for one carton?"
135
+ - "What deals does store 11009 have today?"
136
+ - <span dir="rtl">ارزان&zwnj;ترین تن ماهی نزدیک میدان آرژانتین کدام فروشگاه است؟</span>
137
+
138
+ ## How it works
139
+
140
+ ```text
141
+ AI agent (Claude, Cursor, Copilot, ...)
142
+ │
143
+ │ MCP over stdio
144
+ ▼
145
+ okala-mcp (runs on your machine)
146
+ │
147
+ │ HTTPS
148
+ └──────▶ apigateway.okala.com the public JSON API of okala.com
149
+ ```
150
+
151
+ `okala-mcp` runs locally and calls the same public endpoints the okala.com website uses as a guest.
152
+ There's no hosted server in between, no API key, and nothing about you is sent anywhere else
153
+ (only the delivery point you ask about goes to Okala).
154
+
155
+ ## Tools
156
+
157
+ <details open>
158
+ <summary><b>📍 Where and who delivers</b> (4)</summary>
159
+
160
+ | Tool | What it does |
161
+ |---|---|
162
+ | `ok_locate` | Address text → coordinates (candidates) plus the street address of the best hit |
163
+ | `ok_stores` | Stores that deliver to a point: type, rating, distance, first slot, service / packaging / delivery fee |
164
+ | `ok_store` | One store: serves this point?, minimum order, location, every delivery slot with availability |
165
+ | `ok_store_reviews` | Customer reviews of a store: stars, comment, liked / disliked reasons |
166
+ </details>
167
+
168
+ <details open>
169
+ <summary><b>🔎 Products and prices</b> (6)</summary>
170
+
171
+ | Tool | What it does |
172
+ |---|---|
173
+ | `ok_search` | Products for a query near a point or in one store: Okala's text search when logged in, matching categories as a guest; name matches first, then cheapest |
174
+ | `ok_compare` | The same product across nearby stores, cheapest store first, with each store's fees |
175
+ | `ok_store_products` | A whole category of one store, sorted, filtered by name (search inside one store) |
176
+ | `ok_product` | One product in one store: price, discount, stock, max per order, brand, images |
177
+ | `ok_categories` | Category tree with slugs, near a point or in one store |
178
+ | `ok_brands` | Brand ids and slugs (featured brands, or lookup by slug) |
179
+ </details>
180
+
181
+ <details open>
182
+ <summary><b>⚡ Deals</b> (2)</summary>
183
+
184
+ | Tool | What it does |
185
+ |---|---|
186
+ | `ok_deals` | Deal rows running now near a point or in one store, with end time and top products |
187
+ | `ok_offer` | One deal row in full, across stores or in one store, sorted and paged |
188
+ </details>
189
+
190
+ <details open>
191
+ <summary><b>🔑 Optional login</b> (4)</summary>
192
+
193
+ | Tool | What it does |
194
+ |---|---|
195
+ | `ok_login` | Sends an SMS code to the user's phone; asks for the code in a form when the client supports it |
196
+ | `ok_login_verify` | Finishes the login with the code the user typed in the chat |
197
+ | `ok_account` | Logged in or guest, and as which phone (masked) |
198
+ | `ok_logout` | Deletes the saved login; the server continues as a guest |
199
+ </details>
200
+
201
+ The 12 shopping tools are annotated `readOnlyHint: true`. `ok_login`, `ok_login_verify` and `ok_logout` are not
202
+ (they send an SMS or change the saved login), so your client asks before running them. Every tool returns compact
203
+ structured JSON, so it doesn't flood the agent's context.
204
+
205
+ ## Good to know
206
+
207
+ - **Prices are in Toman.** The API speaks Rial; every tool divides by 10. `final_price` is what you pay, `price` is before discount, `discount_pct` is a whole percent.
208
+ - **Every store has its own price.** A product id is the same item in every store, so `ok_compare` can line them up.
209
+ - **Order cost** at one store = items + service fee + packaging fee + delivery fee (`ok_stores`), and the basket must reach the store's `minimum_order` (`ok_store`). One basket = one store.
210
+ - **Text search needs a login.** Okala only searches for logged-in users. Log in once (see [Optional login](#optional-login)) and `ok_search` uses Okala's real search, near you or inside one store (`store_id`), brands and product names included (`نوتلا`). As a guest, `ok_search` matches your words to category names (`شیر` → milk) and ranks products by name; for one store, `ok_store_products` with `name_contains` reads the whole department.
211
+ - **Up to 12 products per store** come back from the cross-store lists; use a narrower category slug or a brand id for more precise comparisons.
212
+ - **Persian works best** (`شیر کم چرب`, `پنیر`, `تن ماهی`). Arabic ي / ك and half-spaces are normalized.
213
+
214
+ ## FAQ
215
+
216
+ <details>
217
+ <summary><b>Can it place an order for me?</b></summary>
218
+
219
+ No, and that's deliberate. It never touches the cart, order, payment, address or review endpoints, even when logged in.
220
+ The agent finds the best option; you buy it on okala.com.
221
+ </details>
222
+
223
+ <details>
224
+ <summary><b>Why does <code>ok_search</code> show products that don't match my words?</b></summary>
225
+
226
+ As a guest (`mode: "category"`), Okala's text search is not available, so `ok_search` fetches the categories whose
227
+ names match your words and puts the products whose names contain your words first. Log in once to get real text search. `categories` in the reply shows what was used; pass a better
228
+ slug to `ok_compare`, or search one store's department with `ok_store_products`.
229
+ </details>
230
+
231
+ <details>
232
+ <summary><b>It says no store delivers to my point</b></summary>
233
+
234
+ Okala covers Tehran and some other big cities. Check the coordinates with `ok_locate` (the first candidate can be a
235
+ similar name in another district) and try again; `ok_stores` with `open_only: false` also shows stores that are closed now.
236
+ </details>
237
+
238
+ <details>
239
+ <summary><b>I get "Could not reach okala.com"</b></summary>
240
+
241
+ The server retries a dropped connection once. If it still fails, check your internet connection. System proxy
242
+ variables are ignored on purpose; set `OKALA_MCP_PROXY` if you need a proxy.
243
+ </details>
244
+
245
+ <details>
246
+ <summary><b>How do I debug what the agent sees?</b></summary>
247
+
248
+ ```bash
249
+ npx @modelcontextprotocol/inspector uvx okala-mcp
250
+ ```
251
+ </details>
252
+
253
+ ## Configuration
254
+
255
+ | Variable | Default | Meaning |
256
+ |---|---|---|
257
+ | `OKALA_MCP_PROXY` | unset | HTTP proxy for every request, e.g. `http://user:pass@host:port` |
258
+ | `OKALA_MCP_TOKEN_FILE` | `~/.okala-mcp/token.json` | Where `okala-mcp login` saves the login |
259
+ | `OKALA_MCP_TOKEN` | unset | An Okala access token to use instead of the saved login (not refreshed) |
260
+
261
+ ## Optional login
262
+
263
+ Everything works as a guest. Logging in only unlocks Okala's text search in `ok_search` (brands and product names,
264
+ inside one store too). Just ask your agent:
265
+
266
+ > **You:** Log me in to Okala, my number is 0912 123 4567
267
+ >
268
+ > **Agent:** *calls* `ok_login` → Okala sends you an SMS → you type the code (in a form if your client shows one,
269
+ > otherwise in the chat) → logged in
270
+
271
+ - The code is sent only when you ask, at most once every 2 minutes per number.
272
+ - If your client supports MCP forms (elicitation), the code goes straight to the server and never passes through
273
+ the model.
274
+ - The login is saved on your machine (`~/.okala-mcp/token.json`), refreshes itself, is sent only to
275
+ apigateway.okala.com, and never appears in a tool reply. If it stops working, the server carries on as a guest.
276
+ - `ok_account` shows the state; `ok_logout` deletes the login.
277
+
278
+ Prefer a terminal? The same login works from the command line:
279
+
280
+ ```bash
281
+ uvx okala-mcp login 09121234567 # sends the code
282
+ uvx okala-mcp login 09121234567 12345 # saves the login
283
+ uvx okala-mcp logout # deletes it
284
+ ```
285
+
286
+ Restart your MCP client after a command-line login (a running server reads the login once).
287
+
288
+ ## فارسی
289
+
290
+ <div dir="rtl">
291
+
292
+ **okala-mcp** به دستیار هوش مصنوعی شما (Claude، Cursor، Copilot و ...) اجازه می&zwnj;دهد فروشگاه&zwnj;های اُکالا را که به
293
+ آدرس شما ارسال دارند پیدا کند، قیمت یک کالا را در همه&zwnj;ی فروشگاه&zwnj;های نزدیک مقایسه کند، هزینه&zwnj;ی خدمات و بسته&zwnj;بندی،
294
+ حداقل سفارش و زمان&zwnj;های ارسال را ببیند و تخفیف&zwnj;های امروز را پیدا کند.
295
+
296
+ - فقط خواندنی است: وارد حساب نمی&zwnj;شود، سبد خرید نمی&zwnj;سازد و سفارش ثبت نمی&zwnj;کند.
297
+ - قیمت&zwnj;ها به تومان است.
298
+ - روی سیستم خود شما اجرا می&zwnj;شود و به هیچ سرور واسطی داده نمی&zwnj;فرستد.
299
+
300
+ **نصب در Claude Code:**
301
+
302
+ </div>
303
+
304
+ ```bash
305
+ claude mcp add okala -- uvx okala-mcp
306
+ ```
307
+
308
+ <div dir="rtl">
309
+
310
+ بعد بپرسید: «ارزان&zwnj;ترین شیر کم چرب میهن نزدیک یوسف&zwnj;آباد تهران را کدام فروشگاه دارد؟»
311
+
312
+ </div>
313
+
314
+ ## Development
315
+
316
+ ```bash
317
+ git clone https://github.com/sepehr071/okala-mcp && cd okala-mcp
318
+ uv sync
319
+ uv run pytest # offline, against recorded responses
320
+ uv run pytest -m live # real okala.com
321
+ uv run ruff check .
322
+ ```
323
+
324
+ Tools live in `src/okala_mcp/stores.py`, `catalog.py` and `offers.py`; each is a typed async function with a
325
+ docstring that tells the agent when to use it. Issues and PRs are welcome, especially new tools and fixes for site changes.
326
+
327
+ Releases: bump the version in `pyproject.toml` and `server.json`, then push a `v*` tag. GitHub Actions tests,
328
+ publishes to PyPI and the [MCP Registry](https://registry.modelcontextprotocol.io), and creates the GitHub Release.
329
+
330
+ ## Disclaimer
331
+
332
+ Unofficial and not affiliated with or endorsed by Okala. It uses the public endpoints of the okala.com
333
+ website, which can change without notice. Please keep request rates reasonable.
334
+
335
+ ## License
336
+
337
+ [MIT](https://github.com/sepehr071/okala-mcp/blob/main/LICENSE)