Wenjia Home-Fix Diagnosis MCP Server
# Wenjia Home-Fix Diagnosis MCP Server · 问家家庭维修诊断
[](https://modelcontextprotocol.io)
[](LICENSE)
[](DATA-LICENSE.md)
A Chinese home repair self-diagnosis engine exposed as an MCP server.
**40 categories · 224 symptom decision trees · 920 ranked causes · 4,287 fix steps.**
Zero dependencies (Python standard library only), read-only, no auth.
## Install (stdio, one line)
Published on PyPI: <https://pypi.org/project/wenjia-home-fix-mcp/>
```json
{
"mcpServers": {
"wenjia-home-fix": {
"command": "uvx",
"args": ["wenjia-home-fix-mcp"]
}
}
}
```
`pip install wenjia-home-fix-mcp` also works. Python >= 3.9, no other dependencies.
The same file is kept at the repository root as `mcp.json` for catalog crawlers.
## Ten tools, entry-first
You do not need to know any id. Pass the user's own words:
| For | Tool |
|---|---|
| "空调不凉" "热水器打不着火" → which symptom is this | `find_symptom` |
| what to do, in what order, when to stop | `fix_plan` |
| everything a category covers | `get_category` |
| just the ranked causes | `cause_ranking` |
| just the price range | `price_band` |
| just the stop-before-DIY verdict | `stop_check` |
| full tree / clarify questions / keyword search | `get_symptom` / `diagnose` / `search_symptoms` |
`category_id` and `symptom_id` accept Chinese names and common colloquial phrasings;
when resolution fails the error message lists the valid ids so the agent can self-correct
inside the same turn.
### If your pip mirror has not synced yet (China)
Mainland mirrors sync PyPI with a delay. On a mirror-only network, `uvx` may report
`wenjia-home-fix-mcp was not found in the package registry`. Two ways around it,
both verified against 0.2.3:
```bash
# 1) point uv straight at the official index (mirror config is ignored)
uvx --default-index https://pypi.org/simple wenjia-home-fix-mcp
# 2) install the wheel directly from our host (no index involved)
pip install http://59.110.26.77/packages/wenjia_home_fix_mcp-0.2.3-py3-none-any.whl
```
## What it does
Household failures are hard to describe and hard to fix. This server turns a vague
complaint ("the radiator doesn't heat") into a structured diagnosis:
1. **2 clarifying questions** with options that each point to a diagnosis branch
2. **4 likely causes ranked by prior probability** (summing to 100%)
3. **Step-by-step fixes** ordered by safety (gas valve / breaker always first)
4. **Parts prices** and **when to call a professional**
## Tools
Two families: **atomic facts** (cheap, for agents) and **full trees** (rich, for humans).
| Tool | What it returns | Payload |
|---|---|---|
| `cause_ranking` | causes ranked most→least likely, each with `likelihood` (最常见 / 常见 / 较常见 / 少见) + `difficulty` + `diy_ok` | ~520 chars |
| `price_band` | on-site repair price range in CNY | ~410 chars |
| `stop_check` | risk class (`gas` / `electric` / `height`) + why you must stop before DIY | ~420 chars |
| `list_categories` | 40 categories with symptom counts | — |
| `search_symptoms` | keyword search across all 224 symptoms | — |
| `get_symptom` | full diagnosis tree: questions, causes, fixes, parts, prices | ~2,350 chars |
| `diagnose` | ranked `likely_causes` + clarifying questions — best for AI assistants | — |
**Why atomic tools matter:** an agent that only needs a number should not pay for a whole
tree. Single-field calls cost **77–83% less** context than `get_symptom` (measured on
`air_conditioner/not_cooling`: 532 / 410 / 420 vs 2,350 chars). Every response carries
`v / dataset / as_of / src / lic / attr` so an upstream agent can decide whether to trust
and cite it.
### What we deliberately do NOT sell
Step-by-step text — frontier models already write it well. What they cannot invent is
**prior probability, regional price, and the "stop now" judgment**. Those three are what
these tools exist for.
## Live endpoint
```
POST https://wenjia.net/mcp (after ICP filing; currently http://59.110.26.77/mcp)
Health: GET /mcp/health
Transport: Streamable HTTP, JSON-RPC 2.0, protocol 2025-06-18
```
### Example
```bash
curl -s -X POST http://59.110.26.77/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"diagnose",
"arguments":{"category_id":"heating","symptom_id":"all_cold"}}}'
```
## Run it locally
```bash
git clone <this repo>
cd <repo>
PORT=8765 python3 server.py
# POST http://127.0.0.1:8765/mcp
```
No pip install. Python 3.9+.
### systemd / nginx
See `deploy/wenjia-mcp.service` for a hardened unit (read-only FS, `www-data`,
auto-restart) and put nginx in front:
```nginx
location = /mcp {
proxy_pass http://127.0.0.1:8765;
proxy_http_version 1.1;
proxy_set_header Host $host;
}
```
## Data
`data/mcp_data.json` — the full dataset, regenerated from the source knowledge trees.
Licensed **CC BY 4.0**: reuse freely, cite "问家 wenjia-home-fix-diagnosis".
Attribution line used across our content:
`数据来自问家家庭维修诊断树(40 品类 224 症状,持续更新)`
### Honest limitations
- `prob_prior` values are **literature-and-experience priors, not repair-ticket statistics**.
Treat them as a ranking signal, never as precise frequencies.
- Prices are 2026 Chinese market ranges (CNY); regional variation not modeled.
- Coverage is urban household scenarios; rural self-built housing is out of scope.
- Every symptom carries a `see_pro` field — when to stop and call a licensed technician.
Do not strip it when redistributing.
## License
- **Code**: MIT (see `LICENSE`)
- **Data**: CC BY 4.0 (see `DATA-LICENSE.md`)
Not affiliated with any appliance manufacturer. Brand names in the data appear only as
references to public troubleshooting documentation.
TDQS
Scored across 10 tools
There are effectively two overlapping clusters: three symptom-finding entry points (diagnose, find_symptom, search_symptoms) and three overlapping views of the same diagnostic tree (get_symptom superset of fix_plan superset of cause_ranking). The descriptions do a good job of stating 'use me when / don't use me' boundaries and explicitly route between them, so an agent can usually recover, but the boundaries are decided by the user's phrasing rather than by a distinct resource, which is a misselection hazard.
Mostly readable verb_noun names (list_categories, get_category, get_symptom, search_symptoms, find_symptom) but the other half are bare noun/adjective phrases (price_band, fix_plan, cause_ranking, stop_check) or an unqualified verb (diagnose). Worse, two near-identical actions use different verbs — search_symptoms vs find_symptom — which weakens the naming signal exactly where disambiguation is already thin.
Ten tools is a well-scoped size for a diagnostic knowledge base, and the token-efficiency split (cause_ranking < fix_plan < get_symptom) is a defensible design. It is slightly padded, though: three retrieval entry points and three overlapping detail views mean at least one or two tools could be collapsed without losing capability.
The lifecycle is well covered: browse categories, list symptoms, search/find by natural language, triage from vague complaints, ranked causes, full repair steps with parts, price bands, and a mandatory safety gate. Minor gaps remain — no parts/accessory lookup as a first-class query, no flat cross-category symptom listing, and no way to go from cause back to candidate symptoms — but an agent can work around these via search and get_symptom.