Skip to main content
Glama
Tsolmonx

ebarimt-ref

by Tsolmonx
README.md
# ebarimt-ref

Local reference lookup for Mongolian eBarimt: districts (khoroo codes), VAT-free/zero/no-VAT
tax product codes, and GS1 БҮНА classification codes. Ships as an MCP server so Claude can
answer "find me the district / classification / VAT-free product code" without a web UI or
a database server — everything lives in a single committed SQLite file.

## Setup

```bash
pnpm install
pnpm refresh   # fetches districts + tax codes from api.ebarimt.mn, parses data/gs1_gs1.xlsx
pnpm test      # sanity checks: row counts + known lookups
```

`pnpm refresh` only works from a Mongolian IP (the eBarimt API is geo-restricted). The
`.db` file is committed to this repo by design, so consumers of this repo never need to
run refresh themselves — only re-run it when the source data changes.

## CLI

```bash
pnpm search classification "улаан буудай"
pnpm search tax "хөгжлийн бэрхшээл"
pnpm search district "Сонгинохайрхан"
pnpm search code 3420
```

## MCP registration (Claude Code)

`.mcp.json`:

```json
{
  "mcpServers": {
    "ebarimt-ref": {
      "command": "pnpm",
      "args": ["--dir", "/Users/tsolmonkhorloo/Documents/dreamon/ebarimt-ref", "mcp"]
    }
  }
}
```

Or one-liner:

```bash
claude mcp add ebarimt-ref -- pnpm --dir /Users/tsolmonkhorloo/Documents/dreamon/ebarimt-ref mcp
```

Tools exposed: `search_classification`, `search_tax_product`, `find_district`,
`lookup_code`, `ref_status`, `api_doc`.

## API reference docs

`docs/api/` holds the eBarimt developer docs (PosAPI 3, easy-register, operator) scraped from
developer.itc.gov.mn. Exposed via the `api_doc` MCP tool: call with no args to list, with
`slug` (e.g. `pos-api/12-receipt-save`) to read.