Skip to main content
Glama
README.md
# ime-mcp

Read-only [MCP](https://modelcontextprotocol.io/) server for **Iran Mercantile Exchange** ([ime.co.ir](https://www.ime.co.ir/)). It exposes official public statistics and live board snapshots from IME endpoints (no third-party API keys).

## Requirements

- Python 3.11+
- Internet access to `www.ime.co.ir` and `cdn.ime.co.ir`

## Install

```bash
cd /home/ali/Workspace/ime-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e ".[test]"
```

With [uv](https://docs.astral.sh/uv/):

```bash
uv sync --extra test
```

## Cursor configuration

Add to your MCP settings (`.cursor/mcp.json` or Cursor MCP UI):

```json
{
  "mcpServers": {
    "ime": {
      "command": "uv",
      "args": ["--directory", "/home/ali/Workspace/ime-mcp", "run", "ime-mcp"]
    }
  }
}
```

If `uv` is not installed, use the venv interpreter:

```json
{
  "mcpServers": {
    "ime": {
      "command": "/home/ali/Workspace/ime-mcp/.venv/bin/ime-mcp",
      "args": []
    }
  }
}
```

## Tools

| Tool | Description |
|------|-------------|
| `list_markets` | Markets covered and statistics page URLs |
| `search_physical_trades` | Physical market trades by date range |
| `get_physical_trade` | One physical row by id or symbol |
| `search_offer_notices` | Supply rows with no executed volume |
| `get_physical_board` | Live CDN board snapshot (TTS may need broker network) |
| `search_futures_trades` | Futures statistics |
| `get_futures_contract` | One futures contract |
| `search_option_trades` | Options statistics |
| `get_option_contract` | One option contract |
| `get_derivatives_board` | Live derivatives snapshot |
| `search_certificate_trades` | Commodity deposit certificates |
| `search_salaf_trades` | Standard parallel salaf |
| `search_fund_trades` | Commodity funds |
| `get_financial_board` | Live financial symbols on CDN board |

Dates accept Jalali (`1404-07-01`) or Gregorian (`2025-09-23`).

## Tests

```bash
pytest -m "not live"
pytest -m live
```

## Data sources

- Physical: `GetAmareMoamelatList` on [offer-stat.html](https://www.ime.co.ir/offer-stat.html)
- Futures: [fut-report.html](https://www.ime.co.ir/fut-report.html) handler
- Options: [option-report.html](https://www.ime.co.ir/option-report.html) handler
- Financial: [bazaremali](https://www.ime.co.ir/standard-transactions.html) handler
- Live board: SignalR `marketshub` on [cdn.ime.co.ir](https://cdn.ime.co.ir)

## License

MIT

TDQS

B3.2/5.0

Scored across 14 tools

Disambiguation4/5

The search_*_trades / get_*_contract pairing per market (physical, futures, options) is clearly differentiated by instrument, and offer notices stand apart. However, the three board tools (physical, derivatives, financial) plus the CDN-based snapshots overlap somewhat, and the several bazaremali-derived search tools (certificate, salaf, fund) could be confused at a glance.

Naming Consistency5/5

All names follow a clean snake_case verb_noun pattern (list_markets, search_physical_trades, get_futures_contract, get_financial_board). The search_/get_ prefix distinction is applied consistently and predictably across instrument types.

Tool Count5/5

14 tools is well within the ideal 3-15 range and each maps to a distinct market segment or board. No obvious padding, and the search/get/board trichotomy is proportionate to the exchange's breadth.

Completeness4/5

Coverage spans physical, futures, options, certificates, salaf, funds, offer notices, and live boards, which is broad for the domain. Minor gaps: single-row getters exist only for physical/futures/option, so fetching an individual certificate or salaf row requires search, but agents can work around this.

Maintenance

ActivityMaintained
ResponsivenessNo issues