jyb-drug-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@jyb-drug-mcp帮我查天津离我最近的有货连花清瘟胶囊的药店"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
jyb-drug-mcp
津医保(天津市医保局 App)「医药云平台 · 定位药品上架药店」功能的 MCP (Model Context Protocol) server。
让任意支持 MCP 的 AI 客户端(Claude Desktop、omp 等)可以直接:
按药品名检索药品目录(拿到
drugCode)查询该药品的有货机构列表:机构名、最新价格、与你的距离、最后交易日期(lastTrnsDate)、坐标
一步式:药品名 → 自动匹配候选 → 有货药店列表
English: An MCP server exposing the Tianjin Medical Insurance app's "drug → stocking pharmacies" API (search drugs, query stocking institutions with price / distance / last transaction date).
免责声明:本项目仅供学习与个人研究,通过自己账号的会话凭据访问自己可见的数据。 请遵守相关服务条款与当地法规,勿用于商业用途或高频爬取。与官方无关。使用风险自负。
工作原理(协议摘要)
业务接口位于 https://jyt.ylbz.tj.gov.cn/app-prod/,HTTPS 之外还有一层应用层保护:
报文加密:请求与响应体均为 AES-256-CBC(PKCS7) 密文的 Base64; key(32 字符)/ IV(16 字符)为登录时下发、会话级有效的 UTF-8 字符串
请求签名(均不覆盖 body):
jyb-signature = md5(timestamp + nonce + token + "jyb4443")X-Tif-Signature = SHA256(timestamp + paastoken + nonce + timestamp)(paastoken 为空)
鉴权:请求头
token(登录会话)
三个会话凭据(token / key / iv)需要通过一次抓包获取,见 docs/OBTAINING_CREDENTIALS.md(含自动化探针脚本)。
Related MCP server: kfda-mcp
安装
pip install "mcp<2" pycryptodome要求 Python 3.10+。
配置凭据
cp .env.example .env # 填入 JYB_TOKEN / JYB_AES_KEY / JYB_AES_IVserver 启动时自动加载同目录 .env(不覆盖已有环境变量);.env 已被 .gitignore
排除。凭据获取的完整流程见 docs/OBTAINING_CREDENTIALS.md。
MCP 客户端配置
Claude Desktop / 通用 stdio 配置:
{
"mcpServers": {
"jyb-pharmacy": {
"type": "stdio",
"command": "python3",
"args": ["/path/to/jyb-drug-mcp/server.py"]
}
}
}omp:在 ~/.omp/agent/mcp.json 的 mcpServers 下加入同样条目。
工具
工具 | 说明 |
| 药品名 → 候选药品(drugCode / 规格 / 厂家) |
| drugCode → 有货机构(价格 / 距离 / 坐标 / lastTrnsDate) |
| 一步式:自动尝试候选,返回首个有货结果 |
| 凭据过期后热刷新(也可直接改 |
已知边界
凭据是会话级的:App 重新登录即失效,重新跑一遍抓包流程即可
purcRcdFlag(采购记录视角)公开数据目前基本为空;采购明细未开放行政区划参数当前固定为天津(
admdvs=120000)
开发
python3 smoke_test.py # 配置好 .env 后运行全链路冒烟测试capture_addon.py 是抓凭据用的 mitmproxy 插件(见凭据文档),不属于运行时依赖。
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Search AI capabilities across AWS Marketplace and the Official MCP Registry.
Report pharmacy stock, and post a pharmacy's verified status, from your AI assistant.
Free search over ~50k agent tools: paid x402 APIs and MCP servers. Price, networks, how to call.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables querying of Chinese-Western medicine interactions with comprehensive drug information, risk assessment, and clinical recommendations. Supports searching medicines, checking interactions individually or in batches, and provides safety guidance with severity classifications.MIT
- AlicenseAqualityCmaintenanceEnables LLM agents to query Korean drug, DUR safety rules, and health supplement databases via MCP protocol.4MIT
- AlicenseNot gradedqualityBmaintenanceEnables querying DrugSea/Yaohai pharmaceutical databases via MCP, including search, details, and facets for marketed China products, CDE regulatory pipeline, and cross-database queries.56 npmMIT
- AlicenseAqualityBmaintenanceGives AI assistants live access to US prescription drug prices by pharmacy with observation dates, the free discount card, and vetted US equivalents of foreign-brand medicines, all through the Model Context Protocol.1063 PyPIMIT