milligold-mcp: Milli.gold price MCP server for AI agents
Give your AI agent the live 18k gold price from Milli.gold (میلی).
An unofficial, read-only MCP server for Milli.gold, an Iranian online platform for 18k gold sold by the milligram:
the live gold price per gram, day, week and month price history, and platform statistics, all from Claude, Cursor or Copilot.
For AI agents · Quick start · What it can do · Tools · Good to know · FAQ · فارسی
For AI agents
- What: unofficial MCP server (model context protocol) for the public price and statistics endpoints of milli.gold. A gold price API for Iran in tool form.
- Install:
uvx milligold-mcporclaude mcp add milligold -- uvx milligold-mcp. Transport: stdio. Needs uv (Python 3.10+). - Auth: none, no API key or account. Optional
MILLIGOLD_MCP_PROXY(HTTP proxy URL, or a comma-separated list); system proxy settings are ignored. - Access: read-only, so no confirmation is needed before calling any tool. It cannot log in, trade or read a wallet.
- Tools: 3, all prefixed
mg_. Typical sequence:mg_get_price->mg_price_history. - Use when: the user asks for the current 18k gold price per gram on Milli.gold, how it moved over a day, week or month, or Milli.gold's headline numbers.
- Do not use when: the user wants to buy or sell gold, needs a market-wide quote, or wants dollar, coin or crypto prices (see tgju-mcp).
- Output: compact JSON. Milli.gold quotes Rial per milligram of 18k gold; replies also carry Rial per gram and Toman per gram. Times are Tehran time.
- Machine-readable:
server.jsonand the awesome-iran-mcp catalog (TOOLS.md,servers.json,llms.txt).
Why
Milli.gold sells 18k melted gold by the milligram, so its price is quoted per milligram, in Rial. The site shows the
price per gram, and the numbers are easy to misread by a factor of 10 or 1000. An agent with milligold-mcp reads
the quote straight from the public endpoints and does the unit conversion for you:
You: What is the Milli.gold gold price right now, and is it up or down this week?
Agent: calls
mg_get_price()->mg_price_history(period="WEEKLY")One gram of 18k gold costs 26,890,000 Toman on Milli.gold (268,900 Rial per milligram). Over the past week it moved by the percentage shown in
change_percent, between the week's low and high.
Illustrative example with the price from the site's own unit explanation; prices change all the time.
What it can do
- Live price of 18k gold on Milli.gold: Rial per milligram, Rial per gram and Toman per gram, with the Tehran-time timestamp
- Price history for the last day, week or month, with first, last, high, low and change percent
- Platform statistics: users, trade transactions, gold traded and held (kg), burned gold (kg), branches and representatives
- Read-only by design: no login, no trading, no wallet
Example prompts:
- "What is the 18k gold price per gram on Milli.gold right now?"
- "Show me Milli.gold's gold price for the last month. What were the high and the low?"
- "Is gold up or down today on Milli.gold? Give me the change in percent."
- "How many users and how much gold does Milli.gold report?"
- قیمت طلای ۱۸ عیار در میلی الان هر گرم چند تومان است؟
- نمودار قیمت طلا در میلی در یک هفته گذشته چطور بوده؟
- امروز قیمت طلا در میلی بالا رفته یا پایین آمده؟
Quick start
You need uv. No API key or account.
Claude Code
claude mcp add milligold -- uvx milligold-mcp
Claude Desktop
Settings → Developer → Edit Config, then add:
{
"mcpServers": {
"milligold": { "command": "uvx", "args": ["milligold-mcp"] }
}
}
Cursor
Click Install in Cursor above, or add the Claude Desktop block to ~/.cursor/mcp.json.
VS Code (Copilot agent mode)
Click Install in VS Code above, or add to .vscode/mcp.json:
{
"servers": {
"milligold": { "type": "stdio", "command": "uvx", "args": ["milligold-mcp"] }
}
}
Codex CLI
codex mcp add milligold -- uvx milligold-mcp
Or add to ~/.codex/config.toml:
[mcp_servers.milligold]
command = "uvx"
args = ["milligold-mcp"]
Gemini CLI
Add to ~/.gemini/settings.json:
{
"mcpServers": {
"milligold": { "command": "uvx", "args": ["milligold-mcp"] }
}
}
Windsurf
Add the Claude Desktop block to ~/.codeium/windsurf/mcp_config.json.
Anything else
It's a standard stdio MCP server: run uvx milligold-mcp, or pip install milligold-mcp and run milligold-mcp.
Tools
All 3 tools are read-only and return compact JSON.
| Tool | What it does |
|---|---|
mg_get_price |
Gets the current Milli.gold price of 18k melted gold in Rial per milligram, Rial per gram and Toman per gram, with the Tehran-time timestamp |
mg_price_history |
Gets the 18k gold price series for a day, week or month (period: DAILY, WEEKLY, MONTHLY; points: 2-50, default 24) with first, last, high, low and change percent |
mg_platform_stats |
Gets Milli.gold's headline numbers: users, trade transactions, gold traded (kg), user balances (kg), burned gold (kg), branches and representatives |
How it works
AI agent (Claude, Cursor, Copilot, ...)
│
│ MCP over stdio
▼
milligold-mcp (runs on your machine)
│
│ HTTPS
└──────▶ milli.gold price, price history, platform report
milligold-mcp runs locally and calls three public, login-free endpoints of milli.gold: the live price, the price
widget series and the overall report. There is no hosted server in between and no API key.
- Chrome-like client. Requests go through a Chrome-impersonating HTTP client, because the site sits behind ArvanCloud.
- ArvanCloud 307 + cookie. ArvanCloud sometimes answers with a redirect to the same URL plus a cookie. The server retries once and keeps the cookie, so you never see it.
- 15 s cache. Repeated calls within 15 seconds reuse the answer instead of hitting the site again.
- Read-only. Only GET requests, only to milli.gold. System proxy variables are ignored on purpose.
Good to know
- Units. The site quotes
price18in Rial per milligram, and 1 gram = 1000 mg. So 268,900 Rial/mg x 1000 = 268,900,000 Rial/g, and Rial / 10 = 26,890,000 Toman/g, which matches "price of 1 gram of 18k gold" on the site. - Tehran time.
as_ofand historytimevalues are Tehran time (UTC+3:30). - Milli.gold's own price. It is the platform's quote for 18k melted gold, with no tax or making charge. It is not a market-wide quote and not the tgju price, so expect small differences from other sources.
- History stats follow the site. The high, low and change for a week or a month include the day's peak and the live price, like the Milli.gold page does.
pointsonly thins the returned series; it does not change the stats. - Statistics are rounded totals that the company publishes, with weights in kilograms.
- What it does not do. No buying or selling, no login, no wallet or account data.
FAQ
Is there a Milli.gold API or MCP server for AI agents?
Yes: milligold-mcp is an unofficial MCP server with 3 read-only tools. It calls the public price and statistics
endpoints that milli.gold itself serves; no API key is needed.
How do I get the 18k gold price per gram in Claude, Cursor or Copilot?
Add the server with claude mcp add milligold -- uvx milligold-mcp (or the matching config in
Quick start), then ask "What is the 18k gold price per gram on Milli.gold?" in English or Persian.
What is the unit of the price?
Milli.gold quotes Rial per milligram. Every reply also carries Rial per gram (x 1000) and Toman per gram (Rial per gram / 10).
How is it different from tgju-mcp, and which should I use?
tgju-mcp reads tgju.org: dollar, euro, gold, coins, crypto and commodity
prices across the Iranian market. milligold-mcp reads one platform, Milli.gold, and gives that platform's own gold
price per milligram and its history. Use tgju-mcp for market rates and wide comparisons; use milligold-mcp when the
question is about the price on Milli.gold specifically.
Can it buy or sell gold for me?
No, and that's deliberate. It has no login and only reads public data.
Is it official, safe and free?
It is unofficial and not affiliated with Milli.gold. It is read-only, runs on your machine and is free under the MIT license.
Do I need an Iranian IP or a proxy?
Not by default. If requests are blocked from your network, set MILLIGOLD_MCP_PROXY to an HTTP proxy. System proxy variables are ignored on purpose.
Claude Desktop says uvx is not found
Use the full path to uvx (where uvx on Windows, which uvx on macOS/Linux) as command.
Configuration
| Variable | Default | Meaning |
|---|---|---|
MILLIGOLD_MCP_PROXY |
unset | Optional HTTP proxy URL for milli.gold requests. A comma-separated list is used one at a time: the next proxy takes over when one is blocked or cannot connect. System proxy settings are ignored |
فارسی: سرور MCP قیمت طلای میلی
milligold-mcp یک سرور MCP غیررسمی و فقطخواندنی برای میلی (Milli.gold)، پلتفرم آنلاین خرید و فروش طلای ۱۸ عیار آبشده بهصورت میلیگرمی، است. این سرور به دستیار هوش مصنوعی شما (Claude، Cursor، Copilot و ...) اجازه میدهد قیمت لحظهای طلا، تاریخچه قیمت و آمار پلتفرم را بخواند.
چه کارهایی میکند
- قیمت هر گرم طلای ۱۸ عیار در میلی: ریال به ازای هر میلیگرم، ریال به ازای هر گرم و تومان به ازای هر گرم.
- تاریخچه قیمت روز، هفته و ماه گذشته، با اولین، آخرین، بیشترین و کمترین قیمت و درصد تغییر.
- آمار پلتفرم: تعداد کاربران، تعداد معاملات، طلای معاملهشده و نگهداریشده (کیلوگرم)، طلای سوزاندهشده و تعداد شعبهها و نمایندگیها.
نکتهها
- فقط خواندنی است: خرید و فروش نمیکند، وارد حساب نمیشود و به کیف پول دسترسی ندارد.
- قیمت، قیمت خود میلی است (بدون مالیات و اجرت)، نه قیمت بازار و نه قیمت tgju؛ برای نرخ دلار، سکه و ارز دیجیتال از tgju-mcp استفاده کنید.
- هر ۱ گرم برابر ۱۰۰۰ میلیگرم است؛ ۲۶۸٬۹۰۰ ریال به ازای هر میلیگرم یعنی ۲۶٬۸۹۰٬۰۰۰ تومان برای هر گرم.
- زمانها به وقت تهران است. پاسخها ۱۵ ثانیه نگه داشته میشوند.
- روی سیستم خود شما اجرا میشود و کلید API لازم ندارد.
نصب (اول uv را نصب کنید). در Claude Code:
claude mcp add milligold -- uvx milligold-mcp
در Claude Desktop، Cursor و بقیه برنامهها همان تنظیم بخش Quick start را بگذارید.
نمونه پرسشها
- «قیمت طلای ۱۸ عیار در میلی الان هر گرم چند تومان است؟»
- «قیمت طلا در میلی در یک ماه گذشته بیشترین و کمترین چقدر بوده؟»
- «امروز طلای آبشده در میلی گرانتر شده یا ارزانتر؟»
- «آمار میلی را بگو: چند کاربر و چقدر طلا؟»
کلیدواژهها: قیمت طلا، قیمت طلای ۱۸ عیار، خرید طلا آنلاین، طلای آبشده، قیمت هر گرم طلا، طلای دیجیتال، میلی.
Development
git clone https://github.com/sepehr071/milligold-mcp && cd milligold-mcp
uv sync
uv run ruff check . && uv run ruff format --check .
uv run python -m pytest -q # offline unit tests
uv run python -m pytest -m live -q # calls milli.gold
uv build
Tools live in src/milligold_mcp/gold.py; each is a typed async function with a docstring that tells the agent when
to use it. Releases: bump the version in pyproject.toml and server.json, then push a v* tag.
Related servers
- tgju-mcp for dollar, euro, gold, coin, crypto and commodity prices from tgju.org
- iran-crypto-mcp for cryptocurrency prices on Iranian exchanges
- tsetmc-mcp for Tehran Stock Exchange data
- awesome-iran-mcp: catalog of all Iranian-service MCP servers
Disclaimer
Unofficial and not affiliated with or endorsed by Milli.gold. It is read-only and uses public endpoints of milli.gold, which can change without notice. Prices are informational and not financial advice.
License
Metadata
Release files for milligold-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| milligold_mcp-0.1.1.tar.gz | 320.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| milligold_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 336.9 kB
Release files / milligold_mcp-0.1.1.tar.gz
| Download URL | milligold_mcp-0.1.1.tar.gz |
|---|---|
| Size | 320.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c6c10407520074ce8856c328179402187d037470840f0b05267ca9d2528d02b
|
|
BLAKE2b-256 checksum How to use checksums |
4f9be5717b07a66f97240f16198aad2342e6682df52dd143f77072312e10b341
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logRelease files / milligold_mcp-0.1.1-py3-none-any.whl
| Download URL | milligold_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 16.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8727c7e1bb1f0a2f5cd5e0510db75b2d9051baeb5895aab6a01b3952b5507752
|
|
BLAKE2b-256 checksum How to use checksums |
9b44bbec04fb8c18041acbe38c8bf274fa269a17a82b5d0cc7b9262036bc3381
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logSecurity for milligold-mcp 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for milligold_mcp-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.