
validar-codigo-medico
io.github.encodiv1.0.1更新於 Sep 30, 2026
Validates ICD-10-CM against the real FY2026 catalog (NCHS/CDC) and CPT by structure/category.
概覽
對照官方 FY2026 目錄驗證 ICD-10-CM 代碼,並依結構驗證 CPT 代碼,每次呼叫以 USDC 計費。
- 功能
- 提供一個工具 validate_medical_code,接收 system 與一組代碼。system 為 "icd10" 時,會在隨服務打包的 FY2026 ICD-10-CM 可計費代碼目錄(約 74,719 筆)中查詢,並回傳官方簡短描述。system 為 "cpt" 時,依格式與數字區間判斷屬於 Category I、II 或 III,但不回傳處置描述。每次呼叫皆為無狀態,都會建立新的伺服器實例。
- 適用情境
- 適合助理需要確認某個 ICD-10-CM 代碼是否為真實可計費代碼,或判斷 CPT 代碼結構是否有效時使用,例如清理或複核編碼資料。它不能取代合格專業編碼人員,也不提供 CPT 描述。
- 執行需求
- 透過 streamable HTTP 存取的遠端 MCP 端點;未宣告需要本機執行環境、套件、帳號或 API 金鑰。呼叫按次計費,需要能在 Base 主網以 USDC 付款的錢包;付款資訊隨 MCP JSON-RPC 請求本身傳遞。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 validar-codigo-medico,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"validar-codigo-medico": {
"type": "http",
"url": "https://validar-codigo-medico.encodari.workers.dev/mcp"
}
}
}README
validar-codigo-medico
[validar-codigo-medico MCP server]
Remote MCP server (Cloudflare Workers) with one tool that validates medical codes against real data:
validate_medical_code—system: "icd10"does a real lookup against the official billable ICD-10-CM code catalog (FY2026, NCHS/CDC, public domain as a work of the U.S. government) and returns the official short description.system: "cpt"validates the real structure of a CPT code (Category I: 5 digits; Category II: 4 digits +F; Category III: 4 digits +T) and estimates its area by public numeric range — it doesn't include per-code descriptions, because the CPT catalog is owned by the AMA and requires a paid license (it can't be redistributed).
No database, no persistent state between calls: each call builds a fresh McpServer (see createServer() in src/index.ts). The ICD-10-CM catalog (~6MB, 74,719 codes) is bundled into the Worker itself as static data (src/tools/data/icd10cm.ts) and parsed once per isolate into an in-memory Map — see src/tools/codigoMedico.ts.
Why CPT has no descriptions
The CPT (Current Procedural Terminology) description catalog is owned by the American Medical Association and requires a paid license to redistribute its content — unlike ICD-10-CM, which is a work of the U.S. government and therefore public domain. That's why this tool validates a CPT code's real format (regex + numeric range, publicly available information about the code's structure) but doesn't offer the procedure's description: that requires an AMA-licensed codebook.
Billing (x402)
Charges per call via x402 — real USDC payment on Base mainnet, against the Coinbase Developer Platform (CDP) facilitator. The payment travels inside the MCP JSON-RPC itself (_meta), not as an HTTP header; see src/payments.ts.
An unpaid tools/call returns isError: true with the accepts (network, amount, payTo) the client needs to pay and retry — not an unexplained exception.
Structure
Updating the ICD-10-CM catalog
When NCHS publishes a new version (new fiscal year or addenda):
- Download the "Code Descriptions" zip from
https://ftp.cdc.gov/pub/health_statistics/nchs/publications/ICD10CM/<YEAR>/. - Unzip it and locate
icd10cm-codes-<YEAR>.txt. node scripts/gen-icd10-data.mjs <path-to-txt> src/tools/data/icd10cm.ts.
Running it locally
⚠️ Note on wrangler dev: the real Cloudflare Workers runtime (workerd) requires macOS 13.5+. If your Mac has an older version, wrangler dev (and npm run dev) will fail. This project includes a plain-Node shim that runs the exact same fetch() handler without needing workerd.
1. Install dependencies
2. Run the unit tests
3a. If your wrangler dev works (macOS 13.5+, Linux, Windows)
3b. If wrangler dev fails because of the macOS version
Starts at http://localhost:8787/mcp, reading CDP credentials from ~/.mcp-tools-factory-credentials.env (shared across all tools in this factory).
4. Test with curl
Responses come as Server-Sent Events (event: message + data: {...}); the data: line is the usual JSON-RPC response.
Deploy and listings
Deployed at https://validar-codigo-medico.encodari.workers.dev/mcp (Cloudflare Workers). Published on the official MCP registry, Smithery, mcp.so, and with an open PR to awesome-mcp-servers.
What it doesn't do (yet)
- Doesn't include per-code CPT descriptions (see "Why CPT has no descriptions" above).
- Charges on Base mainnet with real money. To switch back to testnet (Base Sepolia,
eip155:84532) during development, changeNETWORKinsrc/payments.ts. - No database or persistent state between calls (beyond the billing config and the ICD-10-CM catalog Map, cached in memory per isolate).
- Not medical or billing advice: this is a structural/catalog validation, not a substitute for a certified professional coder.
來源:README.md,提交 6a10b7b
工具
0版本歷史
1- v1.0.1最新Sep 16, 2026

