china-usci-mcp
# china-usci-mcp
MCP server for checking the **Unified Social Credit Identifier (USCI)** — the 18-character code printed on a mainland China business licence.
Offline. Zero network calls. It tells the model what a passing code establishes, and, on every response including failures, what it does **not**.
## Why this exists
Ask an assistant "is this Chinese supplier real?" and, without a tool, it will reason from the shape of the string and sound confident. That is the worst possible failure mode for this particular question, because the person asking is usually about to send money.
There is exactly one thing that can be established about a USCI without contacting anyone: whether the code is internally consistent. The final character is a check character over the first 17, defined by **GB 32100-2015**, computed mod 31 over a 31-character alphabet that deliberately excludes `I`, `O`, `Z`, `S` and `V`. A mistyped digit, a transposed pair, or a fabricated code will usually fail that check.
This server exposes that one fact, and refuses to let it grow into anything larger.
## Install
```bash
npm install -g china-usci-mcp
```
Or run it without installing:
```bash
npx china-usci-mcp
```
### Client configuration
```json
{
"mcpServers": {
"china-usci": {
"command": "npx",
"args": ["-y", "china-usci-mcp"]
}
}
}
```
## Tools
### `validate_usci`
Input: `code` — the identifier as printed. Whitespace, full-width spaces, hyphens and lower case are tolerated.
Returns whether the code is well formed, decodes its segments (registering authority, entity category, administrative division, subject identifier, check character), and states the boundary.
```
VALID FORMAT: 91330100799655058B
Segments:
Registration authority code: 9 — Market regulation (工商)
Entity category code: 1 — Enterprise (企业)
Administrative division code: 330100 — Registered in Zhejiang.
Subject identifier (organization code): 799655058
Check character: B
What this establishes:
- The 18 characters are internally consistent, so the code was transcribed correctly.
- The code is formatted as GB 32100-2015 requires.
What this does NOT establish, in any outcome:
- That the company exists. A correctly formed code can be invented.
- That the company is still active rather than revoked or deregistered.
- That its registered business scope covers what you are buying.
- That it may legally export to you. Export eligibility turns on the registered
scope and customs registration, neither of which is encoded here.
- That the company on this code is the same one issuing your invoice or
receiving your payment.
```
A wrong check character reports the expected and actual characters, so a transcription error can be found rather than merely flagged.
### `usci_check_character`
Input: `first17`. Computes the character the 18th position should hold. Use it when checking a code copied off a photographed licence.
## What this cannot do
It queries no registry. It cannot tell you that a company exists, is currently registered, is in good standing, does what it claims, or is safe to pay. A well-formed code that belongs to nobody is still a well-formed code.
For the record itself you need the official source — and getting there from outside mainland China is its own problem. We measured eight official Chinese verification portals from public vantage points abroad: the national enterprise credit system (GSXT) answered none of the overseas nodes tested. Methodology and per-node data: [currawongweb.com/verify/china-official-source-availability/](https://currawongweb.com/verify/china-official-source-availability/), with the underlying datasets on [Harvard Dataverse](https://dataverse.harvard.edu/dataverse/currawong-verification) under DOIs and a mirror on [Hugging Face](https://huggingface.co/datasets/derrick459/chinese-official-source-reachability).
## Related
- [`china-usci`](https://www.npmjs.com/package/china-usci) — the underlying library and CLI, which this server wraps
- [Browser version of the same check](https://currawongweb.com/verify/china-usci-checker/) — no install, no account
## Licence
MIT. Built by [Currawong](https://currawongweb.com/), which also sells supplier verification reports — stated plainly, since you are being asked to run our code.
TDQS
Scored across 2 tools
validate_usci performs full validation and decoding of an entire USCI, while usci_check_character computes only the check character for a partial code. Their purposes are clearly separated, with no practical confusion between validating a complete code and verifying a single digit.
The names follow different structural patterns: validate_usci is verb-noun, while usci_check_character is noun-noun (or noun-verb-noun) and reads more like an object than an action. Although both consistently use lowercase 'usci', the lack of a uniform verb-first convention prevents a higher score.
With only two tools, the server is slightly below the typical 3-15 range, but it targets a very narrow domain (offline USCI validation). Each tool has a distinct and necessary role, so the count feels reasonable even if minimal.
The server covers the core operations needed for offline USCI processing: full validation/decode and check-character computation. It explicitly declares it does not query registries, so the lack of a lookup tool is an intentional boundary rather than a gap, making the surface complete for its stated purpose.